Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Daily Volume indicator
Collapse
X
-
Hello Tomass, thanks for your question.
The OnMarketData method can be overridden for the daily volume. e.g.
Please let me know if I can assist any further.Code:double DailyVol; protected override void OnMarketData(MarketDataEventArgs marketDataUpdate) { if (marketDataUpdate.MarketDataType == MarketDataType.DailyVolume) DailyVol = marketDataUpdate.Volume; }
-
Thank you very much. I am used to NT7 and kinda starting with NT8, can you please advice me any example of indicator using marketDataUpdate.Volume, or any other indicator that I can try to reverse engineer it? Basically I am trying to achive Volume indicator (similar to VolumeUpDown), but instead of volume on each tick it will be compounding volume of day, like in DailyVolume in market Analyzer. Hope it makes sence and will be glad for any advice to make this work. Thank you for your patience and time.
Comment
-
Hi Tomass, thanks for your reply.
It could be done like the example attached. Note the DailyVolume will only be available in real time data. To get this information in historical mode one would need to manually accumulate the volume data from the beginning of each session with the MarketDataType.Last data type. See this page for more details on tick replay.
Kind regards.Attached Files
Comment
-
Hi Chris,
I do need the DailyVolume for historical data in one of my indicators. You have attached a link, which indicates that the Tick Replay must be used. I have an indicator that only Calculates OnClose and for performance reason i avoid Tick Replay. Is there a way to get the DailyVolume for historical data without Tick Replay?
Thx.
Comment
-
Hi Stefan, unfortunately, to get this exact MarketDataType.DailyVolume value from OnMarketData historically you do need to use tick replay to get this piece of information. The alternative is to use AddDataSeries() to add a daily series, then take the Volume information from that series.
if(BarsInProgress == 1)
{
Print(Volumes[1][0] + " " + Times[1][0]);
}
Comment
-
Hi Chris,Originally posted by NinjaTrader_ChrisL View PostHi Tomass, thanks for your reply.
It could be done like the example attached. Note the DailyVolume will only be available in real time data. To get this information in historical mode one would need to manually accumulate the volume data from the beginning of each session with the MarketDataType.Last data type. See this page for more details on tick replay.
Kind regards.
This script is awesome. How could it be transformed to calculate the daily average traffic for the past x days, and then, using this script, compute a percentage value from the quotient of the two in terms of what percentage of the average has already been achieved in this session? And to display this in the same way on a plot line chart?
Thank you,
David
- Likes 1
Comment
-
Hello David,
You can use a loop to accumulate the Volume of bars to a variable.
private double accumulatedVolume;
for (int index = 0; index < 10; index++)
{
accumulatedVolume += Volume[index];
}
If you want to divide the current bars Volume[0] with the accumulatedVolume this would appear as:
Volume[0] / accumulatedVolume
Below is a link to a support article on adding plots and setting the value.
Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
597 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
343 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 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
556 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
555 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment