Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Daily chart VOL[0] not equal to Market Analyzer Daily volume
Collapse
X
-
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
-
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
-
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.BertrandNinjaTrader Customer Service
Comment
-
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);
}BertrandNinjaTrader Customer Service
Comment
-
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
-
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
-
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 algospoke, Yesterday, 06:40 PM
|
2 responses
19 views
0 likes
|
Last Post
by algospoke
Today, 07:04 PM
|
||
Started by ghoul, Today, 06:02 PM
|
3 responses
14 views
0 likes
|
Last Post Today, 06:43 PM | ||
Started by jeronymite, 04-12-2024, 04:26 PM
|
3 responses
45 views
0 likes
|
Last Post
by jeronymite
Yesterday, 10:10 PM
|
||
Started by Barry Milan, Yesterday, 10:35 PM
|
7 responses
20 views
0 likes
|
Last Post Today, 06:16 PM | ||
Started by AttiM, 02-14-2024, 05:20 PM
|
10 responses
181 views
0 likes
|
Last Post
by jeronymite
Today, 06:11 PM
|
Comment