TESTER & SLEEP()

 

So it appears that Sleep(), does not work in backtesting. I need to find an alternate, the testing bogs down doing useless calcs.

Working on a 4 hr TF I don't need to evaluate my SL on every tick, once a minute is adequate.

Any ideas on how I can do that without using the time functions?

I can't use NewBar since it is a 4 hr chart, maybe there is some way to get newBar for 1 minute bars?

All suggestions deeply appreciated

Keith

 
TimeCurrent() could help but
Any ideas on how I can do that without using the time functions?

you're doomed I'm afraid.

 

you can use function iVolume:

if(iVolume("USDCHF",PERIOD_M1,0)==1)//your trailing function

 
Roger wrote >>

you can use function iVolume:

if(iVolume("USDCHF",PERIOD_M1,0)==1)//your trailing function

Hi Guys

Many thanks.

Irtron: You were right TimeCurrent() does work in the tester, so now at least I only have to evaluate the time every tick rather than the whole stop loss routine.

Roger: Another clever solution, haven't coded it yet but it may well be faster and use less CPU than the TimeCurrent() method.

Thanks Again

Keith