I’m just trying to understand the mechanics of “Zorro”. I took “the7 strategy” http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=408401#Post408401 and simplifying de code I have this:

function run(){
BarPeriod = 1440;
StartDate = 20120701;
NumDays = 60; // only two months in order to limit the output

var *pH = series(priceHigh());
var *pL = series(priceLow());
var *EMA5H = series(EMA(pH,5));
var *EMA5L = series(EMA(pL,5));

Stop = (HH(2) - LL(2));

if(priceOpen() > *EMA5H && priceClose() < *EMA5H && priceLow() > *EMA5L){
Entry = priceLow(0) - (5*PIP);
enterShort();
} else if(priceOpen() < *EMA5L && priceClose() > *EMA5L && priceHigh() < *EMA5H){
Entry = priceHigh(0) + (5*PIP);
enterLong();
}

plot("EMA5H", *EMA5H, 0, BLUE);
plot("EMA5L", *EMA5L, 0, BLUE);
}

When priceOpen < EMA5L and priceClose > EMA5L and priceHigh < EMA5H it should enterLong(). In the result chart I found this.



It seems to be that the condition to enterLong is satisfied however no enterLong order is executed. Could someone tell me if I have a mistake in the code or what is going on ?.

What should I do to post my code in a "code box" ?

Thanks.