You have to check difference between current value of StopLoss and new value. If difference more than 1 Point => you can use OrderModify(). If difference less 1 Point you will get error #1. This error denies your participation. Fix it.
See OrderModify() help:
对于先前的开仓或挂单进行特性修改。如果函数成功,返回的值为 TRUE。如果函数失败,返回的值为FALSE。
获得详细的错误信息,查看 GetLastError()函数。
注解: 开价格和有效时间的改变只对挂单而言。
如果未改变的值作为函数参量通过,将会生成错误 1 (ERR_NO_RESULT)。
在一些服务器中挂单的有效时间会被隐藏。这种情况下,当一个非零值在 有效参量被指定时,将生成错误 147 (ERR_TRADE_EXPIRATION_DENIED)。
For example:
if (MathAbs(OrderTakeProfit()-OldTakeProfitValue)>Point) OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),newTakeProfitValue,0,Yellow);
You have to check difference between current value of StopLoss and new value. If difference more than 1 Point => you can use OrderModify(). If difference less 1 Point you will get error #1. This error denies your participation. Fix it.
See OrderModify() help:
For example:
我的也是这样错误 不知道什么原因!
me too !
You have to check difference between current value of StopLoss and new value. If difference more than 1 Point => you can use OrderModify(). If difference less 1 Point you will get error #1. This error denies your participation. Fix it.
See OrderModify() help:
For e
这种错误,是无效返回,没有错误 在快速测试得时候,才有,复盘演示和实盘挂 盘,都没有这种错误,要想实现追踪修改,在块速测试钟是避免不了这种错误的,无效返回没有错误.如果按
For example:
if (MathAbs(OrderTakeProfit()-OldTakeProfitValue)>Point) OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),newTakeProfitValue,0,Yellow);修改,实现不了追踪