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:	223
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 kinfxhk, 07-14-2026, 09:39 AM
    0 responses
    7 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    59 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    41 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    47 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    38 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X