Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtest in playback without trades in the past.

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

    Backtest in playback without trades in the past.

    I am testing a strategy that I have created but when I enable it, it starts doing calculations on the data that I have loaded from the previous days. How can I program my strategy so that it only calculates from the moment I enable and execute it and not in previous periods?

    Here is an example:
    Click image for larger version

Name:	prueba.PNG
Views:	215
Size:	213.8 KB
ID:	1141680

    Without having started playback yet, there are already some trades executed. How can I make the strategy not start trading until I hit play?

    Thank you very much.

    Last edited by lju45; 02-13-2021, 07:03 AM.

    #2
    Hello lju45,

    if (State == State.Historical)
    return;

    Below is a link to the help guide.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    163 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    82 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    125 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    206 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    184 views
    0 likes
    Last Post CarlTrading  
    Working...
    X