< All Topics

Known TradeStation Bugs and Issues

There are several TradeStation bugs and issues that I have reported and/or tracked over the years.  I decided to create this page to consolidate them with their status and potential workarounds, some of which I have added to MultiWalk.

Issue/bug: LIBB

Incorrect trades when using LIBB (Look-Inside-Bar Backtesting).  Workaround is to add condition “If MarketPosition <> -1” before sellshort orders and “If MarketPosition <> 1” before buy orders.

Issue/bug: Negative price contracts and SetStopLoss

Incorrect trades when using SetStopLoss with negative contracts.  Workaround is complicated.  See below MW article.

Issue/bug: Impossible price/out-of-bounds fills using SetProfitTarget with SetStopContract

Profit target fills are above the high or below the low price when backtesting.  This is apparently caused by a combination of options used: “Fill entire order when price exceeds limit price”, SetStopContract and SetProfitTarget.

Issue/bug: Opt vs chart results with open next bar

Optimization results are different from chart results when using “open next bar”.  It appears that this issue only effects the first trade if it is on the first bar of the chart or optimization.  Workaround is to prevent trading on first bar using “If BarNumber > 1 then begin <trading strategy code logic> end;”  This workaround is built into MultiWalk when using the Settings->Strategy Settings option “Enable checks to known TS bugs”.

Issue/bug: Opt vs chart results with SetExitOnClose

If SetExitOnClose is used, optimization results are different than chart results.  Workaround is to avoid using SetExitOnClose.  Use my workaround to exit the bar before the end-of-session bar.  See below MW article.

Issue/bug:
StrategyHost object results in real-time dropped trades

StrategyHost event handler can only have 1 event per tick and does not correctly handle a entering a new position after another position is closed or stopped out that was in the same direciton.  I.e., if a long position is stopped out and the strategy logic immediately triggers another long entry, the new long order is not created.  Workaround is to not allow strategy to exit trade and immediately place open position in same direction that was just closed (or stopped out).  The confusing issue with this bug is that it backtests correctly, but will not perform the same was as the backtest during real-time trading.

Issue/bug: StrategyHost event handler corrupts strings/call stack.

StrategyHost events were not thread-safe and corrupted stack space. Using my own global mutex/locks in event handlers solved the issue. Even though this appears fixed as of Update 73, there is no negative impact on using my own event locks, so will continue to do so in case this issue resurfaces in a later update.

Issue/bug: StrategyHost with LIBB

Incorrect trade results when using StrategyHost with LIBB

Issue/bug: Impossible price/out-of-bounds fills

Seems like this bug may only effect negative price contracts (i.e. @RB). Some fills are over/under high/low — but only barely. Seems like this may be machine floating point representation/rounding issue.

Table of Contents