![]() |
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 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
I have been getting a lot of private requests from individuals asking for a referencesample of how to access market depth (order book) data for the creation of custom indicators. At the time ofthis post, accessing market depth is not part of theofficially supported NinjaScript layer. What I present here is intended for advancedprogrammers andoutside the scope of what we currently provide technical support for.
For those interested,please take a look at theattachedreference indicator. It will show you how to attached market depth event handlers and access some of the depth events as a result. Ray
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#2 |
|
Member
Join Date: Mar 2007
Location: London, UK
Posts: 61
Thanks: 0
Thanked 0 times in 0 posts
|
Ray -
Thanks very much for posting this. Saved a lot of researchand works great. |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Apr 2007
Location: , ,
Posts: 104
Thanks: 1
Thanked 0 times in 0 posts
|
I am developing an indicator that utilizes market depth. The difficulty that I am having is showing its results on the chart. When I use Plot or DrawText methods within OnBarUpdate they work great, but are only updated once the chart moves and not when market depth changes. Putting the same commands within OnMarketDepth does not work, they are being ignored. Print method does work, but it required output window.
I realize the Ninja does not provide support for this feature, but I want to ask if anyone had any development done with MarketDepth event. How can I display a value on the chart that changes when OnMarketDepth event is being triggered. Thanks, redduke |
|
|
|
|
|
#4 | |
|
Member
Join Date: Jun 2008
Location: Chicago
Posts: 32
Thanks: 0
Thanked 0 times in 0 posts
|
Quote:
I have the same question re setting the plots from within OnMarketDepth, updating with each change in depth data. Is this possible? i have written indicators that set a plot from within OnMarketData, which work fine. |
|
|
|
|
|
|
#5 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
You should be able to. It would probably be done in the same fashion you have it as over in OnMarketData().
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
Member
Join Date: Jun 2008
Location: Chicago
Posts: 32
Thanks: 0
Thanked 0 times in 0 posts
|
using the following variables b = e.MarketDepth.Bid.TotalVolume(5); a = e.MarketDepth.Ask.TotalVolume(5); within OnMarketDepth, i add Bid.Set(b); and Ask.Set(a); also within OnMarketDepth and get the following error:
Cbi.MarketDepth.MarketDepthItemAddNow: exception caught: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index the variables assign correctly and print in the output window, but no plots. |
|
|
|
|
|
#7 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
jcash,
Those are not supported MarketDepthEventArgs. Please see this article: http://www.ninjatrader.com/support/h...DepthEventArgs
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Apr 2007
Location: , ,
Posts: 104
Thanks: 1
Thanked 0 times in 0 posts
|
Anybody??? I thought that this feature is being used by a lot of people.
Thanks, redduke |
|
|
|
|
|
#9 | |
|
Junior Member
Join Date: Jun 2007
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
|
Quote:
Marcus |
|
|
|
|
|
|
#10 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Hi Marcus,
This indicator is not accessible from a strategy. With our upcoming NT 6.5 release due out in beta late summer, you will be able to access market depth and data events directly.
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|