OrderModify producing Invalid Stops

 

Hi all,

I am using the OrderModify function within CTrade which works fine unless I try to set either the SL or TP as the same value as already exists. If both are different then it processes the change correctly, but if either is the same then I get a "Invalid stops" error.  Reading the documentation it says "The new price by which the Stop Loss will trigger (or the previous value, if the change is not necessary)". Is this a bug or incorrect documentation?

I can write the code to not send a value if it is the same as before, but just wanted to check first.

Thanks

 

Invalid stops because you can not modify a stop to the value that it already has.

You can check the values and only call for the modification when they differ.

 

i think there are two reason for this...

one is your new stop price is the same with original stop price..

2nd one: there is a stoploss level in the specification of each symbol. it is to ensure your stop price is not too close to the current market price..., if your new stop price is too close, you will get invalid stop error
 
fobot:

Hi all,

I am using the OrderModify function within CTrade which works fine unless I try to set either the SL or TP as the same value as already exists. If both are different then it processes the change correctly, but if either is the same then I get a "Invalid stops" error.  Reading the documentation it says "The new price by which the Stop Loss will trigger (or the previous value, if the change is not necessary)". Is this a bug or incorrect documentation?

I can write the code to not send a value if it is the same as before, but just wanted to check first.

Thanks


If you use this binary, the error will not occur even if the SL and TP are the same as the value to be changed.



CTrade                     TS_trade;                        
MqlTradeRequest            TS_data; 
Reason: