Check out this example:
Example: if the Moving Average indicator dropped below the Close price, close the BUY positions, if the Moving Average indicator rose above the Close price, close the SELL positions.
How to start with MQL5
- 2020.09.17
- www.mql5.com
This thread discusses MQL5 code examples. There will be examples of how to get data from indicators, how to program advisors...
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
Hi everyone!
I've really searched for a solution for this issue but I just couldn't find any
Basically I need the EA to close Buy and Sell positions not because reaching a SL or TP, but when the last bar price closes below the MA (in Buy ops) or above it (Sell ops)
I wrote a couple lines but they do nothing and whenTP and SL to zero I get 4756 Invalid stops error.
Code is:
Thanks a lot people