so every time i complete coding i always find my code does not work on the tester. can someone explain to me why this one will not work?
Forum on trading, automated trading systems and testing trading strategies
Hello,
Please EDIT your post and use the SRC button when you post code.
Thank you.
- When you post code please use the SRC button! Please edit your post.
General rules and best pratices of the Forum. - General - MQL5 programming forum if (OrderSymbol() != Symbol() && OrderMagicNumber() != magic) continue;
That means you process any symbol with your magic number, or current symbol with any MN.) You want to process only current chart with MN.bool true_or_false=False; if(candle_time_string==time){true_or_false=True;} return(true_or_false);
Simplify your code. Increase Order after stoploss - MQL4 and MetaTrader 4 - MQL4 programming forumif(did_we_get_refrence_bar==True)
You should be able to read your code out loud and have it make sense. You would never write if( (2+2 == 4) == true) would you? if(2+2 == 4) is sufficient. So Don't write if(bool == true), just use if(bool) or if(!bool). Code becomes self documenting when you use meaningful variable names, like bool isLongEnabled. Long_Entry sounds like a trigger price or a ticket number and "if long entry" is an incomplete sentence.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
here is the code.