• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Historical Execution

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

    Strategy Historical Execution

    Forgive me for what I'm sure is a completely novice question, but I've been unable to find any information about this. When a strategy is enabled, why does it run retroactively through historical data first? As in, when I enable a strategy it appears to run through some number (I'm not sure how many) of bars on the chart before reaching the current "present" bar. Is there any way to disable this behavior?

    This causes problems because now all of my variables have been affected by historical data. For example, I have a variable that tracks my PnL and this causes it to have a value based on historical data, when it should be starting at 0. Now my strategy PnL is different from my account PnL. This is just one example, but it would be great if this could be disabled somehow.

    #2
    Hello,

    Thank you for the post.

    This is simply how the platform works, bars are evaluated from left to right starting at bar 0 in historical data. If you load X amount of data, all of that data would be processed. In the case you want to omit historical data from being used, you can.

    If you are manually coding, you would just need to check that the state is not equal to Historical:

    Code:
    protected override OnBarUpdate()
    {
       if(State == State.Historical) return;
    You can also do this using the Builder, in your conditions you can check Misc -> CurrentState != Misc -> State.Historical

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Fantastic, that's exactly what I needed.

      Thanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by bomanpbm, Today, 09:27 PM
      0 responses
      1 view
      0 likes
      Last Post bomanpbm  
      Started by tgn55, Today, 08:47 AM
      0 responses
      8 views
      0 likes
      Last Post tgn55
      by tgn55
       
      Started by ballboy11, 05-04-2019, 10:26 AM
      6 responses
      58 views
      0 likes
      Last Post Kermit
      by Kermit
       
      Started by mrlucky1x, Yesterday, 10:01 PM
      0 responses
      15 views
      0 likes
      Last Post mrlucky1x  
      Started by roger556, Yesterday, 09:22 PM
      0 responses
      8 views
      0 likes
      Last Post roger556  
      Working...
      X