I have back tested many EA's over the years and one problem i find in alot of EA's is that they can "over trade". I say this because i have often back tested an EA and found that it would make 1,2 or even 3 profitable trades in a row and then create a losing trade or maybe even two. For this reason i would like to enter coding into an EA that would only allow it to make one trade per day and then stop until the next trading day. I have tried using the "Sleep" function but found it to be ineffective when back testing. Does anybody know how to write a code that would overcome this problem?
- Templates to create EAs and Indicators
- How to code?
- Collaboration Dolly + Isakas + Nina System
stedyer:
I have back tested many EA's over the years and one problem i find in alot of EA's is that they can "over trade". I say this because i have often back tested an EA and found that it would make 1,2 or even 3 profitable trades in a row and then create a losing trade or maybe even two. For this reason i would like to enter coding into an EA that would only allow it to make one trade per day and then stop until the next trading day. I have tried using the "Sleep" function but found it to be ineffective when back testing. Does anybody know how to write a code that would overcome this problem?
I have back tested many EA's over the years and one problem i find in alot of EA's is that they can "over trade". I say this because i have often back tested an EA and found that it would make 1,2 or even 3 profitable trades in a row and then create a losing trade or maybe even two. For this reason i would like to enter coding into an EA that would only allow it to make one trade per day and then stop until the next trading day. I have tried using the "Sleep" function but found it to be ineffective when back testing. Does anybody know how to write a code that would overcome this problem?
int TradeDay=888; if(GlobalVariableCheck("TradeDay")) TradeDay=GlobalVariableGet("TradeDay"); if(!TradeDay==DayOfYear()) { int ticket=OrderSend(Symbol(),OP_BUY,0.1,Ask,3,0,0,"",0,0,Green); if(ticket>0) { TradeDay=DayOfYear(); GlobalVariableSet("TradeDay",TradeDay); } }Cheers

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