我试图在我的函数中插入一个takeprofit
andstoploss
参数SendOrder()
,但出现以下错误:
Order Sent Failed with Error #130
这是我的代码:
extern double takeprofit = 30.0;
extern double stoploss = 20.0;
stoploss = NormalizeDouble( stoploss, 5 ); // SET stop loss
Print( "stoploss", stoploss );
takeprofit = NormalizeDouble( takeprofit, 5 ); // SET take profit
ticket = OrderSend( Symbol(),
OP_SELL,
lotsize,
Ask,
100,
stoploss,
takeprofit,
0,
0,
0,
CLR_NONE
);
if ( ticket < 0 ) {
Print( "Order send failed with error #", GetLastError() );
}
else Print( "Order send sucesso!!" );
我已经检查了该函数的文档NormalizeDouble()
,但我仍然收到错误消息。
我应该怎么办?