Idea by: Scriptor.
MQL5 code by: Vladimir Karputov.
The EA only operates when a new bar appears: It compares the tick volumes of the first and the second bar. Block for making decisions:
//--- Â Â if(array_volume[1]>array_volume[2]) Â Â Â Â { Â Â Â Â Â Â ClosePositions(POSITION_TYPE_SELL); Â Â Â Â Â Â OpenBuy(); Â Â Â Â } Â Â if(array_volume[1]<array_volume[2]) Â Â Â Â { Â Â Â Â Â Â ClosePositions(POSITION_TYPE_BUY); Â Â Â Â Â Â OpenSell(); Â Â Â Â }
- If the tick volume of the first bar is LARGER than that of the second bar, then you should CLOSE your Sell positions and open a Buy position;
- If the tick volume of the first bar is SMALLER than that of the second bar, then you should CLOSE your Buy positions and open a Sell position;
Running the EA on H1 for all symbols (since the EA only operates when a new bar appears, it was launched in the “OHLC mode on M1):
Symbol | Pass | Result | Profit | Expected Payoff | Profit Factor | Recovery Factor | Sharpe Ratio | Custom | Equity DD % | Trades |
---|---|---|---|---|---|---|---|---|---|---|
EURGBP | 8 | 4,709.76 | 1,709.76 | 1.03 | 1.06 | 0.83 | 0.02 | 0 | 67.05 | 1,666 |
EURUSD | 1 | 3,445.02 | 445.02 | 0.28 | 1.02 | 0.23 | 0.02 | 0 | 39.87 | 1,607 |
EURJPY | 7 | 2,949.86 | -50.14 | -0.03 | 1.00 | -0.02 | 0.02 | 0 | 90.27 | 1,561 |
USDJPY | 5 | 2,318.50 | -681.50 | -0.42 | 0.97 | -0.21 | 0.01 | 0 | 75.64 | 1,606 |
GBPUSD | 2 | 128.04 | -2,871.96 | -3.19 | 0.85 | -0.59 | -0.05 | 0 | 97.46 | 900 |
EURCHF | 6 | 102.93 | -2,897.07 | -5.03 | 0.44 | -0.96 | -0.14 | 0 | 96.97 | 576 |
EURCAD | 9 | 90.06 | -2,909.94 | -11.50 | 0.53 | -1.00 | -0.12 | 0 | 97.26 | 253 |
USDCHF | 0 | 84.60 | -2,915.40 | -8.19 | 0.58 | -0.98 | -0.16 | 0 | 97.58 | 356 |
GBPJPY | 11 | 74.40 | -2,925.60 | -5.98 | 0.81 | -0.88 | -0.02 | 0 | 97.99 | 489 |
AUDJPY | 12 | 70.44 | -2,929.56 | -4.47 | 0.76 | -0.83 | -0.03 | 0 | 98.32 | 656 |
GBPCHF | 10 | 69.53 | -2,930.47 | -12.69 | 0.57 | -0.76 | -0.18 | 0 | 98.30 | 231 |
AUDUSD | 4 | 68.15 | -2,931.85 | -3.06 | 0.76 | -0.83 | -0.04 | 0 | 98.55 | 957 |
USDCAD | 3 | -88.32 | -3,088.32 | -4.11 | 0.77 | -0.83 | -0.05 | 0 | 112.21 | 751 |