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 tony_28217, Today, 07:04 PM
      0 responses
      3 views
      0 likes
      Last Post tony_28217  
      Started by flybuzz, Today, 10:33 AM
      1 response
      9 views
      0 likes
      Last Post flybuzz
      by flybuzz
       
      Started by spencerp92, 10-10-2023, 09:56 AM
      4 responses
      304 views
      0 likes
      Last Post flybuzz
      by flybuzz
       
      Started by samish18, Yesterday, 10:13 AM
      1 response
      25 views
      0 likes
      Last Post NinjaTrader_Eduardo  
      Started by Austiner87, Today, 05:02 PM
      0 responses
      7 views
      0 likes
      Last Post Austiner87  
      Working...
      X