Help ... error 130 order modify - page 2

 
giovanni:

Hi RaptorUK,

Thank you .... the Avgprc is the "averaging of some opened orders", this will replace the OrderOpenPrice() .... but you say that : the OrderOpenPrice() of an OP_BUY can not be changed ? How about Openprice of OP_SELL ? Some times I got the same error also for OP_BUY process.

The snippet of the code of Modifying OP_SELL orders :

Thank you very much for your help ...

So let me get this straight . . . you have an open OP_BUY order and you are trying to change it's open price to 0.12176000 when the current Ask is 1.22540000 regardless of the fact that you can't change the Open price of an already open market order . . . your price is way, way off . . .

Yes, correct, you MUST use OrderOpenPrice() :-)

As ubzen said above, you need to be checking with Freezelevel, ( https://book.mql4.com/appendix/limits ) and don't forget what can happen when comparing doubles . . . Can price != price ? and also what I discovered with error 130: https://www.mql5.com/en/forum/134846

 
ubzen:

Umm.. I already caught one-error. This line.

What I wanted to code is if( Target>OOP+(Freeze_Lv+1)*Integ2Pips) .... When dealing with Op_Buy Orders. And Of course.

if( Target<OOP-(Freeze_Lv+1)*Integ2Pips)... When dealing with Op_Sell Orders.

See if you can figure-out a way to code it ... Because you certainly CAN modify orders while its within the Freeze-Level. You just cannot Close-it, nor place a Take-Profit within the Freeze-Level.


Hi Ubzen,

You're right. After testing the first code, I got "unsual result", there are some many loss trade at my strategy tester ... :)

Thank you very much for your update ... I will try again ...

Best Regards,
Gio

 
RaptorUK:

So let me get this straight . . . you have an open OP_BUY order and you are trying to change it's open price to 0.12176000 when the current Ask is 1.22540000 regardless of the fact that you can't change the Open price of an already open market order . . . your price is way, way off . . .

Yes, correct, you MUST use OrderOpenPrice() :-)

As ubzen said above, you need to be checking with Freezelevel, ( https://book.mql4.com/appendix/limits ) and don't forget what can happen when comparing doubles . . . Can price != price ? and also what I discovered with error 130: https://www.mql5.com/en/forum/134846


Hi RaptorUK,

Thanks again ... the links you gave are very useful ...

Best Regards,
Gio