Please do some researches before posting, similar questions have been asked hundreds of time.
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
Hi guys,
I'm trying to place a short order via OrderSend but I get error #130. Since I'm a noob in MQL development I'm sure you can solve this issue really fast. :P
So here's the code snippet:
double takeProfitTotal = NormalizeDouble(Ask-(TakeProfit*Point),Digits);
double stopLossTotal = NormalizeDouble(Ask+(StopLoss*Point),Digits);
Print("Try to OrderSend with Bid price " + Bid + ", take profit " + takeProfitTotal + " and stoploss " + stopLossTotal);
int ticket = OrderSend(Symbol(), OP_SELL, 1, Bid, stopLossTotal, takeProfitTotal, "Test Order", 376, 0, clrRed);
if(ticket<0) {
Print("OrderSend failed with error #",GetLastError());
} else {
Print("OrderSend placed successfully with takeProfit " + takeProfitTotal + " and stoploss " + stopLossTotal);
}
I have set the input parameters TakeProfit and StopLoss to 500.
When I execute the backtesting of the Expert Advisor I get the following log entrys:
Try to OrderSend with Bid price 1.06689, take profit 1.06237 and stoploss 1.07237
OrderSend failed with error #130
OrderSend error 130
Any suggestions how to solve this issue?
Kind regards
Rhias