Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Validate other temporalities
Collapse
X
-
Hi carguzpa,
You can use the AddDataSeries() function and the Volumes object to obtain the volume for a 5-minute time frame.
Please refer to the code below:
For more information about the AddDataSeries() function and the Volumes objects, you can access the following links to learn more:Code:protected override void OnStateChange(){ if (State == State.Configure) { // Adds a 5-minute Bars object to the strategy and is automatically assigned // a Bars object index of 1 since the primary data the strategy is run against // set by the UI takes the index of 0. AddDataSeries("AAPL", BarsPeriodType.Minute, 5); } } protected override void OnBarUpdate() { // Compares the primary bar's volume to the 5-minute bar's volume if (Volumes[0][0] > Volumes[1][0]) { Print("The primary bar's volume is greater"); } }
Regards,
William
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
227 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
146 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 12:02 AM
|
||
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
160 views
1 like
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
238 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
197 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment