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 > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 12-17-2006, 05:21 PM   #1
SuzyG
 
Join Date: Nov 2006
Location: , ,
Posts: 66
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

Is there a way to retrieve the activity in the Time and Sales window and the number of contracts sitting at each level in the DOM?

Thank you in advance.
SuzyG is offline  
Reply With Quote
Old 12-17-2006, 07:30 PM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Post imported post

Not supported at this point.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 01-23-2012, 09:29 PM   #3
lamass
Junior Member
 
Join Date: Dec 2009
Posts: 5
Thanks: 1
Thanked 0 times in 0 posts
Default time and sales data differentiation

Am I understanding well that NinjaTrader does not support a way to differentiate (in the Time and Sales window), while using the function OnMarketData (in the script window when making indicators) the difference between:
At Ask,
At Bid,
Below Bid and
Above Ask?

If so, what is the use. One of the most important finctions is omited. I am almost suspicious as to "WHY?
Please let me know if I can control how much shares have been sold or bought against the Last Price. That is so simple- that is confusing me as to why it is not supported (if so).

How can I solve that problem? Get another software?
lamass is offline  
Reply With Quote
Old 01-23-2012, 10:04 PM   #4
lamass
Junior Member
 
Join Date: Dec 2009
Posts: 5
Thanks: 1
Thanked 0 times in 0 posts
Default

Dear Dierk/NT
I would like to make calculations on the actual sales data (what was sold/bought, and how much of it). That is the Time and Sales window. How can I translate its propertis into functions in the script? I also tried to use the OnMarketData but get either [mixed ask and bid entries] or altogether mixed [the ask/bid from Level II and the actual up/down sales]. I would like to differentiate them. The e.Price function gives it to me but all of them mixed. Is there a function that I can call and COMPARE WHAT IS ASK AND WHAT IS BID (from the sold shares) AGAINST THE LAST PRICE?
If so, please let me know. If not so, the I need to consider getting another software.
pss:
Also, is there a simple way to make a variable and find out whether the last sale was lower or higher then the LAST Price?
Thanks, lamass
lamass is offline  
Reply With Quote
Old 01-24-2012, 02:22 AM   #5
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
Default

lamass, for your use : have you already looked into the PowerVolume indicators, specifically the BuySellVolume we ship per default with our NinjaTrader?

http://www.ninjatrader.com/support/h...indicators.htm

Their code would be open as well so you could review for your own projects.

For working in OnMarketData / OnMarketDepth, please be sure to filter the events returned by what event arg called the method (i.e bid / ask / last ...) -

http://www.ninjatrader.com/support/h...aeventargs.htm
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 01-24-2012, 03:06 AM   #6
lamass
Junior Member
 
Join Date: Dec 2009
Posts: 5
Thanks: 1
Thanked 0 times in 0 posts
Default

Thank you. Would you refer me to any reference as to how to filter the OnMarketData.Last ? Basically I get it all meshed with the ask/bid from level II- while I need just the bid/ask of the already bought/sold shares.
Thanks for your help.
lamass
lamass is offline  
Reply With Quote
Old 01-24-2012, 03:11 AM   #7
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
Default

To work on the current .Last event only, just put your logic after this if () condition:

protected override void OnMarketData(MarketDataEventArgs e)
{
if (e.MarketDataType == MarketDataType.Last)
}

This would then not react then to any bid / ask / other args the OnMarketData() would normally be called for as well.
NinjaTrader_Bertrand is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Bertrand for this post:
Old 01-25-2012, 01:15 AM   #8
lamass
Junior Member
 
Join Date: Dec 2009
Posts: 5
Thanks: 1
Thanked 0 times in 0 posts
Default my system was not ok- on reinstallation it worked

Hi, Thanks for the tips!
I'm trying to convert an indicator (already existing from NT) to my needs and get an error that I can not. I also can not just copy and paste the code in a different file. Is there a way to use the existing indicators- and then experiment with adding code? And how?
thanks, lamass

this post is not relevant. On reinstallation it worked. One can copy and paste code form existing indicators- and work with them.
Last edited by lamass; 01-25-2012 at 01:18 AM. Reason: not relevant any more
lamass is offline  
Reply With Quote
Old 01-25-2012, 02:07 AM   #9
lamass
Junior Member
 
Join Date: Dec 2009
Posts: 5
Thanks: 1
Thanked 0 times in 0 posts
Default

Dear Bertrand,
Thank you for your reply.
My problem is that after usindg this code :

protectedoverridevoid OnMarketData(MarketDataEventArgs e)
{
if (e.MarketDataType == MarketDataType.Last)
Print(
"Last = " + e.Price + " ....." + e.Volume);



//I get BOTH sales at the bid and at the ask price.


//If I add this code:



if (e.MarketDataType == MarketDataType.Ask)
Print(
"Ask = " + e.Price + " ....." + e.Volume);

}

then I get also the Level II, intermeshed- which is a chaos of data.

I want to just work with the bid and ask from the actual Sales window. How can I divide the 'MarketDataType.Last' into the 'ask' and 'bid' sales? That is the question Now!
Thank you for your help!

pssCan I compare it to something like 'Price' of 'last sale' or 'current price'?)
lamass is offline  
Reply With Quote
Old 01-25-2012, 03:07 AM   #10
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
Default

lamass, I have just replied to your note sent directly to support this morning.
NinjaTrader_Bertrand 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


All times are GMT -6. The time now is 03:32 PM.