MQL5 how to close positions when conditions are met and set to zero TP and SL?
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...
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