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:	209
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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    87 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    118 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X