Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
convert volume to average volume
Collapse
X
-
Hello peterhxu7,
Thank you for your post.
Are you looking for a comparison of the first five minutes' volume today against yesterday's first five minutes' volume?
A basic volume average can be calculated with SMA, for example: SMA(Volume, 14)[0]. This would give you the 14 period moving average of the volume.
-
not really. i would like to set first 5 minute volume from 9:31am to 9:35am to SMA(Volume, 14)[0]
something like
VOL()[0] at 9:31 = SMA(Volume, 14)[0]
VOL()[0] at 9:32 = SMA(Volume, 14)[0]
VOL()[0] at 9:33 = SMA(Volume, 14)[0]
VOL()[0] at 9:34 = SMA(Volume, 14)[0]
VOL()[0] at 9:35 = SMA(Volume, 14)[0]
Comment
-
Hello peterhxu7,
Thank you for your response.
I do not beleive I fully understand but I am going to try an example here, let me know if this it what you meant.
We will take the first five minute volumes, store them in individual doubles and then average those values:
Code:if(Bars.BarsSinceSession == 5) { vol1 = Volume[4]; vol2 = Volume[3]; vol3 = Volume[2]; vol4 = Volume[1]; vol5 = Volume[0]; avgVol = (vol1 + vol2 + vol3 + vol4 +vol5)/5; }
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
149 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
84 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
129 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
125 views
1 like
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
102 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment