Home > Programming > Mql Ea Small Block Code Needed

Mql Ea Small Block Code Needed

August 11th, 2009

The only section of MQL code that I am looking for is the following.
When conditions are true for a Buy..CLOSE all open sell orders if any that have magic number (external variable). Verify all have been closed.
The code should send a buy with current symbol and external variable for lots and external Magic number variable.
Then it should verify that order was opened. When/if order hits external variable Take profit the half of the buy order should be closed and the other half is left open. NO OTHER BUYS get opened, even if there are NO open orders.
When SELL conditions are true then CLOSE all open buy orders with same magic number as above(should only be 1 if any). Verify all orders have been closed.
Then send a Sell with current symbol and external variable for lots and external Magic number variable.
Then it should verify that order was opened. When/if order hits external variable Take profit the half of the sell order should be closed and the other half is left open. NO OTHER SELLS get opened, even if there are NO open orders.

and it continues in both directions. Simple enough.
Open, confirm, close half if TP…close all and repeat in opposite


Mql Ea Small Block Code Needed

Comments are closed.
Bear