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 TheTradingMantis, 10-31-2017, 03:18 PM
|
5 responses
1,251 views
0 likes
|
Last Post
by TheAngryCube
Today, 04:06 PM
|
||
Started by Padan, Today, 02:02 AM
|
9 responses
23 views
0 likes
|
Last Post Today, 03:27 PM | ||
Started by spottysallrite, Today, 11:31 AM
|
7 responses
22 views
0 likes
|
Last Post Today, 03:26 PM | ||
Started by nandhumca, Today, 03:15 PM
|
1 response
4 views
0 likes
|
Last Post Today, 03:23 PM | ||
Started by PopovDS, 03-11-2024, 12:49 PM
|
3 responses
17 views
0 likes
|
Last Post
by PopovDS
Today, 03:16 PM
|
Comment