Help with ordermodify

 

Hi partners,


i have one error to put SL and TP after trade opened. Correct is with ordermodify command right?


follow my cod part with buy trade:

*******************************

// Buy criteria

if ( g_buy > 0 && lowA <= g_buy && ma2 > ma3)


int openbuy=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,0,0,"robot",BuyMagicNumber,0,Blue);

*****************************

How to modify SL and TP after trade opened? I need this to use in ECN broker, because not accept SL and SL directy.



kind regards,

philipe

 
ECN Thanks to RaptorUK
 

please, if anyone can help me.


Philipe.

 
felipeds5:

How to modify SL and TP after trade opened? I need this to use in ECN broker, because not accept SL and SL directy.


Use OrderModify()

https://docs.mql4.com/trading/ordermodify

 
felipeds5:

please, if anyone can help me.


Philipe.

Did you look at any of the links ? there is plenty of sample code to choose from . .
 

friends, i put here:


its necessary order select? how to call correcty the ordermodify?


cod:

************************

int openbuy=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,0,0,"robot",BuyMagicNumber,0,Blue);

OrderSelect(openbuy,SELECT_BY_POS,MODE_TRADES);

OrderModify(openbuy, OrderOpenPrice(),slb,tpb,0,Yellow);

*****************


Philipe

 
felipeds5:

friends, i put here:

its necessary order select? how to call correcty the ordermodify?

Philipe

1. When writing code please use SRC button,

2. Sample, https://www.mql5.com/en/forum/139047

 

hi friends,


i not understand their explanations. i am sending code attached to see.

i need only that SL and TP be added by ordermodify.. not in ordersend


Can you do directly in my code attached


please help me.


kind regards, philipe

Files:
expert.mq4  5 kb
 

felipeds5 2012.05.23 03:30

hi friends,

i not understand their explanations. i am sending code attached to see.

i need only that SL and TP be added by ordermodify.. not in ordersend

Can you do directly in my code attached

please help me.

kind regards, philipe

That's, actually my explanation

Please report back if this is working or not.

:)

Files:
expert_1.mq4  8 kb
 
onewithzachy:

Please report back if this is working or not.

:)


yes, works 100%


thank you very much !!


which you skype id to private contact? send by PM.


:) philipe

 
felipeds5:

yes, works 100%

thank you very much !!

which you skype id to private contact? send by PM.

:) philipe

Great ! :)

Have no skype :(

Have fun

:)

Reason: