Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninja script is not executing on live market or market replay

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

    Ninja script is not executing on live market or market replay

    Hello, I have a script that I ran in backtest and it produced results. However when I enable the strategy on live data or market replay, it still shows the trades it would have taken previously, but from that point on it does not enter any positions.
    The strategy is set to calculate OnPriceChange, using Cumulative Delta, Donchian Channel, and Volume as indicators. All the logic is set under OnMarketData, and I am not using OnBarUpdate in this case. I also use High, Low and Close values.
    Could you please help me? What could make the code run in backtest but not in live data. Thanks for the help in advance

    #2
    Hello, thanks for writing in. The best tool to use to debug this is the Print command. This will show you why a strategy is not running by printing out the data the strategy is reading:



    The reason a strategy might take trades on a backtest but not live data are numerous, it comes down to analyzing if your entry conditions are becoming true and checking if entry methods are actually being reached in code.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    45 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    31 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X