attached is also the code segment that i use. when i check the printed data. you can clearly see there is no crossover. the printed data is eur.jpy which shows upto 5 decimal places. you will notice that the 9 ema was lower for the last bar and the bar previous to it. so how can there be a crossover? its also confirmed by the lines in the chart that there is no crossover!!!
2016-02-02 12:15:01 AMEURJPYEURJPYCcrossed above
2016-02-02 12:15:01 AM EURJPYDirectionLong
last EMA 22 131.64439 lastprev EMA 22 131.64439
last EMA 9 131.64240 lastprev EMA 9 131.64240
last 9 ema lower than last 22 emaTrue current9emahigherFalse
2016-02-02 12:20:00 AM****WARNING **** IT WAS NOT A CLEAN CROSSOVER
Value.Reset(); if (CrossAbove(EMA(9), EMA(22), 1) && IsFirstTickOfBar) { Draw.Text(this, "crossabove" + CurrentBar, "look for long", 1, Low[1]); look4long = true; look4short = false; Print(now.ToString() + " " + Bars.Instrument.FullName + "Direction" + "Long"); Print(string.Format("last EMA 22 {0:0.00000} lastprev EMA 22 {0:0.00000} ",EMA(22)[1],EMA(22)[2])); Print(string.Format("last EMA 9 {0:0.00000} lastprev EMA 9 {0:0.00000} ",EMA(9)[1],EMA(9)[2])); bool last9emalower=EMA(9)[2]<EMA(22)[2]?true:false; bool current9emahigher=EMA(9)[1]>EMA(22)[1]?true:false; Print("last 9 ema lower than last 22 ema" +last9emalower.ToString() + " " + "current9emahigher" + current9emahigher); if(!(EMA(9)[1]>EMA(22)[1] && EMA(9)[2]<EMA(22)[2])){ Print(Time[0].ToString() + "****WARNING **** IT WAS NOT A CLEAN CROSSOVER"); } } else
Comment