fran3r:
Good morning, I have a problem with sell stop and buy stop orders. I create them without stop loss only with take profit but they close by themselves as soon as they open and I don't understand what is happening.
If anyone can help me I would be very grateful. Thanks!
you expect an answer without providing the source code?
double priceBuyStop = SymbolInfoDouble(_Symbol, SYMBOL_ASK) + 50 * _Point; double takeProfit = priceBuyStop + 100 * _Point; datetime expirationTime = TimeCurrent() + timeOrderExpiredInMinutes * 60; if (trade.BuyStop(lotSize, priceBuyStop, _Symbol, NULL, takeProfit, ORDER_TIME_SPECIFIED, expirationTime, "BuyStop Order")){ Print("Orden BuyStop creada a: ", currentPrice); } else{ Print("Error al crear la orden BuyStop: ", GetLastError()); }
Files:
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Good morning, I have a problem with sell stop and buy stop orders. I create them without stop loss only with take profit but they close by themselves as soon as they open and I don't understand what is happening.
If anyone can help me I would be very grateful. Thanks!