- When you post code please use the CODE button (Alt-S)!
(For large amounts of code, attach it.)
Please edit
your (original) post.
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor -
Check your return codes for errors, and report them including GLE/LE.
Don't look at it unless you have an error.
Don't just silence the compiler, it is trying to help you.
What are Function return values ? How do I use them ? - MQL4 and MetaTrader 4 - MQL4 programming forum
Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
Only those functions that return a value (e.g. iClose, MarketInfo, etc.) must you call ResetLastError before in order to check after. - What is the value of real_sl/real_tp when stop_loss/take_profit is zero?
- They also must be a multiple of tick size not point
- When you post code please use the CODE button (Alt-S)!
(For large amounts of code, attach it.)
Please edit
your (original) post.
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor -
Check your return codes for errors, and report them including GLE/LE.
Don't look at it unless you have an error.
Don't just silence the compiler, it is trying to help you.
What are Function return values ? How do I use them ? - MQL4 and MetaTrader 4 - MQL4 programming forum
Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
Only those functions that return a value (e.g. iClose, MarketInfo, etc.) must you call ResetLastError before in order to check after. - What is the value of real_sl/real_tp when stop_loss/take_profit is zero?
- They also must be a multiple of tick size not point
Oh sorry, I'm new here so didn't know about the rules.
I edited my code.It still has errors tho :(
stop_loss/take_profit is extern variable!
Forum on trading, automated trading systems and testing trading strategies
General rules and best practices of the Forum.
Don't double post please !
Please do not post multiple times. Post once in a relevant thread or open a topic with a relevant title. You probably don't realise how selfish you are being by posting multiple times.
Have you any idea how frustrating it is when someone uses their free time to answer a query and then opens another thread and finds a duplicate query that has already been answered? That means that the time spent on answering was completely wasted! Time that could have been used to help somebody else.
Your duplicated posts have been deleted.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I would like to make a EA which is when
iMa crossover the Close[1] like right before candle then buy or sell depends on what former candlewas
I tried to code but still i don't get it :(. I can't figure it out how to use iMa.
this is my code.