仕事が完了した
指定
I've had a change of mind, I want the EA to manage trades TP/SL ONLY. The Trading rules for the Moving average things and stuff needs to be sorted and ironed out. Prior to being programmed i need to manually trade it a bit more to ensure correct trading logic I need to manually test the aggression of the EA with the aid of a Trade Management EA prior to having them coded together.
So, all I want is a simple trade management EA.
Inputs/Settings:
Stop Loss (SL) in pips
Take Profit (TP) in pips
Logic is as follows
On NewTrade Open LONG
IF Other LONG Trades exist for this Symbol THEN
If Order Long Entry Price > All Previous Orders Open Price THEN
- Set Take profit for new order to input - TP
- Set Stop Loss for new order to input - SL
- Modify TP and SL for ALL Previous Open Long Orders to the same as the new one
ELSE
- Find Average Open Price for all LONGS in this symbol.
- Find Nearest SL (highest value) for all Open long Orders.
- Set Take profit for new order to the Average Order Price (For ALL Long orders) + TP pips
- Set Stop Loss for new order to the nearest SL found from Step 2.
- Modify ALL LONG Take Profits Same as Step 3. (Average Price + TP)
- Modify ALL LONG Stop Profits same as Step 4 (to the Nearest SL found)
END IF
ELSE (No previous long orders are open)
- Modify SL/TP to the user defined ones in settings.
END IF
And the opposite for a Short Trade
On New Trade Open SHORT
IF Other SHORTTrades exist for this Symbol THEN
If Order SHORT Entry Price < All Previous Orders SHORT Open Price THEN
- Set Take profit for new order to - TP
- Set Stop Loss for new order to - SL
- Modify TP and SL for ALL Previous Open Short Orders to the same as the new order
ELSE
- Find Average Open Price for all SHORTS in this symbol.
- Find Nearest SL (highest value) for all Open Short Orders.
- Set Take profit for new order to the Average Order Price (For ALL Short orders) + TP pips
- Set Stop Loss for new order to the nearest SL found from Step 2.
- Modify ALL SHORT Take Profits Same as Step 3. (Average Price + TP)
- Modify ALL SHORT Stop Profits same as Step 4 (to the Nearest SL found)
ELSE (No previous long orders are open)END IF
- Modify SL/TP to the user defined ones in settings.
END IF
This trade manager must be capable of running on one chart, but managing ALL open charts and symbols.