Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Issue: seeing different ATR values between Backtest vs Live Sim Trading

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Strategy Issue: seeing different ATR values between Backtest vs Live Sim Trading

    So here's another question about odd behavior from a custom strategy. I'm working on some non-time bar strategies - my issue is with an intraday strategy that's using Volume bars to trade Forex (specifically, the EURUSD). Basically: I have a strategy that looks promising, and is well behaved, when running a backtest on historical data. However, when I activate the strategy, running it Live on a Simulated account, the strategy frantically generates buy and sell orders - often every ten seconds or so.

    did some due diligence, and Print-statement debugging, and found the culprit: the innocent, plain-vanilla ATR() function for Average True Range. In my strategy, I use ATR to calculate risk tolerance, stop losses, and profit targets. In a backtest, everything is hunky-dory. But when running the strategy live, the ATR() values seem ridiculously small. For example, if the strategy executed a trade in Backtesting, and saw an ATR value of around 10 pips, then in live trading, I'm seeing an ATR on the order of 100-1000 times smaller ... hundredths of a pip. So naturally, ordinary market motion is triggering these ridiculously small stop losses.

    So that makes the question: why would I see a different set of values from the stock ATR() function, between a StrategyAnalyzer Backtest and Live Trading in a simulated account?
    A few additional data points:
    - my Forex data provider is FOREX.com.
    - I used the same strategy to trade micro-ES contacts (MES) through NinjaTrader's brokerage and feed. There were no problems.

    Any help, clues, or interesting guesses would be greatly appreciated.

    #2
    Hello pbailey19,

    Thank you for your post.

    Please review the help guide document on the differences on real-time vs backtest (historical).
    http://ninjatrader.com/support/helpG...ime_vs_bac.htm

    It is expected that a strategy running real-time (live brokerage account, live market simulation, Playback connection etc...) will produce different results than the performance results generated during a backtest.

    When in historical data, only the Open, High, Low, and Close will be available and there will be no intra-bar data. No intrabar information is known for the script to process when backtesting. All prices and actions come from and occur when the bar closes as this is all the information that is known.​

    You may consider using the Playback connection with Market Replay data to test your script to have the script mimic as if it were running realtime.

    Playback: https://ninjatrader.com/support/help...8/playback.htm

    Please let me know if I may assist further.​

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    59 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    134 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    74 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X