This Setting Can Completely Change Your Tradestation Backtest Performance
An Important Backtesting Consideration with Longer Time Frame Bars, Limit Orders and Stop Loss Orders
There are a many nuances to backtesing with Tradestation that can result in overly optimistic backtests compared to live performance. In this post, we’ll dive into Look-Inside-the-Bar Backtesting ('“LIBB”) and how it affects backtesting performance.
The Backtesting Engine:
Backtesting in Tradestation is based on the Open-High-Low-Close (“OHLC”) of time-period based bars. For Example, if backtesting with Daily Bars, the backtesting engine will observe the open of the day, the highest point, the lowest point and the close. However, with this approach we do not see the path dependency throughout the day as the market moves around between the open and the close, besides for observing the high and low of the day.
Tradestations Assumptions:
Why is the path dependency of the price inside the bar important? Tradestation has to make some assumptions to calculate the backest results for strategies that include profit target and stop loss orders. For example, if the profit target and stop loss are both hit inside the range of the bar, the path-dependency is important to determine if the stop loss or profit target was hit first. Unfortunately, Tradestation makes the blanket assumption that the profit target was hit first, which results in overly optimistic backtests.
Selecting LIBB in Tradestation:
Luckily, there is a setting in Tradestation that will allow the backtest to observe a more granular time period during the backtest to provide more accurate results. Start by selecting ‘Studies’ → ‘Edit Strategies’ → ’Properties for All...’
There is a box labeled ‘Use Look-Inside-Bar Backtesting’ that you can check and I suggest updating the settings to use 1-minute time frame. The smaller the time-frame that is selected, the longer amount of time it will take to backtest, so please keep this in mind. This will help you avoid the curse of overfitting to Tradestation’s optimistic assumptions, especially on longer time frame bars.




