Error Codes - page 5

 

Hi. Definitely something to do with the precision of the digts for StopLoss and TakeProfit. A value of zero for both allows Ordersend to send the order through whereas any value thus far for StopLoss and TakeProfit brings up the #130 error. My broker FXCM does use fractional pips, as an example GU value might be 1.54535 and an example GY value might be 132.155.

I think there may be an issue with Normalizedouble as when applied to a value, say the GU value above, it comes out as: 1.54535000 not 1.54535 - clearly not being set to the corect precision. I'll keep you posed. Cheers

 

Well, after tearing out the little hair I have left I decided again to check my brokers stop loss level. The function:

StopLoss=MarketInfo(Symbol(),MODE_STOPLEVEL);

returned a value of ZERO for StopLoss. This seemed to cause values for StopLoss and TakeProfit in OrderSend other than zero to return the #130 error. I found a workaround by issuing an initial OrderSend with StopLoss and TakeProfit set to zero followed by an OrderModify where the StopLoss and TakeProfit values were then 'modified' from zero to the required values. Not particularly elegant but seems to do the job.

Many thanks guys for your help and hope this will help someone who has similar issues. Cheers

Reason: