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 SantoshXX, Today, 03:09 AM
|
0 responses
6 views
0 likes
|
Last Post
by SantoshXX
Today, 03:09 AM
|
||
Started by DanielTynera, Today, 01:14 AM
|
0 responses
2 views
0 likes
|
Last Post
by DanielTynera
Today, 01:14 AM
|
||
Started by yertle, 04-18-2024, 08:38 AM
|
9 responses
41 views
0 likes
|
Last Post
by yertle
Today, 01:00 AM
|
||
Started by techgetgame, Yesterday, 11:42 PM
|
0 responses
12 views
0 likes
|
Last Post
by techgetgame
Yesterday, 11:42 PM
|
||
Started by sephichapdson, Yesterday, 11:36 PM
|
0 responses
2 views
0 likes
|
Last Post Yesterday, 11:36 PM |
Comment