Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
OnMarketData
Collapse
X
-
Hi PDT123,Originally posted by PDT123 View PostI need to know when there is an uptick and downtick. I am using the OnMarketData but how do I know if the last was at the bid or ask and when it ticked up to a new level?
Here is how I separate the last.
if (e.MarketDataType == MarketDataType.Ask)AskPrice = e.Price;
if (e.MarketDataType == MarketDataType.Bid)BidPrice = e.Price;
if (e.MarketDataType == MarketDataType.Last)LastPrice = e.Price;
if (e.MarketDataType == MarketDataType.Last)LastVolume = e.Volume;
if (e.MarketDataType != MarketDataType.Last)return;
if((LastPrice >= AskPrice) && (AskPrice!=0)) AskVolume = LastVolume;
if((LastPrice <= BidPrice) && (BidPrice!=0)) BidVolume = LastVolume;
RJay
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
51 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
31 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 12:02 AM
|
||
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
99 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
177 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
170 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment