


NOTE...when you set risk to 0 it trades in lots per trade
Opposite... performs the opposite transaction when set to true, and when set to false
Strategy Test Report
2
AlpariUK-Classic-2 (Build 419)
| Symbolizes | GBPUSD (British Pound against USD) |
| period | 4 hours (H4) 2012.01.02 00:00 - 2012.06.01 20:00 (2012.01.01 - 2012.06.03) |
| Model | per price tick (most accurate method based on all available shortest timeframes) |
| Parameters | Risk=0; Lots=1; Stop=50; TakeProfit=100; Reverse=False; Monday StartTime="00:00"; MondayEndTime="23:59"; Tuesday StartTime="00:00"; WednesdayEndTime="23:59"; Thursday start time="00:00"; Thursday end time="23:59"; Friday start time="00:00"; FridayEndTime="23:59"; magic number = 0; writescreenshot = true; track start = 50; trace amount = 10; period AMA = 9; n fast = 7; ns slow = 30; G = 1; dK = 3; faster LWMA = 7; slower LWMA = 30; sound alert = true; Fast EMA=30; Slow EMA=40; Signal EMA=9; Slippage Exit=6; Slippage Input=2; |
|
| Bar Chart in Test | 1661 | Tick Modeling | 7089055 | Modeling Quality | Not Applicable |
| Chart Error Mismatch | 511 | | | | |
|
| Initial deposit | 10000.00 | | | | |
| Total net profit | 3180.60 | Gross profit | 7721.20 | Total loss | -4540.60 |
| Profit coefficient | 1.70 | Expected return | 113.59 | | |
| Absolute retracement | 345.00 | Maximum retracement | 3104.30 (20.72%) | Relative retracement | 20.72% (3104.30) |
|
| Total Volume | 28 | Short Positions (Win %) | 18 (44.44%) | Long Positions (Win %) | 10 (60.00%) |
| Profitable trades (% of total) | 14 (50.00%) | Losing trades (% of total) | 14 (50.00%) |
| Maximum | profit trade | 1000.00 | Loss trade | - 503.70 |
| Average | profit trade | 551.51 | Loss trade | - 324.33 |
| Maximum | winning streak (monetary profit) | 5 (1549.20) | Loss streak (monetary loss) | 4 (-1502.00) |
| Maximum | consecutive profits (number of wins) | 1995.90 (2) | Consecutive losses (number of losses) | -1502.00 (4) |
| Average | consecutive wins | 2 | consecutive losses | 2 |
| #Time | type | command | size | price | small/large | temperature/ | pressure | profit | balance |
| 1 | 2012.01.02 12:00 | buy | 1 | 1.00 | 1.55014 | 0.00000 | 0.00000 | |
| 2 | 2012.01.02 12:00 | Adjustment | 1 | 1.00 | 1.55014 | 1.54514 |
1.56014 | | | 3 | 2012.01.03 06:08 | Adjustment | 1 | 1.00 | 1.55014 | 1.55014 | 1.56014 | |
| 4 | 2012.01.03 07:33 | Adjustment | 1 | 1.00 | 1.55014 | 1.55114 | 1.56014 | |
| 5 | 2012.01.03 08:20 | Adjustment | 1 | 1.00 | 1.55014 | 1.55214 | 1.56014 | |
| 6 | 2012.01.03 08:45 | Adjustment | 1 | 1.00 | 1.55014 | 1.55314 | 1.56014 | |
| 7 | 2012.01.03 11:17 | tons/ton | 1 | 1.00 | 1.56014 | 1.55314 | 1.56014 | 999.60 | 10999.60 |
| 8 | 2012.01.05 20:00 | Sell | 2 | 1.00 | 1.54915 | 0.00000 | 0.00000 | |
| 9 | 2012.01.05 20:00 | Adjustment | 2 | 1.00 | 1.54915 | 1.55415 | 1.53915 | |
| 10 | 2012.01.06 14:38 | Adjustment | 2 | 1.00 | 1.54915 | 1.54915 | 1.53915 | |
| 11 | 2012.01.06 15:40 | Adjustment | 2 | 1.00 | 1.54915 | 1.54815 | 1.53915 | |
| 12 | 2012.01.06 15:43 | Adjustment | 2 | 1.00 | 1.54915 | 1.54715 | 1.53915 | |
| 13 | 2012.01.06 16:03 | Adjustment | 2 | 1.00 | 1.54915 | 1.54615 | 1.53915 | |
| 14 | 2012.01.06 16:21 | tons/ton | 2 | 1.00 | 1.53915 | 1.54615 | 1.53915 | 996.30 | 11995.90 |
| 15 | 2012.01.11 00:00 | purchase | 3 | 1.00 | 1.54842 | 0.00000 | 0.00000 | |
| 16 | 2012.01.11 00:00 | Adjustment | 3 | 1.00 | 1.54842 | 1.54342 | 1.55842 | |
| No. 17 | 2012.01.11 11:28 | l/l | 3 | 1.00 | 1.54342 | 1.54342 | 1.55842 | -500.00 | 11495.90 |
| 18 | 2012.01.11 12:00 | Sell | 4 | 1.00 | 1.54354 | 0.00000 | 0.00000 | |
| 19 | 2012.01.11 12:00 | Adjustment | 4 | 1.00 | 1.54354 | 1.54854 | 1.53354 | |
| 20 | 2012.01.11 12:37 | Adjustment | 4 | 1.00 | 1.54354 | 1.54354 | 1.53354 | |
| twenty one | 2012.01.11 15:33 | Adjustment | 4 | 1.00 | 1.54354 | 1.54254 | 1.53354 | |
| twenty two | 2012.01.11 15:36 | Adjustment | 4 | 1.00 | 1.54354 | 1.54154 | 1.53354 | |
| twenty three | 2012.01.11 16:03 | Adjustment | 4 | 1.00 | 1.54354 | 1.54054 | 1.53354 | |
| twenty four | 2012.01.11 17:13 | tons/ton | 4 | 1.00 | 1.53354 | 1.54054 | 1.53354 | 1000.00 | 12495.90 |
| 25 | 2012.01.11 17:13 | Sell | 5 | 1.00 | 1.53329 | 0.00000 | 0.00000 | |
| 26 | 2012.01.11 17:13 | Adjustment | 5 | 1.00 | 1.53329 | 1.53829 | 1.52329 | |
| 27 | 2012.01.12 09:03 | Adjustment | 5 | 1.00 | 1.53329 | 1.53329 | 1.52329 | |
| 28 | 2012.01.12 10:48 | l/l | 5 | 1.00 | 1.53329 | 1.53329 | 1.52329 | -11.10 | 12484.80 |
| 29 | 2012.01.17 08:00 | purchase | 6 | 1.00 | 1.53667 | 0.00000 | 0.00000 | |
| 30 | 2012.01.17 08:00 | Adjustment | 6 | 1.00 | 1.53667 | 1.53167 | 1.54667 | |
| 31 | 2012.01.18 15:52 | Adjustment | 6 | 1.00 | 1.53667 | 1.53667 | 1.54667 | |
| 32 | 2012.01.18 21:11 | Adjustment | 6 | 1.00 | 1.53667 | 1.53767 | 1.54667 | |
| 33 | 2012.01.19 09:57 | Adjustment | 6 | 1.00 | 1.53667 | 1.53867 | 1.54667 | |
| 34 | January 19, 2012 11:31 | Adjustment | 6 | 1.00 | 1.53667 | 1.53967 | 1.54667 | |
| 35 | 2012.01.19 16:46 | tons/ton | 6 | 1.00 | 1.54667 | 1.53967 | 1.54667 | 998.40 | 13483.20 |
| 36 | 2012.02.06 08:00 | Sell | 7 | 1.00 | 1.57781 | 0.00000 | 0.00000 | |
| 37 | 2012.02.06 08:00 | Adjustment | 7 | 1.00 | 1.57781 | 1.58281 | 1.56781 | |
| 38 | 2012.02.06 17:13 | l/l | 7 | 1.00 | 1.58281 | 1.58281 | 1.56781 | -500.00 | 12983.20 |
| 39 | 2012.02.09 12:00 | Sell | 8 | 1.00 | 1.58401 | 0.00000 | 0.00000 | |
| 40 | 2012.02.09 12:00 | Adjustment | 8 | 1.00 | 1.58401 | 1.58901 | 1.57401 | |
| 41 | 2012.02.10 06:03 | Adjustment | 8 | 1.00 | 1.58401 | 1.58401 | 1.57401 | |
| 42 | 2012.02.10 08:23 | Adjustment | 8 | 1.00 | 1.58401 | 1.58301 | 1.57401 | |
| 43 | 2012.02.10 10:32 | l/l | 8 | 1.00 | 1.58301 | 1.58301 | 1.57401 | 96.30 | 13079.50 |
| 44 | 2012.02.17 00:00 | purchase | 9 | 1.00 | 1.58054 | 0.00000 | 0.00000 | |
| 45 | 2012.02.17 00:00 | Adjustment | 9 | 1.00 | 1.58054 | 1.57554 | 1.59054 | |
| 46 | 2012.02.17 10:38 | Adjustment | 9 | 1.00 | 1.58054 | 1.58054 | 1.59054 | |
| 47 | 2012.02.17 16:03 | l/l | 9 | 1.00 | 1.58054 | 1.58054 | 1.59054 | 0.00 | 13079.50 |
| 48 | 2012.02.22 00:00 | Sell | 10 | 1.00 | 1.57793 | 0.00000 | 0.00000 | |
| 49 | 2012.02.22 00:00 | Adjustment | 10 | 1.00 | 1.57793 | 1.58293 | 1.56793 | |
| 50 | 2012.02.22 10:38 | Adjustment | 10 | 1.00 | 1.57793 | 1.57793 | 1.56793 | |
| 51 | 2012.02.22 10:42 | Adjustment | 10 | 1.00 | 1.57793 | 1.57693 | 1.56793 | |
| 52 | 2012.02.22 10:52 | Adjustment | 10 | 1.00 | 1.57793 | 1.57593 | 1.56793 | |
| 53 | 2012.02.22 13:27 | Adjustment | 10 | 1.00 | 1.57793 | 1.57493 | 1.56793 | |
| 54 | 2012.02.22 13:57 | tons/ton | 10 | 1.00 | 1.56793 | 1.57493 | 1.56793 | 1000.00 | 14079.50 |
| 55 | February 24, 2012 16:00 | purchase | 11 | 1.00 | 1.58575 | 0.00000 | 0.00000 | |
| 56 | February 24, 2012 16:00 | Adjustment | 11 | 1.00 | 1.58575 | 1.58075 | 1.59575 | |
| 57 | 2012.02.27 00:00 | closure | 11 | 1.00 | 1.58912 | 1.58075 | 1.59575 | 336.60 | 14416.10 |
| 58 | 2012.03.02 20:00 | Sell | 12 | 1.00 | 1.58473 | 0.00000 | 0.00000 | |
| 59 | 2012.03.02 20:00 | Adjustment | 12 | 1.00 | 1.58473 | 1.58973 | 1.57473 | |
| 60 | 2012.03.05 00:00 | closure | 12 | 1.00 | 1.58353 | 1.58973 | 1.57473 | 116.30 | 14532.40 |
| 61 | 2012.03.05 00:00 | Sell | 13 | 1.00 | 1.58327 | 0.00000 | 0.00000 | |
| 62 | 2012.03.05 00:00 | Adjustment | 13 | 1.00 | 1.58327 | 1.58827 | 1.57327 | |
| 63 | 2012.03.06 01:38 | l/l | 13 | 1.00 | 1.58827 | 1.58827 | 1.57327 | -503.70 | 14028.70 |
| 64 | 2012.03.09 00:00 | purchase | 14 | 1.00 | 1.58300 | 0.00000 | 0.00000 | |
| 65 | 2012.03.09 00:00 | Adjustment | 14 | 1.00 | 1.58300 | 1.57800 | 1.59300 | |
| 66 | 2012.03.09 10:31 | l/l | 14 | 1.00 | 1.57800 | 1.57800 | 1.59300 | -500.00 | 13528.70 |
| 67 | 2012.03.09 20:00 | Sell | 15 | 1.00 | 1.56678 | 0.00000 | 0.00000 | |
| 68 | 2012.03.09 20:00 | Adjustment | 15 | 1.00 | 1.56678 | 1.57178 | 1.55678 | |
| 69 | 2012.03.12 00:00 | closure | 15 | 1.00 | 1.56687 | 1.57178 | 1.55678 | -12.70 | 13516.00 |
| 70 | 2012.03.12 00:00 | Sell | 16 | 1.00 | 1.56664 | 0.00000 | 0.00000 | |
| 71 | 2012.03.12 00:00 | Adjustment | 16 | 1.00 | 1.56664 | 1.57164 | 1.55664 | |
| 72 | 2012.03.12 12:03 | Adjustment | 16 | 1.00 | 1.56664 | 1.56664 | 1.55664 | |
| 73 | 2012.03.13 10:16 | l/l | 16 | 1.00 | 1.56664 | 1.56664 | 1.55664 | -3.70 | 13512.30 |
| 74 | 2012.03.15 20:00 | purchase | No. 17 | 1.00 | 1.57237 | 0.00000 | 0.00000 | |
| 75 | 2012.03.15 20:00 | Adjustment | No. 17 | 1.00 | 1.57237 | 1.56737 | 1.58237 | |
| 76 | 2012.03.16 13:32 | Adjustment | No. 17 | 1.00 | 1.57237 | 1.57237 | 1.58237 | |
| 77 | 2012.03.16 13:47 | Adjustment | No. 17 | 1.00 | 1.57237 | 1.57337 | 1.58237 | |
| 78 | 2012.03.16 13:53 | Adjustment | No. 17 | 1.00 | 1.57237 | 1.57437 | 1.58237 | |
| 79 | 2012.03.16 14:03 | Adjustment | No. 17 | 1.00 | 1.57237 | 1.57537 | 1.58237 | |
| 80 | 2012.03.16 14:36 | tons/ton | No. 17 | 1.00 | 1.58237 | 1.57537 | 1.58237 | 999.60 | 14511.90 |
| 81 | 2012.03.22 12:00 | Sell | 18 | 1.00 | 1.57997 | 0.00000 | 0.00000 | |
| 82 | 2012.03.22 12:00 | Adjustment | 18 | 1.00 | 1.57997 | 1.58497 | 1.56997 | |
| 83 | 2012.03.23 08:23 | l/l | 18 | 1.00 | 1.58497 | 1.58497 | 1.56997 | -503.70 | 14008.20 |
| 84 | 2012.03.29 00:00 | Sell | 19 | 1.00 | 1.58878 | 0.00000 | 0.00000 | |
| 85 | 2012.03.29 00:00 | Adjustment | 19 | 1.00 | 1.58878 | 1.59378 | 1.57878 | |
| 86 | 2012.03.29 21:11 | l/l | 19 | 1.00 | 1.59378 | 1.59378 | 1.57878 | -500.00 | 13508.20 |
| 87 | 2012.03.30 08:00 | purchase | 20 | 1.00 | 1.59848 | 0.00000 | 0.00000 | |
| 88 | 2012.03.30 08:00 | Adjustment | 20 | 1.00 | 1.59848 | 1.59348 | 1.60848 | |
| 89 | 2012.03.30 13:48 | Adjustment | 20 | 1.00 | 1.59848 | 1.59848 | 1.60848 | |
| 90 | 2012.03.30 15:57 | l/l | 20 | 1.00 | 1.59848 | 1.59848 | 1.60848 | 0.00 | 13508.20 |
| 91 | 2012.04.04 00:00 | Sell | twenty one | 1.00 | 1.59119 | 0.00000 | 0.00000 | |
| 92 | 2012.04.04 00:00 | Adjustment | twenty one | 1.00 | 1.59119 | 1.59619 | 1.58119 | |
| 93 | 2012.04.04 12:43 | Adjustment | twenty one | 1.00 | 1.59119 | 1.59119 | 1.58119 | |
| 94 | 2012.04.04 15:58 | Adjustment | twenty one | 1.00 | 1.59119 | 1.59019 | 1.58119 | |
| 95 | 2012.04.05 02:47 | l/l | twenty one | 1.00 | 1.59019 | 1.59019 | 1.58119 | 88.90 | 13597.10 |
| 96 | 2012.04.11 00:00 | Sell | twenty two | 1.00 | 1.58622 | 0.00000 | 0.00000 | |
| 97 | 2012.04.11 00:00 | Adjustment | twenty two | 1.00 | 1.58622 | 1.59122 | 1.57622 | |
| 98 | 2012.04.11 09:56 | l/l | twenty two | 1.00 | 1.59122 | 1.59122 | 1.57622 | -500.00 | 13097.10 |
| 99 | April 11, 2012 16:00 | purchase | twenty three | 1.00 | 1.59141 | 0.00000 | 0.00000 | |
| 100 | April 11, 2012 16:00 | Adjustment | twenty three | 1.00 | 1.59141 | 1.58641 | 1.60141 | |
| 101 | April 12, 2012 13:40 | Adjustment | twenty three | 1.00 | 1.59141 | 1.59141 | 1.60141 | |
| 102 | 2012.04.13 11:47 | l/l | twenty three | 1.00 | 1.59141 | 1.59141 | 1.60141 | -1.60 | 13095.50 |
| 103 | 2012.04.16 00:00 | Sell | twenty four | 1.00 | 1.58477 | 0.00000 | 0.00000 | |
| 104 | 2012.04.16 00:00 | Adjustment | twenty four | 1.00 | 1.58477 | 1.58977 | 1.57477 | |
| 105 | 2012.04.16 20:47 | l/l | twenty four | 1.00 | 1.58977 | 1.58977 | 1.57477 | -500.00 | 12595.50 |
| 106 | April 17, 2012 12:00 | purchase | 25 | 1.00 | 1.59580 | 0.00000 | 0.00000 | |
| 107 | April 17, 2012 12:00 | Adjustment | 25 | 1.00 | 1.59580 | 1.59080 | 1.60580 | |
| 108 | April 18, 2012 10:02 | l/l | 25 | 1.00 | 1.59080 | 1.59080 | 1.60580 | -500.40 | 12095.10 |
| 109 | 2012.05.02 00:00 | Sell | 26 | 1.00 | 1.62190 | 0.00000 | 0.00000 | |
| 110 | 2012.05.02 00:00 | Adjustment | 26 | 1.00 | 1.62190 | 1.62690 | 1.61190 | |
| 111 | 2012.05.02 15:42 | Adjustment | 26 | 1.00 | 1.62190 | 1.62190 | 1.61190 | |
| 112 | 2012.05.04 17:48 | Adjustment | 26 | 1.00 | 1.62190 | 1.62090 | 1.61190 | |
| 113 | 2012.05.04 23:00 | closure | 26 | 1.00 | 1.61524 | 1.62090 | 1.61190 | 651.20 | 12746.30 |
| 114 | 2012.05.08 12:00 | Sell | 27 | 1.00 | 1.61336 | 0.00000 | 0.00000 | |
| 115 | 2012.05.08 12:00 | Adjustment | 27 | 1.00 | 1.61336 | 1.61836 | 1.60336 | |
| 116 | 2012.05.09 15:20 | Adjustment | 27 | 1.00 | 1.61336 | 1.61336 | 1.60336 | |
| 117 | 2012.05.09 20:03 | l/l | 27 | 1.00 | 1.61336 | 1.61336 | 1.60336 | -3.70 | 12742.60 |
| 118 | 2012.05.11 08:00 | Sell | 28 | 1.00 | 1.61197 | 0.00000 | 0.00000 | |
| 119 | 2012.05.11 08:00 | Adjustment | 28 | 1.00 | 1.61197 | 1.61697 | 1.60197 | |
| 120 | 2012.05.11 15:45 | Adjustment | 28 | 1.00 | 1.61197 | 1.61197 | 1.60197 | |
| 121 | 2012.05.11 23:00 | closure | 28 | 1.00 | 1.60759 | 1.61197 | 1.60197 | 438.00 | 13180.60 |
author:
I designed the EA but I had help writing the code and they were excellent.
The first indicator used is called LWMA CROSSOVER SIGNAL
It basically plots 2 points on the chart, the intersection of the faster and slower LW moving averages. The first is an ARROW pointing downwards and is colored red, which obviously shows a downward trend and is the first signal of three I would like to pick up to indicate a possible SHORT TRADE .
The second point is an upward arrow, colored spring green, and is the first of three signals I want to pick to indicate a possible long trade.
When I run the EA, the variable inputs that can be changed from the LWMA indicator are:

LWMA Cross Signal Indicator
The second indicator is AMA
This indicator plots a moving average line and when the line is trending up, it plots blue dots directly on the line and when the line is trending down, it plots gold dots on the line. I use these points as a second signal to go long or short.
Once the first red arrow signal of the LWMA indicator coincides with the candle indicating the downtrend, the EA needs to look for only the second indication of the golden dot. It appears on the AMA line of the same or very next candle of the first LWMA signal on the chart. Then, once these signals appear, we can move to the last signal of the third indicator, indicating a possible short trade
Likewise, if a spring-green arrow appears on the LWMA indicator in line with a candle indicating an uptrend, and if only a blue dot appears on the AMA trendline, the situation will be reversed. The same or next candle from the first LWMA signal. We can then turn to the last signal of the third indicator, indicating a possible long trade
The AMA VARIABLE inputs that can be changed in my working EA are

The third indicator is FXBAY-MACD
This indicator is a standard MACD indicator and it also plots a histogram of the difference between the two plotted lines
Histogram points help give the third signal for a long or short trade. I would also like to use histogram signals to help exit a long or short trade.

The MACD variable to be changed in my working EA is
other variables
Stop loss points (PIPS) are the same for all trades,
Risk as a percentage of account funds.
Profit in pips on the EA.
Also, when to trade on the next opened candle or immediately after the indicator lines up
Some good variables for testing EA using 15 minute chart:
Use the M5 to H4 timeframe.
suggestion:
Attachment download
📎AMA.mq4 (3.39 KB)
📎 FX-Bay_MACD.mq4 (2.83 KB)
📎 LWMA.mq4 (5.27 KB)
📎 snowiesoEA.mq4 (40.18 KB)
Source: MQL5 #10747