![]() |
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
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Join Date: Nov 2006
Location: , ,
Posts: 66
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
Not supported at this point.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Dec 2009
Posts: 5
Thanks: 1
Thanked 0 times in 0 posts
|
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? |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Dec 2009
Posts: 5
Thanks: 1
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#5 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
|
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
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Dec 2009
Posts: 5
Thanks: 1
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#7 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
|
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.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Bertrand for this post: |
|
|
|
#8 |
|
Junior Member
Join Date: Dec 2009
Posts: 5
Thanks: 1
Thanked 0 times in 0 posts
|
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
|
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Dec 2009
Posts: 5
Thanks: 1
Thanked 0 times in 0 posts
|
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! pss Can I compare it to something like 'Price' of 'last sale' or 'current price'?) |
|
|
|
|
|
#10 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
|
lamass, I have just replied to your note sent directly to support this morning.
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|