That's interesting. I took your script and put in some printfs for debugging, and I think too, it should trigger at this bar.

Code:
function run(){
BarPeriod = 1440;
StartDate = 20120701;
NumDays = 60; // only two months in order to limit the output
set(LOGFILE);
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));

printf("#\n%d %d   %f %f %f  %f  %f\n",day(0),month(0),priceOpen(),priceClose(),priceHigh(),*EMA5L,*EMA5H);
if(priceOpen() > *EMA5H && priceClose() < *EMA5H && priceLow() > *EMA5L){
printf("#\n %s" ,"EnterShort");
Entry = priceLow(0) - (5*PIP);

enterShort();
}
 if((priceOpen() < *EMA5L) && (priceClose() > *EMA5L) && (priceHigh() < *EMA5H)){
printf("#\n %s ","EnterLong");
Entry = priceHigh(0) + (5*PIP);

enterLong();
}

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


Last edited by Gattaca; 10/12/12 08:42.