Trabajo finalizado
Tarea técnica
Hello,
This EA will be sort of a gatekeep or a type of guardrail for an account that sends signals to others accounts.
It will (1) limit the direction that trades are allowed to be opened and (2) limit the total number of lots (market and pending) that are allowed to be opened.
More detail:
- A text and and accompanying dropdown for each of the 7 major USD pairs (EURUSD, GBPUSD, AUDUSD, NZDUSD, USDCAD, USDJPY, USDCHF)
- The dropdown will have 4 choices: buy, sell, both and neither. These will allow trades in that direction
- If buy is selected for a pair (USDCAD for example), then sell orders will be closed by the EA if opened.
- If Sell is selected, then buy orders will be closed by the EA if opened.
- If Both are selected then the EA won't do anything.
- If Neither is selected then any orders on that pair will be closed by the EA.
- Limits the total number of lots that are in OPEN orders at a given time.
- This needs to be in increments of .01 and I don't think there needs to be an upper limit.
- If the limit is .05 and there are .04 lots open and an order of .02 is added, then that .02 order should be closed
- however, if the market order is changed from .02 to .01 then it is not closed by the EA.
- If the limit is .05 and there are .05 lots running and the amount of lots for open orders is reduced to .04, then .01 lots will be closed. It should close the most recent trades that have been opened to satisfy this until complete
- Limits the total number of lots that are in PENDING orders at a given time .
- This needs to be in increments of .01 and I don't think there needs to be an upper limit.
- If the limit is .05 and there are .04 lots pending and an order of .02 is added, then that .02 order should be closed.
- however, if the pending order is changed from .02 to .01 then it is not closed by the EA.
- If the limit is .05 and there are .05 lots running and the amount of lots for pending orders is reduced to .04, then .01 lots will be closed. It should close the most recent trades that have been opened to satisfy this until complete
I don't need errors or popups but I would also need logging done to the MT4 journal section or something like that if possible. This way I can find out if an order was closed due to not allowing enough open lots and other things like that.
I've done a mockup graphic of what the interface would look like along with some logic that might explain what I think it might look like.
Once it's completed I'd like to perform some tests to ensure that it works satisfactory.