hi there, every body.
was wondering if any one could throw in a line of code to disable EA from trading on a specific day?
i, personally dislike fridays, so lets take that for example.
so, this is the code - it closes all trades, and restarts the EA if equity has grown.
so, my idea is - after trades have been closed - check if its friday - if no, it continues - if yes - Well.. it doesnt restart, but checks again (later or still on every tick).
anyone care to share?
big thanks!
G'day
All you need to do is check the DayOfWeek (int) parameter. 0=Sunday through to 6=Saturday. So just chuck in something like this
if(DayOfWeek()==5) return; // Or whatever else you want to do if it's a Friday
Cheers
G'day
All you need to do is check the DayOfWeek (int) parameter. 0=Sunday through to 6=Saturday. So just chuck in something like this
Cheers
hey there!
big thanks, works like a charm!
hey there!
big thanks, works like a charm!
damm i'll try to be faster))
- 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 there, every body.
was wondering if any one could throw in a line of code to disable EA from trading on a specific day?
i, personally dislike fridays, so lets take that for example.
so, this is the code - it closes all trades, and restarts the EA if equity has grown.
so, my idea is - after trades have been closed - check if its friday - if no, it continues - if yes - Well.. it doesnt restart, but checks again (later or still on every tick).
anyone care to share?
big thanks!