30 day Volume SMA / 13 value to be the value of the (SMA(Volume, Bars.BarsSinceSession + 1)[0]);
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
% Change in Average Volume
Collapse
X
-
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]);
-
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
-
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
-
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
-
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
-
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
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
647 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
368 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
571 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
573 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment