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:	204
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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    80 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    64 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X