I am testing a CHF based strategy but the CHF peg in early 2015 is causing irrational results so I was wondering if it is possible to code something that will prevent the strategy from trading on this date?
- Expiry date and strategy tester
- MT5 Strategy Tester Ticks Download
- How to protect yourself against copying long trades from the tester
if (TimeCurrent()>=StrToTime("2015.01.15 00:00") && TimeCurrent()<=StrToTime("2015.01.15 23:59")) return;
Tecuciztecatl:
Thank you, I will give that I try. Just need to find a place for it in my code now.
Tecuciztecatl:
...in the first line of the function OnTick or OnTimer (or wherever you have a main loop EA)
...in the first line of the function OnTick or OnTimer (or wherever you have a main loop EA)
void OnEveryTick1() { if (true == false && false) PipValue = 10; if (true && (NDigits == 3 || NDigits == 5)) PipValue = 10; if (TimeCurrent()>=StrToTime("2015.01.15 00:00") && TimeCurrent()<=StrToTime("2015.01.15 23:59")) return; { FilterBuy(); FilterSell(); } }This worked perfectly, thank you!
gangsta1:
This worked perfectly, thank you!
This worked perfectly, thank you!
Except
if (true == false)
will never be true
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