![]() |
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 |
|
Member
Join Date: Sep 2008
Posts: 41
Thanks: 0
Thanked 0 times in 0 posts
|
Just a quick question, as I can't find the answer in the forum.
I want to recognize above ask or below bid transactions, and plot dots on a tick chart to highlight the bar where it occur. Modifying the BuySellVolume indicator, I test for before last tick size = before last ask size, and current price above last price (to recognise an above ask transaction). But when comparing with T&S, it does not match. My question : am I testing it the right way ? is it logically correct ? PS : if you don't mind added a few word regarding the role of arraylist alBuy and alSell. In what are they usefull ? Thank you for your answer Code:
if (firstPaint)
firstPaint = false;
else
{
double tradeVol = previousVol == 0 ? Volume[0] : Volume[0] - previousVol;
if (Close[0] >= GetCurrentAsk() && tradeVol >= minTradeVol)
{
buys += tradeVol;
if(previousVol == previousAskVol && Close[0] > previousAsk)
Alert("myAlert", NinjaTrader.Cbi.Priority.High, "Above Ask", "Alert2.wav", 1, Color.Black, Color.Yellow);
if(tradeVol >= minBigVol && !Historical)
DrawDot("BigVol" + CurrentBar.ToString(), true, 0, Close[0], Color.LimeGreen);
}
else if (Close[0] <= GetCurrentBid() && tradeVol >= minTradeVol)
{
sells += tradeVol;
if(previousVol == previousBidVol && Close[0] < previousBid)
Alert("myAlert", NinjaTrader.Cbi.Priority.High, "Below Bid", "C:\\WINDOWS\\Media\\Windows XP Ding.wav", 1, Color.Black, Color.Yellow);
if(tradeVol >= minBigVol && !Historical)
DrawDot("BigVol" + CurrentBar.ToString(), true, 0, Close[0], Color.Red);
}
}
previousVol = Volume[0];
previousAsk = GetCurrentAsk();
previousBid = GetCurrentBid();
previousAskVol = GetCurrentAskVolume();
previousBidVol = GetCurrentBidVolume();
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,403
Thanks: 252
Thanked 972 times in 955 posts
|
Hi fle,
Welcome to the NinjaTrader forum, you might want to dive into this discussion here - http://www.ninjatrader-support2.com/...ead.php?t=4231 I believe it answers some of your questions how to approach your project.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Sep 2008
Posts: 41
Thanks: 0
Thanked 0 times in 0 posts
|
Thank you for your prompt answer. This link is indeed very interesting.
But I'm afraid it does not answer my main concern, regarding how I can spot above bid or below ask condition. like if I test for "before last" ticksize = "before last" asksize, and last price above "before last" price means that it is an above ask transactions ? Regards |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,403
Thanks: 252
Thanked 972 times in 955 posts
|
Hi fle__,
I guess with TickSize you mean the volume / transactions occured on the last tick. Best would be to debug your logic and watching the times and sales window for confirmation, then you know when you are on the right track.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Sep 2008
Posts: 41
Thanks: 0
Thanked 0 times in 0 posts
|
OK, thank you
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| BID/ASK Indicator | Christoph | Indicator Development | 10 | 07-08-2009 06:53 AM |
| plot last ask/bid | junkone | Indicator Development | 3 | 09-24-2008 06:50 AM |
| how to plot bid and ask | junkone | Charting | 1 | 09-22-2008 04:06 AM |
| Bid Ask data | rt-trader | Market Analyzer | 2 | 11-23-2007 03:22 PM |
| Bid / Ask | Toad | Automated Trading | 1 | 06-01-2006 12:13 AM |