At the beginning of your start() procedure put something like :
if (Time[0]sessionEnd) return(0);[/PHP]
That will prevent execution at times outside the desired session
You could use broker or local time too for that purpose but in that case back-testing might become problematic. To use broker time do it the following way :
if (TimeCurrent()sessionEnd) return(0);
and for local time use this :
[PHP]if (TimeLocal()sessionEnd) return(0);vibarco:
Hi all,
Hi all,
Wich is the way to go optimizing session range? i mean, how i can optimize sessionStart sessionEnd, could you give some example code?.
Best,
Vince.Thanks mladen,wich is the correct approach to do not have problems in backtesting/optimizing?Best,Vince.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi all,
Wich is the way to go optimizing session range? i mean, how i can optimize sessionStart sessionEnd, could you give some example code?.
Best,
Vince.