Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time Reset Loop

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

    Time Reset Loop

    I am writing an indicator that will display a 2 minute volume graph on a one minute chart.

    Adding new volume to the previous bar's volume is easy, but it always adds the previous bars volume, so EVERY bar totals the previous bar.

    Really lost on how to write a "time reset" loop that happens every 2 minutes.

    Have looked at 'for loop' and 'time' , but still do not have a clear idea on how to put this together.

    Anyone with a snippet...it will be greatly appreciated!!!



    #2
    phoenix, have you considered a custom timer to reset this for you?

    Comment


      #3
      Bertrand,

      Thanks for your reply...will check this out this evening.

      phoenix

      Comment


        #4
        Originally posted by phoenix View Post
        I am writing an indicator that will display a 2 minute volume graph on a one minute chart.

        Adding new volume to the previous bar's volume is easy, but it always adds the previous bars volume, so EVERY bar totals the previous bar.

        Really lost on how to write a "time reset" loop that happens every 2 minutes.

        Have looked at 'for loop' and 'time' , but still do not have a clear idea on how to put this together.

        Anyone with a snippet...it will be greatly appreciated!!!

        If you need something to happen every second bar you can use something like this:

        Code:
         
        if(CurrentBar % 2 == 1)
        {
            MyVolume.Set(Volume[1] + Volume[0]);
        }

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        601 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        347 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        559 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        558 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X