Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

% Change in Average Volume

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

    #31
    actually I think what I need is for the

    30 day Volume SMA / 13 value to be the value of the (SMA(Volume, Bars.BarsSinceSession + 1)[0]);

    Comment


      #32
      Unfortunately I am not following you. Dividing SMA by 13 would have no relationship with anything to do with SMA volume of the current session.
      Josh P.NinjaTrader Customer Service

      Comment


        #33
        lol Josh, I know, I am having a hard time following myself, my brain hurts...

        I guess basically I need a way for them to have a relationship

        Basically if the 30 day volume SMA is 13 million, I need the first 30 minute bar to read 1 million the 2nd 30 minute bar to read 2 million the 3rd 30 minute bar to read 3 million..

        if that makes any sence... This code is close, unfortunately what it does not do is increase the SMA during the session and thats what I need and can't figure out...

        Plot0.Set(((SUM(Volume, Bars.BarsSinceSession + 1)[0] - SMA(Volume, 390)[0]) / SMA(Volume, 390)[0]) * 100);

        Comment


          #34
          Sorry, I'm having a hard time here following your request, too - where would the 390 in your code come from? Shouldn't that be the dynamically increasing bars in the session, too?

          Comment


            #35
            Hi Bertrand,

            "Shouldn't that be the dynamically increasing bars in the session, too?"

            Yes, that is correct and exactly what I need, if the 390 volume SMA to be added to each bar in the session, the same way the SUM volume for session does. So if the 390 SMA is 1 million I need the SMA for 1st bar in session to read 1 million, then if the 2nd bar 390 SMA reads 1.5 million I need the session SMA to read 2.5 million and so on...

            Is this possible?

            Thanks for the help and Happy New Year!

            Comment


              #36
              Hi, I think I see what you are saying, sorry for the confusion...

              The code perhaps should look something closer to this?

              Plot0.Set(((SUM(Volume, Bars.BarsSinceSession + 1)[0] - (SMA(Volume, 390)[0])(Bars.BarsSinceSession + 1)[0]) / (SMA(Volume, 390)[0])(Bars.BarsSinceSession + 1)[0]) * 100);

              Cant get it to compile to check, sure there are problems in it, just posting to see if I am more on the correct path...

              Thanks!

              Comment


                #37
                Alright, lol, ignore the last posts ( I think)

                I came up with this, its still missing something... I think perhaps a loop? or a way for it to continue and add as the day progresses...

                Plot0.Set(((Volume[0] + Volume[13] / 30 - SMA(Volume, 390)[0]) / SMA(Volume, 390)[0]) * 100);

                Thanks for any help and ideas! It gets the figures by the end of the day....

                Comment


                  #38
                  On which kind of chart are you attempting to run it? Intraday chart? Then I feel you need a MultiSeries indicator to be able to work 30 day avg volume and then compare to the intraday developing one.

                  Comment


                    #39
                    Hi Bertrand, thanks for the reply...

                    I would like it to run on 30 minute charts, so the above code would be good for the first bar but then after the first hour of trading I would need the code to take the first hour of the last 30 days and compare it to the volume SMA which has been added onto from the previous sessions bars volume SMA value... and on and on for all the 30 minute bars of the session...

                    Can a MultiSeries code accomplish this?

                    also, for this part of the code so far "Volume[0] + Volume[13] / 30 : what is the easiest way to get this Volume[0] + Volume[13] to go back each of the 30 periods?

                    (Volume[0] + Volume[13]) + (Volume[13] + Volume[26]) + (Volume[26] + Volume[39]) / 30

                    would that work?

                    Thanks again...

                    Comment


                      #40
                      tsirtdeal,

                      This requires working with an array list to store multiple values per bar. This can get pretty involved and from this point it may be best to work with a NinjaScript consultant to help with the specific implementation.
                      Ryan M.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      649 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      370 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      109 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      574 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      576 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X