??????
int Ticket = OrderSend( symbol, orderType, orderVolume, NormalizeDouble(entryPrice, pairDigits), slippage, 0, 0, comment, MAGIC_NO, expiry, colour );
1) In your program s/l and t/p are 0!
2) Print out: Symbol, iClose(symbol,0), your normalized Entry price.
3) There are minimal price differences set by your broker - do you know them?
4) Did you consider the spread?
??????
1) In your program s/l and t/p are 0!
2) Print out: Symbol, iClose(symbol,0), your normalized Entry price.
3) There are minimal price differences set by your broker - do you know them?
Yes. I deliberately set s/l and t/p to 0 for test reasons. Trying suggestion 2 now.
I really cannot just figure out what the heck is the problem!
Using this exact figures on Ordersend as standalone outside the function above works!
Result of iClose(symbol,PERIOD_H1, 0)
2014.10.23 16:16:24.898 EURUSD,H1: ERROR_CODE: 129 | SYMBOL: AUDUSD | ORDER TYPE: OP_BUYSTOP | PRICE: 0.99 | STOP: 0.982 | TAKE PROFIT: 1.042 | MAGIC NO: 138 | iclose: 0.878
3) There are minimal price differences set by your broker - do you know them? May be STOP: 0.982is to close...
4) What is the value of
NormalizeDouble(entryPrice, pairDigits)
5) What is
pairDigits
Value of
NormalizeDouble(entryPrice, pairDigits)
= 0.99
pairDigits
int pairDigits = (int) MarketInfo(symbol, MODE_DIGITS);
3) There are minimal price differences set by your broker - do you know them? May be STOP: 0.982is to close...
This is a pending trade with the following values:
SYMBOL: AUDUSD
ORDER TYPE: OP_BUYSTOP
PRICE: 0.99
STOP LOSS: 0.982
TAKE PROFIT: 1.042
(On a good day, entering this into the terminal ought not to produce error with entry price)
Alert(OrderSend("AUDUSD", OP_BUYSTOP, 0.01, 0.99, 5, 0.982, 1.042, "comment", 138, 0, clrNONE));Same information here & successful. Really confussed
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am new to MQL and code above is supposed to produce an order but I keep getting either error 130 (invalid stops) or 129 (invalid price).
Anyone help please.