Tâche terminée
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Spécifications
This is a semi-automated trading EA that compares a portfolio of currencies and buys the strongest pair and short the weakest pair.
-----------------------------------------------------------------------------------------------------
When 'Start trade' button is activated on the chart:
1. When Bar is closed and no existing trade:
1.1 For each pair (Pair1 to Pair8) evaluate price difference between [price close of current bar] and [open price of ref_date_time]
1.2 Direct or Inverse
If PairX_v = direct then no change to price difference
If PairX_v= inverse then multiply price difference with negative
(Display price from highest to lowest in sequence)
1.3 Compare all price difference
For pair that is the strongest - buy @ Market with LotSize (but if PairX_v = inverse, short the pair)
For pair that is the weakest - sell @ Market with LotSize (but if PairX_v = inverse, buy the pair)
2. When Bar is closed and trade is active:
2.1 Check if profit has reached
Check if profit > TargetProfit then close the trade
2.2 For each pair (Pair1 to Pair8) evaluate price difference between [price close of current bar] and [open price of ref_date_time]
2.3 Direct or Inverse
If PairX_v = direct then no change to price difference
If PairX_v= inverse then multiply price difference with negative
2.4 Check if pairs remain strongest and weakest
Check if the strongest pair is still the same, if not - close previous pair and open new BUY trade with with LotSize + LotIncrease
Check if the weakest pair is still the same pair, if not - close previous pair and open new SELL trade with with LotSize + LotIncrease
3.0 When 'Close Trade' button is activated, close trade based on MagicNumber