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
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();

Comment