Define your variables as Global (before start( ) ) ,,,
then inside init( ) function use the initial values for those variables.
Then at the end of closeAll( ) function, call init( ) again ... That's all.
By the way, the used time filter will have a problem if TimeB > TimeA ...
It is better to overcome this by using ...
if((Hour()>=StartHour && Hour()<EndHour && StartHour<EndHour) || ((Hour()>=StartHour || Hour()<EndHour) && StartHour>EndHour))
Where StartHour = TimeA and EndHour = TimeB
Good luck
Define your variables as Global (before start( ) ) ,,,
then inside init( ) function use the initial values for those variables.
Then at the end of closeAll( ) function, call init( ) again ... That's all.
By the way, the used time filter will have a problem if TimeB > TimeA ...
It is better to overcome this by using ...
Where StartHour = TimeA and EndHour = TimeB
Good luck
Thank you for the help. This did help me with some of the problem but i got some new once.
I'll trie to see if i can fix them my self if not I'll post another post in this great forum
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi.
I'm very new to coding in general so i think this would be an easy fix if.
My problem is that when I run my EA it does all i want until i tell the EA to remove all objects and after that I want it to "reset" it self or to start taking in new values as it dose when I first run it.
Now when it ads my objects to the scen again it dose it at the right time but with all the old values.
How can I fix this?
// Mathias