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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      181 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      334 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      258 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      358 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      187 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X