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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        155 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        90 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        137 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        130 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        107 views
        0 likes
        Last Post CarlTrading  
        Working...
        X