Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnBarUpdate using Bar interval from Added dataseries not the interval set on chart

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

    OnBarUpdate using Bar interval from Added dataseries not the interval set on chart

    Hi
    I have just disvovered that if I add a DataSeries thgrough code to my Indicator like this
    Code:
    AddDataSeries(Data.BarsPeriodType.Minute, 1);
    eventhough my chart is set to 5 minutes
    the OnBarUpdate method uses the 1 minute interval instead of the 5 minutes set on the chart.

    Is this the way it should work ?

    Best Regards,
    Sune

    #2
    Hi Sune, thanks for your post.

    The 1-minute series is simply being called 4 more times for each 5-minute bar. If you print out the bar and time this will be clearer.


    Code:
    OnBarUpdate()
    {
        if(BarsInProgress == 0)
        {
            Print(Time[0] + " Primary series")
        }
    
        if(BarsInProgress == 1)
        {
            Print(Time[0] + " Secondary series")
        }
    }
    We have a multi time frame script guide here as well:



    Please let me know if you have any further questions.

    Comment


      #3
      Hi Chris

      Thanks that helped my understanding.

      Best Regards,
      Sune

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      166 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      88 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      128 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      208 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      185 views
      0 likes
      Last Post CarlTrading  
      Working...
      X