help needed in writing an EA

 
Hi all,

Can I please indulge a kind developer to write me a small EA for MT4?

Objective: To open and manage hedge orders to orders created manually

Description: I open trades manually in either buy or sell direction. I could open multiple trades at any point of time in either direction for a particular pair (e.g. 3 buys and 2 sells). What I am trying to achieve is to create an EA that would open a hedge when things go bad while I am away from the comp.

Input parameter:

1) TriggerPips: Number of pips from the open price of the original trade at which the hedge should be opened (e.g. if I opened buy trade at 1.55 then value of this parameter as 30 means that the hedge would open at 1.25; can have value of 0)
2) HedgeClosurePips: Number of pips at which hedge would be closed. (e.g. in the above case if this value is 5 pips and price rises to 1.30 then the hedge order should be closed, note that hedge should be reopened if price again falls down to 1.25 and no hedge is currently open; can have value as 0)
3) HedgeProfitClosurePips: Number of pips for which the hedge should remain open even after original trade is closed (typically hedge should be closed along with the original trade. But this parameter keeps it open for few pips more. e.g. if the original trade was closed out at 1.10 then a value of 5 means that the hedge trade would close at 1.05 with SL as 1.10; can have value as 0)
4) HedgeLotMult: Multiplier for the lot calculation of the hedge order (e.g. original order with 2 lot then a value of 0.5 means that the hedge is opened with 1 lot)

Requirements:

1. It should work with both 4 or 5 digit brokers.
2. Hedge order should consider the spread at that point of time (along with Ask and Bid price) and have a slippage allowance of 2 pips.
3. Each hedge orders should be tightly coupled with its corresponding original trade. If there are two buy orders and one sell orders created by me then there should be 2 sell hedge and 1 buy hedge. If one of the original buy gets closed then the corresponding sell hedge should get closed. Others should remain untouched.
4. There should be only one hedge order per original order at any point of time does not matter how many times a hedge was opened for that original order.
5. EA should not confuse between original orders and hedge orders and should not create an endless cycle of trades. Order->hedge->hedge etc.
6. Lot size of hedge should be as mentioned in parameter section
7. No TP should be put for the hedge
8. No SL should be put on the hedge but dynamically calculated based on HedgeClosurePips. When price hits hedge open price+/-HedgeClosurePips then the hedge should be closed automatically i.e. at loss.
9. If the original order is closed by me then EA should find out at what price it was closed (not sure how to find that out). Then add/subtract (based on buy/sell) HedgeProfitClosurePips to the price, set that as TP, set closure price of original price as SL.
a. If current price is <= calculated SL then the hedge should be closed immediately.
b. If current price is >= calculated TP then the hedge should be closed immediately
10. If the original trade was closed between the hedge open price and HedgeClosurePips (i.e. hedge is in loss currently but have not hit the SL) then the hedge should be closed immediately irrespective of HedgeProfitClosurePips and HedgeClosurePips.
11. There can be some way visually to know on MT platform whether an order is original or hedge (again not sure how, comment may be)
12. There is no need to monitor across pairs. I will attach this EA individually to right pair.

Please let me know if something similar is available elsewhere.

Thanks a bunch in advance.
 
Anybody? :(
 
The spirit of this forum is helping each other learn to code mql4. Not for Free-loaders and Sellers. Pay a programmer or learn to code. Peace Y.
 
Can I please indulge a kind developer to write me a small EA for MT4?
No slaves here, either learn to code or pay someone.