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 md4866, 05-01-2024, 08:15 PM
|
2 responses
18 views
0 likes
|
Last Post
by md4866
Today, 12:33 PM
|
||
Started by samish18, Today, 12:20 PM
|
0 responses
7 views
0 likes
|
Last Post
by samish18
Today, 12:20 PM
|
||
Started by thread, 04-15-2024, 11:58 PM
|
3 responses
48 views
0 likes
|
Last Post
by Georg1o
Today, 12:05 PM
|
||
Started by leojimenezp, 04-20-2024, 05:49 PM
|
4 responses
50 views
0 likes
|
Last Post
by leojimenezp
Today, 11:49 AM
|
||
Started by nicthe, Today, 09:24 AM
|
1 response
8 views
0 likes
|
Last Post
by nicthe
Today, 10:57 AM
|
Comment