Le 24/08/2010 21:51, jab901 a écrit :
when there has been 1 ema crossover or less in the last 30 days?

Hi,

or more maybe?

Anyway, the last 30 bars are always modified...

look at the few lines.

Best regards

|// ema xover count
EMAper = Param("EMAper ",20,1,100,1);
myema = EMA(*C*, EMAper );
EMAcrossunder= Cross(myema, *C*);
EMAcrossover = Cross(*C*, myema);

// how many EMA crossoverup and crossoverdown in the last 30 bars
EMAcountup = Sum(EMAcrossover ,30);
EMAcountdn = Sum(EMAcrossunder ,30);

Plot(EMAcrossover, "xcrossup",*colorGreen*, *styleHistogram* + *styleOwnScale*); Plot(EMAcrossunder , "xcrossdn",*colorRed*, *styleHistogram* + *styleOwnScale*);
Plot(EMAcountup , "EMAcountup ", *colorWhite*,*styleLine*);
Plot(EMAcountdn , "EMAcountdn ", *colorBlack*,*styleLine*);|

Reply via email to