Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Daily chart VOL[0] not equal to Market Analyzer Daily volume
Collapse
X
-
I don't understand your answer. The numbers are generally orders of magnitudes different. Market analyzer might be reporting 1,000 volume, and VOL[0] is reporting 25,000. Are you saying, for example, looking at a daily chart, at 1pm EST VOL[0] is not defined because today's session is not yet historical, so I can only access VOL[1] ? But, VOL[0] always return a value, what value is it reporting?Originally posted by NinjaTrader_AdamP View Postmonpere,
This has to do with "non-last qualifying" trades. These are not reported by all data providers on a tick-by-tick basis, and are only reported as historical data.
Comment
-
Here is a simple indicator, output, and Market Analyzer screens, applied to a daily chart and all using the same session template.Originally posted by NinjaTrader_AdamP View Postmonpere,
Likely I'll need to see an example to really see what is going on here, however note my prior explanation as to why there may be some difference. Do you have code or output you can display here in this thread?
------ Code -----
protected override void Initialize() {
CalculateOnBarClose = false;
}
protected override void OnBarUpdate() {
Print("Bar " +CurrentBar +" " +Time[0].ToString("ddMMMyy") +" Volume " +VOL(BarsArray[0])[0]);
}Last edited by monpere; 10-01-2012, 06:03 AM.
Comment
-
------ Code -------Originally posted by NinjaTrader_AdamP View Postmonpere,
Likely I'll need to see an example to really see what is going on here, however note my prior explanation as to why there may be some difference. Do you have code or output you can display here in this thread?
protected override void Initialize() {
CalculateOnBarClose = false;
Add("CL 11-12",PeriodType.Day, 1);
Add("CL 12-12",PeriodType.Day, 1);
Add("CL 01-13",PeriodType.Day, 1);
}
protected override void OnBarUpdate() {
Print(Instrument.FullName +" " +Time[0].ToString("ddMMMyy") +" Volume " +VOL()[0]);
}Last edited by monpere; 10-01-2012, 06:27 AM.
Comment
-
monpere, thanks for the scripts - which data provider are you working with here? One value you access would be native to the bars themselves (VOL) while the .DailyVolume would be taken directly from the market providers Level 1 data stream provided - you could access this value as well in OnMarketData() in your code.
Comment
-
I use Interactive Brokers, and Mirus. I would like to get the volume displayed in the DailyVolume field of Market Analyzer. Are you saying I can get that value from OnMarketData()? If so, can you please provide the line of code that would do that inside OnMarketData()Originally posted by NinjaTrader_Bertrand View Postmonpere, thanks for the scripts - which data provider are you working with here? One value you access would be native to the bars themselves (VOL) while the .DailyVolume would be taken directly from the market providers Level 1 data stream provided - you could access this value as well in OnMarketData() in your code.
Thanks
Comment
-
Correct, this would be available in OnMarketData() and is what the Market Analyzer would access - it will be called / updated on each change in DailyVolume:
protected override void OnMarketData(MarketDataEventArgs e)
{
if (e.MarketDataType == MarketDataType.DailyVolume)
Print("DailyVol = " + e.Volume);
}
Comment
-
Thanks. Does OnMarketData() gets called once for each BarsInProgress, or does it only apply to BarsInProgress 0?Originally posted by NinjaTrader_Bertrand View PostCorrect, this would be available in OnMarketData() and is what the Market Analyzer would access - it will be called / updated on each change in DailyVolume:
protected override void OnMarketData(MarketDataEventArgs e)
{
if (e.MarketDataType == MarketDataType.DailyVolume)
Print("DailyVol = " + e.Volume);
}
Comment
-
Is this DailyVolume data available anywhere before OnMarketData is called the first time? For low liquidity or inactive contracts, it may take a while before getting the first call to OnMarketData.Originally posted by NinjaTrader_Bertrand View PostCorrect, this would be available in OnMarketData() and is what the Market Analyzer would access - it will be called / updated on each change in DailyVolume:
protected override void OnMarketData(MarketDataEventArgs e)
{
if (e.MarketDataType == MarketDataType.DailyVolume)
Print("DailyVol = " + e.Volume);
}
Comment
-
MarketAnalyzer has a DailyVoume value before the first OnMarketData() call. Where does it get that value? How can I get access to that value?Originally posted by NinjaTrader_Bertrand View PostUnfortunately that this only be available in OnMarketData(). An alternative could be running a custom count in your OnBarUpdate() for this figure based on the applied session template hours.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
580 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
335 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
102 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
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
552 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment