Hello, I see a trailing stop code on internet wich is activate after cross up breakeven, but i don't understand a line
int trailing_stop = 20;
double ts;
for (int i = OrdersTotal()-1; i >= 0; i --)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol())
{
if (OrderType() == OP_BUY)
{
ts = Bid-(Point*trailing_stop);
if (OrderStopLoss()=(Point*trailing_stop)) // why oderstoploss have to be = Point*trailing stop ??? if orderstoploss return 11200, 20*Point can never be equal with value of Orderstoploss
OrderModify(OrderTicket(),OrderOpenPrice(),ts,OrderTakeProfit(),0,White);
}
lol :D, it's the reason why I try to learn programmation. I just searched a model but on youtube there is a good indian programmer who explain how to code a perfect trailing stop with creation of functions etc...it's more professional
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hello, I see a trailing stop code on internet wich is activate after cross up breakeven, but i don't understand a line