I will not buy your EA for sure
Alain Verleyen:
I will not buy your EA for sure
I am not doing marketing
but just asking
where is the answer?
The answer is there.
131 | ERR_INVALID_TRADE_VOLUME | Invalid trade volume |
Have a read in the appropriate section of the link I posted.
I don't know what is wrong in the lot size 0.10
??
tkt_buy=OrderSend(Symbol(), //Pair
OP_BUY, //Command Type
0.10, //Lot Size
OrderPrice, //Market Price
Slippage, //Max. Slippage
NULL, //Stop Loss
NULL, //Take Profit
TradesComment, //Comment
MagicNumber, //Magic No.
0, //Expiration (Only Pending Orders)
clrNONE); //Arrow Color
OP_BUY, //Command Type
0.10, //Lot Size
OrderPrice, //Market Price
Slippage, //Max. Slippage
NULL, //Stop Loss
NULL, //Take Profit
TradesComment, //Comment
MagicNumber, //Magic No.
0, //Expiration (Only Pending Orders)
clrNONE); //Arrow Color
I'll give you another hint... first line of the appropriate section in the link I posted.
honest_knave:
I'll give you another hint... first line of the appropriate section in the link I posted.
I will propose you as candidate for Helper Nobel Prize :-D
I'll give you another hint... first line of the appropriate section in the link I posted.
Check all OrderSend function calls , there might be other calls to functions , further more you are adding sl with other function call where as you have option to send it with order you just adding extra overhead to cpu and broker.
![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
Hello,
I am experiencing the error 131 by using the following code:
if(AccountFreeMarginCheck(Symbol(),OP_BUY,Lots)<=0 || /* NOT_ENOUGH_MONEY */GetLastError()==134)
{
Alert(BalanceErr);
return;
}
else
{
RefreshRates();
double OrderPrice=Ask;
tkt_buy=OrderSend(Symbol(),//Pair
OP_BUY, //Command Type
0.10/*NormalizeDouble(Lots,Digits)*/, //Lot Size
OrderPrice, //Market Price
Slippage, //Max. Slippage
NULL, //Stop Loss
NULL, //Take Profit
TradesComment, //Comment
MagicNumber, //Magic No.
0, //Expiration (Only Pending Orders)
clrNONE); //Arrow Color
if(tkt_buy>0)
{
Print("Buy order placed successfully");
//---
double TheStopLoss=0;
double TheTakeProfit=0;
bool MyOrderSelect=OrderSelect(tkt_buy,SELECT_BY_TICKET);
if(StopLoss > 0) TheStopLoss = OrderOpenPrice()-StopLoss*MyPoint;
if(TakeProfit > 0) TheTakeProfit = OrderOpenPrice()+TakeProfit*MyPoint;
bool MyOrderModify = OrderModify(OrderTicket(), //Selected Ticket No.
OrderOpenPrice(), //Selected Order Open Price
/*Modify*/ NormalizeDouble(TheStopLoss,Digits), //Selected Order Stop Loss
/*Modify*/ NormalizeDouble(TheTakeProfit,Digits), //Selected Order Take Profit
0, //Selected Order Expiration (Only Pending Orders)
Green); //Selected Order Arrow Color
if(!MyOrderModify) Print("Unable to place SL/TP for the Buy order: ",ErrorDescription(GetLastError()));
}
else Print("Buy order failed with error: ",ErrorDescription((GetLastError())));
}
.
seems no wrong on it!! but why I am receiving the following error????