I'm new in MQL4 and would like to know if anyone ever used the closure of a trade due to a "trailing stop" as a trigger to automate execution of trades :
For example, say you have an open SELL trade with a trailing stop. Then you want to automatically enter a BUY trade with a particular stop loss at the point the SELL trade in question gets closed. If someone has done this please share the code.
Yes! It is very common and it is called SAR - Stop and Reverse. It is also why the PSAR indicator is so called, Parabolic Stop And Reverse, and why it is a well known trailing stop method.
You will find several PSAR Expert Advisors published in the Code Base section that can serve as examples of code. Just use the "Search" function here on the site, with the "PSAR" keyword and restrict or filter by "Code Base".
To add comments, please log in or register