Need Help With Modify Pending Orders. Anyone? - page 2

 
What i was trying to do innitially was that....the original script on MT4 send_pending.mq4. i wanted to try to add the modify code in so as to input the SL and TP for ECN brokers. But the book i read abt only shows how to do that in an EA. Nothing close to what the send_pending original code is. That is what im really now sure what to add into the code in order for it to modify the pending order. And i think trailing will be much more different than just SL and TP.
 
Hmm....Raptor. Thanks for replying to my thread. I think you are the only 1. Im very grateful fo it. Since im learning. If you are kind enough. Just let me know what codes is it for me to bring out the pending order price and do i need to calculate the Sl and TP if i want to modify it. I'll try and firgure it out myself first.
 
Spawn1980:
Hmm....Raptor. Thanks for replying to my thread. I think you are the only 1. Im very grateful fo it. Since im learning. If you are kind enough. Just let me know what codes is it for me to bring out the pending order price and do i need to calculate the Sl and TP if i want to modify it. I'll try and firgure it out myself first.

OK. Fundamentally there is no difference to any of the calculations you need to do for SL & TP between ECN and non-ECN Brokers . . . the difference is that for ECN Brokers you send the order with SL & TP at 0 and then use OrderModify to add in the SL & TP after the OrderSend has worked . . .

Your code looks OK, you do need to check return values from the OrderModify and report any errors . . . but I suspect that your issue is still in calculating StopLevel . . maybe it should be this ?

double StopLevel = (MarketInfo(Symbol(),MODE_STOPLEVEL) + PFEP) * EntPoint));

You need to understand the code you are trying to use, if you don't understand a line read the documentation on each command in the line . . and understand what is going on. It's the only way . . unless you simply want to go here: https://www.mql5.com/en/job

 

Oh...that is a Programmer For Hire website. lol.....nah. i wanted to learn this. What do u mean by read the documentation on each command in the line?

 
Spawn1980:

What do u mean by read the documentation on each command in the line?

OK, for example . . if you don't understand what MarketInfo is you need to read this, and read it till you understand it: https://docs.mql4.com/common/MarketInfo
 

Oh...ok. I will get on with it. Thanks.

Reason: