![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Apr 2008
Posts: 298
Thanks: 4
Thanked 0 times in 0 posts
|
I have code:
protectedoverridevoid OnMarketDepth(MarketDepthEventArgs e) { Print(string.Format("Depth: {0} {1} {2} {3}", e.MarketDataType, e.Operation, e.Price, e.Volume)); which produces output: Depth: Ask Insert 113.7 25 Depth: Ask Insert 113.72 20 Depth: Ask Insert 113.73 159 Depth: Ask Insert 113.74 185 Depth: Ask Insert 113.75 152 Depth: Ask Insert 113.76 196 Depth: Bid Insert 113.69 20 Depth: Bid Insert 113.71 16 Depth: Bid Insert 113.7 34 Depth: Bid Insert 113.69 191 Depth: Bid Insert 113.68 330 Depth: Bid Insert 113.67 282 113.69 comes twice. In the NT DOM it is 20. But in the code I have to replace with 191 as it came after. DOM is pretty much static - after trading hours it doesnt move at all. 20 was before I reloaded my indicator and 20 after that. But in my data it is 191. I connected to IB. I need this somehow fixed as I cant count volume in bid/ask ladders. Thanks |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
OnMarketData() is correct in its events. Try switching DOM to different instrument and back again to see if it shows the 191.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
To double check, are you using SuperDOM or Level II window? If this is a stock, you should use Level II window. You likely will see two rows for the price 113.69 each with different volume levels. This is an insert operation not an updata at that price level.
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| OnMarketDepth details | ct | General Programming | 5 | 11-30-2007 06:01 AM |
| Play beep OnMarketDepth | MrBaffalo | Indicator Development | 4 | 11-19-2007 10:39 PM |