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 SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      90 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      49 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      23 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      31 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      31 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X