Download MetaTrader 5

MQL4 - basic help

To add comments, please log in or register
AForeignTrader
10
AForeignTrader  

I want a pending order to replace itself after it has been closed. For example market moves from 0.75000 and opens a buystop, market moves to 0.75200 and I profit 20 pips. How do get that buystop(now a buy limit) to be placed again at 0.75000 upon closing the original one (ie. replace itself over and over everytime it is closed). 

Take it easy fellas, I'm new (clearly!). :)

Also please let me know if I have posted in the wrong part, I have never used forums before. 

Drazen Penic
2579
Drazen Penic  

If you are new to coding in general, it will be pretty complex.

If you have some coding experience then look at MQL4 Trading functions, especially OrdersTotal()  and OrdersHistoryTotal().
You'll find examples there.
Also, search for these functions in this forum.

Trade Functions - MQL4 Reference
Trade Functions - MQL4 Reference
  • docs.mql4.com
Trade Functions - MQL4 Reference
AForeignTrader
10
AForeignTrader  
Drazen Penic:

If you are new to coding in general, it will be pretty complex.

If you have some coding experience then look at MQL4 Trading functions, especially OrdersTotal()  and OrdersHistoryTotal().
You'll find examples there.
Also, search for these functions in this forum.

If anyone has time to post an example below please feel free to do so.

Cheers, I'll have a look at those links.

Drazen Penic
2579
Drazen Penic  

Check the links. You'll find code samples there.

Also, search the forum. Don't be lazy. 

To add comments, please log in or register