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:	199
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 NullPointStrategies, Today, 05:17 AM
    0 responses
    50 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    126 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    69 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X