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 argusthome, 03-08-2026, 10:06 AM
      0 responses
      88 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      48 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      31 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      34 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      69 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X