Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Debug/Step through with Multi-Timeframe

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

    Debug/Step through with Multi-Timeframe

    Hi. While writing/debugging, I like the ability to step through one bar at a time to print debug values, make changes to my script, and then reload with the F5-key. However, if I simply add the following line, the indicator immediately steps through all the bars on the chart...

    Add(PeriodType.Minute, 1);

    Hope I'm missing something here. Is there a way to add multi-timeframe so that I can still step through the historical chart one bar at a time?

    Thank You,
    Doug

    Further detail: As a simple test, I took the default indicator script and only added the above line to initialize, and added one line to print current bar number. All bar numbers were immediately listed in the Ourput window.

    #2
    Doug,

    OnBarUpdate() will be called for each bar series added. Try isolating using BarsInProgress.

    In other words:
    if (BarsInProgress == 0) //BarsInProgress == 0 for primary, BarsInProgress == 1 for next etc
    {
    //Do something
    }

    VT

    Comment


      #3
      Doug, correct this would be an expected difference in loading of the bars series indexes for single vs multi series scripts.
      BertrandNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Rapine Heihei, Today, 08:19 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by Rapine Heihei, Today, 08:25 PM
      0 responses
      6 views
      0 likes
      Last Post Rapine Heihei  
      Started by f.saeidi, Today, 08:01 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by Rapine Heihei, Today, 07:51 PM
      0 responses
      8 views
      0 likes
      Last Post Rapine Heihei  
      Started by frslvr, 04-11-2024, 07:26 AM
      5 responses
      98 views
      1 like
      Last Post caryc123  
      Working...
      X