HI, My calculation of distance between high of signal bar and slow ema 34(gold line) is not correct. In settings I placed 1 tick but it opens with distance of a lot more then just one tick. See Pic. Can you provide me with a suggestion on how to fix it?
AboveBelowForType2 = 1;
else if (TradeType2
&& emaAngulation < -EMAAngulation * TickSize
&& emaAngulationXBarsBefore < -EMAAngulationXBarsBefore * TickSize
&& Close[1] > Open[1] // previous bar bullish
&& High[0] > High[1] // current higher high
&& Close[0] < slowEMA[0] // closing above 34
&& slowEMA[0] < cEMA89[0] // 34 is not above 89
// && High[0] > slowEMA[0] - AboveEMATicks * TickSize && Close[0] < slowEMA[0])
&& High[0] <= slowEMA[0] + AboveBelowForType2 * TickSize // and current bar reversed below Slow EMA(gold line)
)
{
entryOrder = SubmitOrderUnmanaged(0, OrderAction.SellShort, OrderType.Market, TradeSize, 0, 0, "", "BT");
return;
}
[NinjaScriptProperty]
[Range(0, int.MaxValue)]
[Display(Name="Above Below 34EMA ", Description="Type 2 above or below 34ema ticks", Order=9, GroupName="Parameters")]
public int AboveBelowForType2
{ get; set; }
Comment