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
NT7 OnMarketData Question
Collapse
X
-
Thank you Chelsea, I'm having another problem displaying the Ask/Bid volume as they change in real time. I'm currently using the "DrawText" command to display the ask & bid volumes on the right side of my chart but these values are only updated when there is a change in price. My Print command is displaying every volume change in the Output console, but the DrawText is not updating the chart. Any thoughts?
Here's my code:
protected override void OnMarketData(MarketDataEventArgs e)
{
if (e.MarketDataType == MarketDataType.Ask)
{
askVol = e.Volume; askPrice = e.Price;
if (printOn) Print(Time[0].ToString() + " MarketDataType: " + e.MarketDataType+ "++++++++++++++++ e.Volume: " + e.Volume+ " e.Price: " + e.Price);
}
if (e.MarketDataType == MarketDataType.Bid)
{
bidVol = e.Volume; bidPrice = e.Price;
if (printOn) Print(Time[0].ToString() + " MarketDataType: " + e.MarketDataType+ "---------------- e.Volume: " + e.Volume+ " e.Price: " + e.Price);
}
DrawText("askVol", askVol.ToString(), -20, askPrice, Color.Peru);
DrawText("bidVol", bidVol.ToString(), -20, bidPrice, Color.Peru);
}
Comment
-
-
Originally posted by pman777 View Postthank you Koganam ... by the way I posted on another thread that I'm looking for a time-counter routine that will count the time in seconds that a volume bar is active. Can you direct me to something that would help. thanks againCode:double secondsElapsed = (Time[0] - Time[1]).TotalSeconds;
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by wzgy0920, 04-20-2024, 06:09 PM
|
2 responses
27 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:43 PM
|
||
Started by wzgy0920, 02-22-2024, 01:11 AM
|
5 responses
32 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:33 PM
|
||
Started by wzgy0920, 04-23-2024, 09:53 PM
|
2 responses
49 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:29 PM
|
||
Started by Kensonprib, 04-28-2021, 10:11 AM
|
5 responses
193 views
0 likes
|
Last Post
by Hasadafa
Yesterday, 10:19 PM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
11 responses
3,235 views
0 likes
|
Last Post Yesterday, 08:07 PM |
Comment