Tâche terminée
Spécifications
Hedge EA V1
Here's an example of what i need done:
1) Let's say that I want LONG on EURUSD at 1.0600 - 5:00 PM
2) Now at 5:03 PM, price has risen to 1.0602 which means that I'm up +2 pips in profit on my initial LONG position.
3) The EA will need to lock in the 2 pips by opening a SELL position at 1.0602.
4) The SELL position must be made as a Market Order, if the "Hedge Lockin Pip" amount is below the "Broker Limit Restriction".
5) If not the SELL position should be made as a Pending Limit Order, if the "Hedge Lockin Pip" amount is above the "Broker Limit Restriction".
6) Once that's done the EA will then need to close the Initial and Hedge Orders based on a specific "Hedge Expiry Minute", so for example lets say that i have setup 10 mins, then the EA will close the LONG and SHORT position at 5:13 PM.
7) Now if the Hedge Order was not able to be open within the expiry time of the Initial Order, then the EA will need to close the Initial Order but ONLY if the order is equal or greater then the "Close Pip Amount" parameter.
- So for example if the Initial Orders expiry is set to 10 minutes then once 5:10 pm has been reached the EA will need to first check to see if the Hedge was initiated during that time if not then the EA will need to check to see if the Initial Order is equal or greater then the "Close Buffer Amount", and if it is then the EA should close the position.
- If i set the Close Buffer Amount at "1" then the Initial LONG position will need to be 1.0601 or greater for the EA to close the position, and the EA will need to constantly check for these condition till the Initial Order get closed by the EA or manually.
8) If the Initial Order was made as a Pending Order, then the Hedge Order should be placed instantly onto the Account unless it has to be a Market Order, in case of it being within the Brokers Limit Order Restriction.
9) The EA should base these conditions on all orders that are placed onto the account, so there no need for a specific comment or etc to recognize the order.
10) If the Negative Slippage exceeds the users set amount on the Hedging Market Orders, the EA will need to wait and keep retrying the Order again ONLY if the conditions are as explained below. The EA should keep checking for these conditions till the Initial Order expiry has been reached.
-----------------------------------------------------------------------------------------------------------------------------------------
EA Input Settings
Hedge Lockin Pips = This is the amount of pips in profit the Initial Order has to be in for the EA to open a Hedging Order.
Stoploss Pip Amount = This will be the Stoploss Amount in pips, that the EA will use, but ONLY for the Initial Order, plus if i set the parameter to "0" it should disable the Stoploss from being placed on the Initial Order unless done manually.
Close Buffer Amount = This parameter should only work along side the "Initial Expiry Minutes", so basically the EA will only close the Initial Order once the required amount of pips in profit is equal or great then this amount set by the user.
Initial Expiry Minutes = This parameter should only be used if the Hedge Order was not able to be created within the time the Initial Order formed and the expiry minute that was set by the user. Now once this happens the EA will then need to check to see if the Initial Order is equal or great then the Close Pip Amount, if it is then the EA should close the Initial Order. However if its not then the EA should only close the order once it reaches the required Close Pip Amount.
Hedge Expiry Minutes = This is used to close the Initial Order and Hedge Order, once the Hedge Order has been activated. This will be based on the opening time of the Hedge Order and the expiry minute set by the user for this parameter.
Broker Limit Restriction = This parameter will decide if the Hedge Order should be a Market Order or a Limit Order as some brokers have restrictions on how close a pending order can be placed onto the account, so therefore if i set 5 pips on this parameter then any "Hedge Lockin Pips" 5 or greater will need to use a Limit Order when placing the Hedge Orders. If the "Hedge Lockin Pips" is below 5 pips then the EA will need to use a Market Order for any Hedge Orders. If i set this parameter to 0 then the EA will use Limit Orders for all Hedge Orders.
Order Negative Slippage = This parameter will decide the amount of negative slippage that should be allowed on each Hedging Market Order, so for example if i set this parameter to 0.5 then it means that if my Lockin Pips is 2 pips and we experienced Negative Slippage of around 0.5 which means the EA was only able to Lockin 1.5pips, then the EA will need proceed with the Hedge Market Order. ONLY if it was lets say 0.6 then it will need to wait till difference moves back to 0.5 or better.