EDIT your original post, please do not just post the code correctly in a new post.
You have posted in the MQL4 section, is your code MQL4?
EDIT your original post, please do not just post the code correctly in a new post.
You have posted in the MQL4 section, is your code MQL4?
I'm on the Mql5 site though. Ok, I edit.
Yes, it is the MQL5 site, but the forum is divided into several sections. Did you not notice? One of them, which is located at the very end, is dedicated to MetaTrader 4 and MQL4.
if (Bid = 10+OpenBuy)
-
That is an assignment, not a comparison.
-
Doubles are rarely equal. Understand the links in:
The == operand. - MQL4 programming forum #2 2013.06.07
-
That is an assignment, not a comparison.
-
Doubles are rarely equal. Understand the links in:
The == operand. - MQL4 programming forum #2 2013.06.07
Thanks, I made a mistake in my first post. It is not if (Offer == 10 + OpenBuy) but (Offer > 10 + OpenBuy). With the symbol > the SL goes up and down with each movement price, which is not the case with the == symbol or the SL only moves when the price reaches the condition. How do you make it go up only using the > symbol?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello, I am new to programming and after multiple searches I cannot resolve this trailing stop problem. I managed to create a trailing stop but it goes up and down compared to my open price. I would like it to follow the price in one direction. For example, for a buy order, I would like the trailing stop to go up only when the price goes up and if the price goes down, the trailing stop doesn't go down, it stays at the same price. Thank you, here my code :