Migration from TradeStation

Migration from TradeStation

Concept mapping

TradeStation / EasyLanguageAlgolang
Strategy (file)Package (directory with .go file)
InputsStrategy struct fields with algolang: tags
VariablesStrategy struct fields (any Go type)
Buy / SellShortrs.Buy() / rs.SellShort()
Sell / BuyToCoverrs.ExitLong() / rs.ExitShort()
MarketPositionrs.MarketPosition()
Close / Close[1]rs.Close(0).Value() / rs.Close(0).Value(1)
Close of Data2rs.Close(1).Value()
Average(Close, 20)rs.Close(0).Average(20).Value()
Highest(High, 20)rs.High(0).Highest(20).Value()
CurrentBarrs.BarNumber(0)
Date / Timers.Time(0)
SetStopLossrs.SetStopLoss(dollars)
SetProfitTargetrs.SetProfitTarget(dollars)

Key differences for strategy developers

  1. Zero-based indexing: Algolang data series are indexed from 0 (primary), not 1 (Data1).
  2. Lookback syntax: Use Value(1) instead of [1] for previous bar values.
  3. Error handling: Strategy functions return error. Handle errors explicitly rather than relying on silent failures.
  4. Type safety: Go’s type system prevents many common EasyLanguage mistakes at compile time.
  5. No 32-bit limits: Large datasets, multi-threaded execution, highly parallel execution.
  6. Timezone awareness: Algolang handles timezones and DST automatically. No manual time offset calculations needed.
  7. Out-of-session-bar evaluation: Algolang evaluates orders on out-of-session bars, unlike EasyLanguage which ignores them.

EasyLanguage parser limitations

TradeStation’s EasyLanguage parser has numerous limitations that Algolang does not share:

  • Named orders must be string literals – string expressions like Buy ("PyramidLong" + NumToStr(pyramidCount, 0)) ... are not supported
  • Cannot use DataN where N is a variable
  • Cannot query how many data series have been provided to the strategy
  • No custom optimisation metrics
  • Variable back-references are arbitrarily limited (numerous TradeStation functions have hard-coded limits to avoid this)
  • Can back-refer scalars but not arrays
  • Orders cannot be placed inside loops
  • Portfolio support is extremely limited
  • Complex data structures are non-existent (and, no, OOEL does not fix this)
  • No fill callbacks or linked orders – there is no way to place exit orders in response to an entry fill, forcing a one-bar delay between entry and exit

All of these limitations are absent in Algolang.