NinjaTrader Support Forum  
X

Attention!

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


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 05-12-2011, 07:55 AM   #1
ATI user
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 1,316
Thanks: 1
Thanked 7 times in 7 posts
Default OnMarketDepth(MarketDepthEventArgs

this sample code compiles in strategy however does not output to Output window

compiles in indicator also and does not output

protected override void OnMarketDepth(MarketDepthEventArgs e)
{
// Print some data to the Output window
if (e.MarketDataType == MarketDataType.Ask && e.Operation == Operation.Update)
Print("The most recent ask change is " + e.Price + " " + e.Volume);
}
ATI user is offline  
Reply With Quote
Old 05-12-2011, 08:11 AM   #2
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hello ATI User,

There's a sample you can work from here that can help you with working in market depth:
http://www.ninjatrader.com/support/f...ead.php?t=3478

Are you subscribed to market depth? When you pull up a Superdom you can see market depth levels. If your connection does not support it, you can use the simulated data feed.
Last edited by NinjaTrader_RyanM; 05-13-2011 at 10:35 AM.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 05-13-2011, 12:39 AM   #3
ATI user
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 1,316
Thanks: 1
Thanked 7 times in 7 posts
Default

thanks Ryan

the code I posted is from the NT help file...so maybe it needs to be updated?

apparently I am not subscribed to market depth as Josh's code does not output either...nor can I get levels on the DOM

I am trying for the ES with Zenfire and Kinetick Live feeds....how do I get subscribed
ATI user is offline  
Reply With Quote
Old 05-13-2011, 08:29 AM   #4
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Thanks for the reply. Yes, it sounds like you are not seeing market depth so the code won't output either.

All Zenfire accounts should be enabled for market depth but for Kinetick this is a separate enablement. To view market depth for the Zenfire connection, make sure you are connected to Zenfire first. You can contact sales 'at' kinetick 'dot 'com to add market depth to your Kinetick account.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 05-13-2011, 09:04 AM   #5
ATI user
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 1,316
Thanks: 1
Thanked 7 times in 7 posts
Default

disconnected Kinetick...so only on Zenfire feed

for 6B I only get one level on DOM...which is only bid/ask size.,...see pic
Attached Images
File Type: png testing 038.png (3.6 KB, 5 views)
ATI user is offline  
Reply With Quote
Old 05-13-2011, 09:09 AM   #6
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Not sure why you are seeing that. Are you using the latest version of NT and viewing June contract? Please contact your broker to check your account is properly setup for market depth on 6B. If you'd like for us to confirm that we see the same thing, send your username and password to support 'at' ninjatrader 'dot' com Attn: RyanM and we will test here.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 05-13-2011, 09:37 AM   #7
ATI user
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 1,316
Thanks: 1
Thanked 7 times in 7 posts
Default

thanks...Mirus cleared up issue

first at my end did not have Show Market Depth set true....howeve still did not work...had to Reset Instruments....now fine on Zenfire...even when Zen is secondary feed to Kinetick

DOM does not work at all on Kinetick...sent them an email
Attached Images
File Type: png testing 040.png (6.1 KB, 14 views)
ATI user is offline  
Reply With Quote
Old 05-13-2011, 09:43 AM   #8
ATI user
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 1,316
Thanks: 1
Thanked 7 times in 7 posts
Default

back to original issue
SampleMarketDepth does not work on 20 tick chart or 10 range chart....any chart ...even though getting market depth on DOM now
Attached Images
File Type: png testing 041.png (12.8 KB, 11 views)
ATI user is offline  
Reply With Quote
Old 05-13-2011, 10:35 AM   #9
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

OK - Glad to hear it was a simple setting. For the SampleMarketDepth indicator, it only displays output during a CrossOver condition. If you want to evaluate for ask changes, the code snippet in your first post is good.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 05-13-2011, 11:51 AM   #10
ATI user
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 1,316
Thanks: 1
Thanked 7 times in 7 posts
Default

excellent....changed code from crossover to other condition and it print book fine...thanks
Attached Images
File Type: png testing 043.png (7.3 KB, 34 views)
ATI user is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OnMarketDepth dave1992 Version 7 Beta General Questions & Bug Reports 41 11-01-2010 05:05 PM
MarketDepthEventArgs.Price is always set to zero for row removal operations ScoobyStoo Version 7 Beta General Questions & Bug Reports 64 08-26-2010 10:39 AM
OnMarketDepth : MarketDepthEventArgs eqtrader General Programming 2 08-12-2010 03:55 PM
OnMarketDepth() funk101 General Programming 2 09-28-2009 11:03 AM
MarketDepthEventArgs - Clarification needed ScoobyStoo General Programming 19 05-21-2009 04:29 AM


All times are GMT -6. The time now is 08:54 PM.