Multi 10:4 Trader EA
-
nonlinear
- Trader
- Posts: 293
- Joined: Fri Jun 01, 2012 2:56 pm
- Location: Washington DC
Re: Multi 10:4 Trader EA
I have one gbpcad sell stop that triggered at 0.16 lots in a $9k account. The same account has a second pending gbpcad sell stop placed at 0.1 lots. Min lot size is 0.05.
-
MrLong
Re: Multi 10:4 Trader EA
The EA will reduce the lot size to 1% if you are within 30 pips of the MA.nonlinear wrote:I have one gbpcad sell stop that triggered at 0.16 lots in a $9k account. The same account has a second pending gbpcad sell stop placed at 0.1 lots. Min lot size is 0.05.
-
nonlinear
- Trader
- Posts: 293
- Joined: Fri Jun 01, 2012 2:56 pm
- Location: Washington DC
Re: Multi 10:4 Trader EA
The EA will reduce the lot size to 1% if you are within 30 pips of the MA.[/qMrLong wrote:nonlinear wrote:I have one gbpcad sell stop that triggered at 0.16 lots in a $9k account. The same account has a second pending gbpcad sell stop placed at 0.1 lots. Min lot size is 0.05.
I thought that too, but now that I look at it, price was much more than 30 pips past the MA when that additional 0.1 lot sell stop was placed by the EA.
-
MrLong
Re: Multi 10:4 Trader EA
//+------------------------------------------------------------------+nonlinear wrote:The EA will reduce the lot size to 1% if you are within 30 pips of the MA.[/qMrLong wrote:nonlinear wrote:I have one gbpcad sell stop that triggered at 0.16 lots in a $9k account. The same account has a second pending gbpcad sell stop placed at 0.1 lots. Min lot size is 0.05.
I thought that too, but now that I look at it, price was much more than 30 pips past the MA when that additional 0.1 lot sell stop was placed by the EA.
//| expert GetLots function
//+------------------------------------------------------------------+
double getLots(string symbol, double price1, double price2)
{
if (Lot > 0)
{
return(Lot);
}
double mA = iMA(symbol, PERIOD_H4, 240, 0, MODE_LWMA, PRICE_OPEN, 0);
double FreeMargin = AccountFreeMargin();
double TickValue = MarketInfo(symbol, MODE_TICKVALUE);
double LotStep = MarketInfo(symbol, MODE_LOTSTEP);
double point = MarketInfo(symbol, MODE_POINT);
double digits = MarketInfo(symbol, MODE_DIGITS);
double SLPts = MathAbs(price1 - price2);
SLPts /= point;
double Exposure = SLPts * TickValue;
double AllowedExposure = (FreeMargin * riskPercent) / 100;
if (reduceLotsize && MathAbs(price1 - price2) < lotBuff / PFactor(symbol))
{
AllowedExposure = (FreeMargin * reduceRiskPercent) / 100;
//TradeComment = "Reduced Lot";
}
//log(symbol,", 1 - 2",MathAbs(price1 - price2),", lotBuff , ", lotBuff /PFactor(symbol));
int TotalSteps = ((AllowedExposure / Exposure) / LotStep);
double LotSize = TotalSteps * LotStep;
double MinLots = MarketInfo(symbol, MODE_MINLOT);
double MaxLots = MarketInfo(symbol, MODE_MAXLOT);
if (LotSize < MinLots)
LotSize = MinLots;
if (LotSize > MaxLots)
LotSize = MaxLots;
return(LotSize);
}
Maybe the min lot size is not 0.5, the EA should default to the crims minimum lot size.
-
6y588
Re: Multi 10:4 Trader EA
Backtested GbpUsd, M5, Every Tick, 1Jun07 -10May13
-------------------------------------------------------
Bars in test 442660
Ticks modelled 110204294
Modelling quality 90%
Mismatched charts errors 0
Initial deposit 10000.00
Total trades 0
Ran a backtest with OOTB settings and ZERO (0) trades???!
As a comparison, I backtested another EA with the same data as above and in the first month only there were 250 trades.
Either (a) the OOTB settings are incorrect for testing, OR (b) there are some code in the EA that prevents the tester from working. Any feedback here would be appreciated?
I would post the StrategyTester results if I could get it to trade ... Grrrr....
-------------------------------------------------------
Bars in test 442660
Ticks modelled 110204294
Modelling quality 90%
Mismatched charts errors 0
Initial deposit 10000.00
Total trades 0
Ran a backtest with OOTB settings and ZERO (0) trades???!
As a comparison, I backtested another EA with the same data as above and in the first month only there were 250 trades.
Either (a) the OOTB settings are incorrect for testing, OR (b) there are some code in the EA that prevents the tester from working. Any feedback here would be appreciated?
I would post the StrategyTester results if I could get it to trade ... Grrrr....
-
nonlinear
- Trader
- Posts: 293
- Joined: Fri Jun 01, 2012 2:56 pm
- Location: Washington DC
Re: Multi 10:4 Trader EA
MrLong wrote://+------------------------------------------------------------------+nonlinear wrote:The EA will reduce the lot size to 1% if you are within 30 pips of the MA.[/qMrLong wrote:nonlinear wrote:I have one gbpcad sell stop that triggered at 0.16 lots in a $9k account. The same account has a second pending gbpcad sell stop placed at 0.1 lots. Min lot size is 0.05.
I thought that too, but now that I look at it, price was much more than 30 pips past the MA when that additional 0.1 lot sell stop was placed by the EA.
//| expert GetLots function
//+------------------------------------------------------------------+
double getLots(string symbol, double price1, double price2)
{
if (Lot > 0)
{
return(Lot);
}
double mA = iMA(symbol, PERIOD_H4, 240, 0, MODE_LWMA, PRICE_OPEN, 0);
double FreeMargin = AccountFreeMargin();
double TickValue = MarketInfo(symbol, MODE_TICKVALUE);
double LotStep = MarketInfo(symbol, MODE_LOTSTEP);
double point = MarketInfo(symbol, MODE_POINT);
double digits = MarketInfo(symbol, MODE_DIGITS);
double SLPts = MathAbs(price1 - price2);
SLPts /= point;
double Exposure = SLPts * TickValue;
double AllowedExposure = (FreeMargin * riskPercent) / 100;
if (reduceLotsize && MathAbs(price1 - price2) < lotBuff / PFactor(symbol))
{
AllowedExposure = (FreeMargin * reduceRiskPercent) / 100;
//TradeComment = "Reduced Lot";
}
//log(symbol,", 1 - 2",MathAbs(price1 - price2),", lotBuff , ", lotBuff /PFactor(symbol));
int TotalSteps = ((AllowedExposure / Exposure) / LotStep);
double LotSize = TotalSteps * LotStep;
double MinLots = MarketInfo(symbol, MODE_MINLOT);
double MaxLots = MarketInfo(symbol, MODE_MAXLOT);
if (LotSize < MinLots)
LotSize = MinLots;
if (LotSize > MaxLots)
LotSize = MaxLots;
return(LotSize);
}
Maybe the min lot size is not 0.5, the EA should default to the crims minimum lot size.
I just placed a manual order at .05 lots to test it. Minimum lot size is 0.05, at least manually on Empty4.
- snailbeard
- Trader
- Posts: 615
- Joined: Mon Dec 24, 2012 10:54 am
- Location: Just above water somewhere between Oxford & Cambridge
Re: Multi 10:4 Trader EA
Going back to the earlier GU BT results we can see that most lot sizes are normal sizes but one is oversized:
see sell stop 7
1 2013.02.01 00:00 sell stop 1 0.16 1.58578 1.59761 1.57102 0.00 10000.00
2 2013.02.01 00:20 sell stop 2 0.13 1.58258 1.59761 1.57102 0.00 10000.00
3 2013.02.01 04:10 sell 1 0.16 1.58578 1.59761 1.57102 0.00 10000.00
4 2013.02.01 10:00 sell 2 0.13 1.58258 1.59761 1.57102 0.00 10000.00
5 2013.02.01 19:50 t/p 1 0.16 1.57102 1.59761 1.57102 235.04 10235.04
6 2013.02.01 19:50 t/p 2 0.13 1.57102 1.59761 1.57102 149.37 10384.41
7 2013.02.08 11:00 sell stop 3 0.14 1.57476 1.58912 1.56248 0.00 10384.41
8 2013.02.08 11:05 sell 3 0.14 1.57476 1.58912 1.56248 0.00 10384.41
9 2013.02.08 11:05 close 3 0.14 1.57436 1.58912 1.56248 4.62 10389.03
10 2013.02.10 22:00 sell stop 4 0.15 1.57538 1.58846 1.56713 0.00 10389.03
11 2013.02.11 08:35 sell 4 0.15 1.57538 1.58846 1.56713 0.00 10389.03
12 2013.02.11 13:40 t/p 4 0.15 1.56713 1.58846 1.56713 122.70 10511.73
13 2013.03.15 07:15 sell stop 5 0.17 1.51049 1.52259 1.47949 0.00 10511.73
14 2013.03.15 18:00 delete 5 0.17 1.51049 1.52259 1.47949 0.00 10511.73
15 2013.03.21 08:25 sell stop 6 0.15 1.50326 1.51695 1.48968 0.00 10511.73
16 2013.03.21 09:30 sell stop 7 0.61 1.51355 1.51695 1.48968 0.00 10511.73
17 2013.03.21 09:35 delete 7 0.61 1.51355 1.51695 1.48968 0.00 10511.73
18 2013.03.21 09:35 delete 6 0.15 1.50326 1.51695 1.48968 0.00 10511.73
19 2013.04.15 18:30 buy stop 8 0.18 1.52994 1.51850 1.54300 0.00 10511.73
20 2013.04.15 21:10 buy stop 9 0.13 1.53380 1.51862 1.54300 0.00 10511.73
21 2013.04.15 23:05 buy 8 0.18 1.52994 1.51850 1.54300 0.00 10511.73
22 2013.04.15 23:05 close 8 0.18 1.52981 1.51850 1.54300 -3.60 10508.13
23 2013.04.16 01:10 buy stop 10 0.18 1.52994 1.51874 1.54300 0.00 10508.13
24 2013.04.16 03:55 buy 10 0.18 1.52994 1.51874 1.54300 0.00 10508.13
25 2013.04.16 16:15 buy 9 0.13 1.53380 1.51862 1.54300 0.00 10508.13
26 2013.04.16 21:10 close 10 0.18 1.53593 1.51874 1.54300 106.56 10614.69
27 2013.04.16 21:10 close 9 0.13 1.53593 1.51862 1.54300 26.78 10641.47
28 2013.05.07 14:45 buy stop 11 0.15 1.54969 1.53579 1.56316 0.00 10641.47
29 2013.05.08 09:55 buy 11 0.15 1.54969 1.53579 1.56316 0.00 10641.47
30 2013.05.08 17:40 close 11 0.15 1.55477 1.53579 1.56316 75.15 10716.62
see sell stop 7
1 2013.02.01 00:00 sell stop 1 0.16 1.58578 1.59761 1.57102 0.00 10000.00
2 2013.02.01 00:20 sell stop 2 0.13 1.58258 1.59761 1.57102 0.00 10000.00
3 2013.02.01 04:10 sell 1 0.16 1.58578 1.59761 1.57102 0.00 10000.00
4 2013.02.01 10:00 sell 2 0.13 1.58258 1.59761 1.57102 0.00 10000.00
5 2013.02.01 19:50 t/p 1 0.16 1.57102 1.59761 1.57102 235.04 10235.04
6 2013.02.01 19:50 t/p 2 0.13 1.57102 1.59761 1.57102 149.37 10384.41
7 2013.02.08 11:00 sell stop 3 0.14 1.57476 1.58912 1.56248 0.00 10384.41
8 2013.02.08 11:05 sell 3 0.14 1.57476 1.58912 1.56248 0.00 10384.41
9 2013.02.08 11:05 close 3 0.14 1.57436 1.58912 1.56248 4.62 10389.03
10 2013.02.10 22:00 sell stop 4 0.15 1.57538 1.58846 1.56713 0.00 10389.03
11 2013.02.11 08:35 sell 4 0.15 1.57538 1.58846 1.56713 0.00 10389.03
12 2013.02.11 13:40 t/p 4 0.15 1.56713 1.58846 1.56713 122.70 10511.73
13 2013.03.15 07:15 sell stop 5 0.17 1.51049 1.52259 1.47949 0.00 10511.73
14 2013.03.15 18:00 delete 5 0.17 1.51049 1.52259 1.47949 0.00 10511.73
15 2013.03.21 08:25 sell stop 6 0.15 1.50326 1.51695 1.48968 0.00 10511.73
16 2013.03.21 09:30 sell stop 7 0.61 1.51355 1.51695 1.48968 0.00 10511.73
17 2013.03.21 09:35 delete 7 0.61 1.51355 1.51695 1.48968 0.00 10511.73
18 2013.03.21 09:35 delete 6 0.15 1.50326 1.51695 1.48968 0.00 10511.73
19 2013.04.15 18:30 buy stop 8 0.18 1.52994 1.51850 1.54300 0.00 10511.73
20 2013.04.15 21:10 buy stop 9 0.13 1.53380 1.51862 1.54300 0.00 10511.73
21 2013.04.15 23:05 buy 8 0.18 1.52994 1.51850 1.54300 0.00 10511.73
22 2013.04.15 23:05 close 8 0.18 1.52981 1.51850 1.54300 -3.60 10508.13
23 2013.04.16 01:10 buy stop 10 0.18 1.52994 1.51874 1.54300 0.00 10508.13
24 2013.04.16 03:55 buy 10 0.18 1.52994 1.51874 1.54300 0.00 10508.13
25 2013.04.16 16:15 buy 9 0.13 1.53380 1.51862 1.54300 0.00 10508.13
26 2013.04.16 21:10 close 10 0.18 1.53593 1.51874 1.54300 106.56 10614.69
27 2013.04.16 21:10 close 9 0.13 1.53593 1.51862 1.54300 26.78 10641.47
28 2013.05.07 14:45 buy stop 11 0.15 1.54969 1.53579 1.56316 0.00 10641.47
29 2013.05.08 09:55 buy 11 0.15 1.54969 1.53579 1.56316 0.00 10641.47
30 2013.05.08 17:40 close 11 0.15 1.55477 1.53579 1.56316 75.15 10716.62
- snailbeard
- Trader
- Posts: 615
- Joined: Mon Dec 24, 2012 10:54 am
- Location: Just above water somewhere between Oxford & Cambridge
GBPCAD BT results
GBPCAD BT with some oversized lot sizes
NOTE: Crappy data from our brokers can result in EA's doing bizarre and dangerous things:
Which is a strong argument for back testing with crappy data:
Alpari UK BT
There is a warning about crappy data:
TestGenerator: unmatched data error (volume limit 383 at 2013.04.30 15:10 exceeded)
1 2013.04.29 19:23 buy stop 1 0.85 1.57196 1.55669 1.58316 0.00 10000.00
2 2013.04.29 20:00 buy stop 2 0.62 1.57786 1.55684 1.58316 0.00 10000.00
3 2013.05.01 16:12 buy 1 0.85 1.57196 1.55669 1.58316 0.00 10000.00
4 2013.05.03 18:00 delete 2 0.62 1.57786 1.55684 1.58316 0.00 10000.00
5 2013.05.07 17:08 s/l 1 0.85 1.55669 1.55669 1.58316 -200.18 9799.82
6 2013.05.15 12:00 sell stop 3 1.19 1.54942 1.56014 1.54294 0.00 9799.82
7 2013.05.15 17:58 sell 3 1.19 1.54942 1.56014 1.54294 0.00 9799.82
8 2013.05.16 12:14 sell stop 4 0.73 1.54234 1.55971 1.53868 0.00 9799.82
9 2013.05.16 23:59 close at stop 3 1.19 1.55677 1.56014 1.54294 -132.61 9667.22
Global Prime BT
More warnings about crappy data:
2013.05.17 06:00:05 TestGenerator: unmatched data error (high value 1.55442 at 2013.05.13 04:40 is not reached from the least timeframe, high price 1.55426 mismatches)
2013.05.17 06:00:05 TestGenerator: unmatched data error (high value 1.55442 at 2013.05.13 04:40 is not reached from the least timeframe, high price 1.55426 mismatches)
2013.05.17 06:00:05 TestGenerator: unmatched data error (high value 1.56886 at 2013.05.01 23:10 is not reached from the least timeframe, high price 1.56866 mismatches)
1 2013.04.18 08:38 buy stop 1 0.21 1.56452 1.55024 1.56702 0.00 10000.00
2 2013.04.18 12:22 buy 1 0.21 1.56452 1.55024 1.56702 0.00 10000.00
3 2013.04.18 12:43 t/p 1 0.21 1.56702 1.55024 1.56702 32.03 10032.03
4 2013.04.22 06:53 buy stop 2 0.23 1.56507 1.55190 1.57201 0.00 10032.03
5 2013.04.22 13:12 buy 2 0.23 1.56507 1.55190 1.57201 0.00 10032.03
6 2013.04.25 08:32 t/p 2 0.23 1.57201 1.55190 1.57201 96.11 10128.14
7 2013.04.29 16:02 buy stop 3 0.20 1.57261 1.55738 1.58447 0.00 10128.14
8 2013.04.29 18:59 buy stop 4 0.30 1.56756 1.55738 1.58447 0.00 10128.14
9 2013.04.29 19:46 buy 4 0.30 1.56756 1.55738 1.58447 0.00 10128.14
10 2013.05.01 14:08 buy 3 0.20 1.57261 1.55738 1.58447 0.00 10128.14
11 2013.05.03 07:08 close 4 0.30 1.57349 1.55738 1.58447 104.99 10233.13
12 2013.05.03 07:08 close 3 0.20 1.57349 1.55738 1.58447 7.14 10240.27
13 2013.05.06 15:49 buy stop 5 0.34 1.57037 1.56107 1.57770 0.00 10240.27
14 2013.05.06 16:17 buy stop 6 0.57 1.56671 1.56115 1.57770 0.00 10240.27
15 2013.05.07 10:22 delete 6 0.57 1.56671 1.56115 1.57770 0.00 10240.27
16 2013.05.07 10:22 delete 5 0.34 1.57037 1.56107 1.57770 0.00 10240.27
17 2013.05.07 12:00 buy stop 7 0.61 1.56671 1.56150 1.57770 0.00 10240.27
18 2013.05.07 12:01 delete 7 0.61 1.56671 1.56150 1.57770 0.00 10240.27
19 2013.05.15 04:00 sell stop 8 0.31 1.55044 1.56050 1.54408 0.00 10240.27
20 2013.05.15 04:01 sell stop 9 0.18 1.54358 1.56050 1.53961 0.00 10240.27
21 2013.05.15 05:43 sell 8 0.31 1.55044 1.56050 1.54408 0.00 10240.27
22 2013.05.16 23:59 close at stop 8 0.31 1.55629 1.56050 1.54408 -118.58 10121.69
NOTE: Crappy data from our brokers can result in EA's doing bizarre and dangerous things:
Which is a strong argument for back testing with crappy data:
Alpari UK BT
There is a warning about crappy data:
TestGenerator: unmatched data error (volume limit 383 at 2013.04.30 15:10 exceeded)
1 2013.04.29 19:23 buy stop 1 0.85 1.57196 1.55669 1.58316 0.00 10000.00
2 2013.04.29 20:00 buy stop 2 0.62 1.57786 1.55684 1.58316 0.00 10000.00
3 2013.05.01 16:12 buy 1 0.85 1.57196 1.55669 1.58316 0.00 10000.00
4 2013.05.03 18:00 delete 2 0.62 1.57786 1.55684 1.58316 0.00 10000.00
5 2013.05.07 17:08 s/l 1 0.85 1.55669 1.55669 1.58316 -200.18 9799.82
6 2013.05.15 12:00 sell stop 3 1.19 1.54942 1.56014 1.54294 0.00 9799.82
7 2013.05.15 17:58 sell 3 1.19 1.54942 1.56014 1.54294 0.00 9799.82
8 2013.05.16 12:14 sell stop 4 0.73 1.54234 1.55971 1.53868 0.00 9799.82
9 2013.05.16 23:59 close at stop 3 1.19 1.55677 1.56014 1.54294 -132.61 9667.22
Global Prime BT
More warnings about crappy data:
2013.05.17 06:00:05 TestGenerator: unmatched data error (high value 1.55442 at 2013.05.13 04:40 is not reached from the least timeframe, high price 1.55426 mismatches)
2013.05.17 06:00:05 TestGenerator: unmatched data error (high value 1.55442 at 2013.05.13 04:40 is not reached from the least timeframe, high price 1.55426 mismatches)
2013.05.17 06:00:05 TestGenerator: unmatched data error (high value 1.56886 at 2013.05.01 23:10 is not reached from the least timeframe, high price 1.56866 mismatches)
1 2013.04.18 08:38 buy stop 1 0.21 1.56452 1.55024 1.56702 0.00 10000.00
2 2013.04.18 12:22 buy 1 0.21 1.56452 1.55024 1.56702 0.00 10000.00
3 2013.04.18 12:43 t/p 1 0.21 1.56702 1.55024 1.56702 32.03 10032.03
4 2013.04.22 06:53 buy stop 2 0.23 1.56507 1.55190 1.57201 0.00 10032.03
5 2013.04.22 13:12 buy 2 0.23 1.56507 1.55190 1.57201 0.00 10032.03
6 2013.04.25 08:32 t/p 2 0.23 1.57201 1.55190 1.57201 96.11 10128.14
7 2013.04.29 16:02 buy stop 3 0.20 1.57261 1.55738 1.58447 0.00 10128.14
8 2013.04.29 18:59 buy stop 4 0.30 1.56756 1.55738 1.58447 0.00 10128.14
9 2013.04.29 19:46 buy 4 0.30 1.56756 1.55738 1.58447 0.00 10128.14
10 2013.05.01 14:08 buy 3 0.20 1.57261 1.55738 1.58447 0.00 10128.14
11 2013.05.03 07:08 close 4 0.30 1.57349 1.55738 1.58447 104.99 10233.13
12 2013.05.03 07:08 close 3 0.20 1.57349 1.55738 1.58447 7.14 10240.27
13 2013.05.06 15:49 buy stop 5 0.34 1.57037 1.56107 1.57770 0.00 10240.27
14 2013.05.06 16:17 buy stop 6 0.57 1.56671 1.56115 1.57770 0.00 10240.27
15 2013.05.07 10:22 delete 6 0.57 1.56671 1.56115 1.57770 0.00 10240.27
16 2013.05.07 10:22 delete 5 0.34 1.57037 1.56107 1.57770 0.00 10240.27
17 2013.05.07 12:00 buy stop 7 0.61 1.56671 1.56150 1.57770 0.00 10240.27
18 2013.05.07 12:01 delete 7 0.61 1.56671 1.56150 1.57770 0.00 10240.27
19 2013.05.15 04:00 sell stop 8 0.31 1.55044 1.56050 1.54408 0.00 10240.27
20 2013.05.15 04:01 sell stop 9 0.18 1.54358 1.56050 1.53961 0.00 10240.27
21 2013.05.15 05:43 sell 8 0.31 1.55044 1.56050 1.54408 0.00 10240.27
22 2013.05.16 23:59 close at stop 8 0.31 1.55629 1.56050 1.54408 -118.58 10121.69
- snailbeard
- Trader
- Posts: 615
- Joined: Mon Dec 24, 2012 10:54 am
- Location: Just above water somewhere between Oxford & Cambridge
bad lotsize work around
I have added a work around for the oversized lotsize, which allows the user to set a maximum lotsize trap,
if the lotsize is >= to this then the lotsize is reset to the minimum lot size.
It is not a very satisfactory approach to have a fixed maximum for all pairs.
This is the quick fix work around, but the question arises should the pair be disabled until the data can be trusted? How do we know we are processing faulty data?
Does bad data affect the calculation of WP, MA, RSI etc?
Latest results:
1 2013.04.18 08:45 buy stop 1 0.21 1.56452 1.55024 1.56702 0.00 10000.00
2 2013.04.18 12:25 buy 1 0.21 1.56452 1.55024 1.56702 0.00 10000.00
3 2013.04.18 12:45 t/p 1 0.21 1.56702 1.55024 1.56702 32.03 10032.03
4 2013.04.22 06:55 buy stop 2 0.23 1.56507 1.55190 1.57201 0.00 10032.03
5 2013.04.22 13:15 buy 2 0.23 1.56507 1.55190 1.57201 0.00 10032.03
6 2013.04.25 08:35 t/p 2 0.23 1.57201 1.55190 1.57201 95.85 10127.88
7 2013.04.29 16:05 buy stop 3 0.20 1.57261 1.55738 1.58447 0.00 10127.88
8 2013.04.29 19:00 buy stop 4 0.31 1.56756 1.55738 1.58447 0.00 10127.88
9 2013.04.29 19:50 buy 4 0.31 1.56756 1.55738 1.58447 0.00 10127.88
10 2013.05.03 06:30 buy 3 0.20 1.57261 1.55738 1.58447 0.00 10127.88
11 2013.05.03 07:15 close 4 0.31 1.57244 1.55738 1.58447 87.87 10215.75
12 2013.05.03 07:15 close 3 0.20 1.57244 1.55738 1.58447 -3.56 10212.19
13 2013.05.06 15:50 buy stop 5 0.34 1.57037 1.56107 1.57770 0.00 10212.19
Reset to min lot size ->
14 2013.05.06 19:10 buy stop 6 0.01 1.56671 1.56115 1.57770 0.00 10212.19
15 2013.05.07 10:25 delete 6 0.01 1.56671 1.56115 1.57770 0.00 10212.19
16 2013.05.07 10:25 delete 5 0.34 1.57037 1.56107 1.57770 0.00 10212.19
Reset to min lot size ->
17 2013.05.07 12:00 buy stop 7 0.01 1.56671 1.56150 1.57770 0.00 10212.19
18 2013.05.07 12:05 delete 7 0.01 1.56671 1.56150 1.57770 0.00 10212.19
19 2013.05.15 04:00 sell stop 8 0.31 1.55044 1.56050 1.54408 0.00 10212.19
20 2013.05.15 04:05 sell stop 9 0.18 1.54358 1.56050 1.53961 0.00 10212.19
21 2013.05.15 05:45 sell 8 0.31 1.55044 1.56050 1.54408 0.00 10212.19
22 2013.05.16 23:59 close at stop 8 0.31 1.55616 1.56050 1.54408 -116.00 10096.19
Changes:
Find:
extern double Lot = 0.00;
extern double riskPercent = 2.00; // Max risk per trade
Add:
extern double lotAlertSize = 0.50; // Trap an attempt to use an oversized lot size
Find:
if (LotSize > MaxLots)
LotSize = MaxLots;
Add:
if(LotSize >= lotAlertSize )
{
string strReport = "Calculated size: " + DoubleToStr( LotSize, 2) + ", lotAlertSize: " + DoubleToStr( lotAlertSize, 2) + ", Reset to Min: " + DoubleToStr( MinLots, 2) ;
LotSize = MinLots;
Alert("getLots() gave a lot size larger than lotAlertSize: " + strReport);
}
if the lotsize is >= to this then the lotsize is reset to the minimum lot size.
It is not a very satisfactory approach to have a fixed maximum for all pairs.
This is the quick fix work around, but the question arises should the pair be disabled until the data can be trusted? How do we know we are processing faulty data?
Does bad data affect the calculation of WP, MA, RSI etc?
Latest results:
1 2013.04.18 08:45 buy stop 1 0.21 1.56452 1.55024 1.56702 0.00 10000.00
2 2013.04.18 12:25 buy 1 0.21 1.56452 1.55024 1.56702 0.00 10000.00
3 2013.04.18 12:45 t/p 1 0.21 1.56702 1.55024 1.56702 32.03 10032.03
4 2013.04.22 06:55 buy stop 2 0.23 1.56507 1.55190 1.57201 0.00 10032.03
5 2013.04.22 13:15 buy 2 0.23 1.56507 1.55190 1.57201 0.00 10032.03
6 2013.04.25 08:35 t/p 2 0.23 1.57201 1.55190 1.57201 95.85 10127.88
7 2013.04.29 16:05 buy stop 3 0.20 1.57261 1.55738 1.58447 0.00 10127.88
8 2013.04.29 19:00 buy stop 4 0.31 1.56756 1.55738 1.58447 0.00 10127.88
9 2013.04.29 19:50 buy 4 0.31 1.56756 1.55738 1.58447 0.00 10127.88
10 2013.05.03 06:30 buy 3 0.20 1.57261 1.55738 1.58447 0.00 10127.88
11 2013.05.03 07:15 close 4 0.31 1.57244 1.55738 1.58447 87.87 10215.75
12 2013.05.03 07:15 close 3 0.20 1.57244 1.55738 1.58447 -3.56 10212.19
13 2013.05.06 15:50 buy stop 5 0.34 1.57037 1.56107 1.57770 0.00 10212.19
Reset to min lot size ->
14 2013.05.06 19:10 buy stop 6 0.01 1.56671 1.56115 1.57770 0.00 10212.19
15 2013.05.07 10:25 delete 6 0.01 1.56671 1.56115 1.57770 0.00 10212.19
16 2013.05.07 10:25 delete 5 0.34 1.57037 1.56107 1.57770 0.00 10212.19
Reset to min lot size ->
17 2013.05.07 12:00 buy stop 7 0.01 1.56671 1.56150 1.57770 0.00 10212.19
18 2013.05.07 12:05 delete 7 0.01 1.56671 1.56150 1.57770 0.00 10212.19
19 2013.05.15 04:00 sell stop 8 0.31 1.55044 1.56050 1.54408 0.00 10212.19
20 2013.05.15 04:05 sell stop 9 0.18 1.54358 1.56050 1.53961 0.00 10212.19
21 2013.05.15 05:45 sell 8 0.31 1.55044 1.56050 1.54408 0.00 10212.19
22 2013.05.16 23:59 close at stop 8 0.31 1.55616 1.56050 1.54408 -116.00 10096.19
Changes:
Find:
extern double Lot = 0.00;
extern double riskPercent = 2.00; // Max risk per trade
Add:
extern double lotAlertSize = 0.50; // Trap an attempt to use an oversized lot size
Find:
if (LotSize > MaxLots)
LotSize = MaxLots;
Add:
if(LotSize >= lotAlertSize )
{
string strReport = "Calculated size: " + DoubleToStr( LotSize, 2) + ", lotAlertSize: " + DoubleToStr( lotAlertSize, 2) + ", Reset to Min: " + DoubleToStr( MinLots, 2) ;
LotSize = MinLots;
Alert("getLots() gave a lot size larger than lotAlertSize: " + strReport);
}
-
MrLong
Re: GBPCAD BT results
Hi Brian,snailbeard wrote:GBPCAD BT with some oversized lot sizes
NOTE: Crappy data from our brokers can result in EA's doing bizarre and dangerous things:
Which is a strong argument for back testing with crappy data:
Alpari UK BT
There is a warning about crappy data:
TestGenerator: unmatched data error (volume limit 383 at 2013.04.30 15:10 exceeded)
1 2013.04.29 19:23 buy stop 1 0.85 1.57196 1.55669 1.58316 0.00 10000.00
2 2013.04.29 20:00 buy stop 2 0.62 1.57786 1.55684 1.58316 0.00 10000.00
3 2013.05.01 16:12 buy 1 0.85 1.57196 1.55669 1.58316 0.00 10000.00
4 2013.05.03 18:00 delete 2 0.62 1.57786 1.55684 1.58316 0.00 10000.00
5 2013.05.07 17:08 s/l 1 0.85 1.55669 1.55669 1.58316 -200.18 9799.82
6 2013.05.15 12:00 sell stop 3 1.19 1.54942 1.56014 1.54294 0.00 9799.82
7 2013.05.15 17:58 sell 3 1.19 1.54942 1.56014 1.54294 0.00 9799.82
8 2013.05.16 12:14 sell stop 4 0.73 1.54234 1.55971 1.53868 0.00 9799.82
9 2013.05.16 23:59 close at stop 3 1.19 1.55677 1.56014 1.54294 -132.61 9667.22
Global Prime BT
More warnings about crappy data:
2013.05.17 06:00:05 TestGenerator: unmatched data error (high value 1.55442 at 2013.05.13 04:40 is not reached from the least timeframe, high price 1.55426 mismatches)
2013.05.17 06:00:05 TestGenerator: unmatched data error (high value 1.55442 at 2013.05.13 04:40 is not reached from the least timeframe, high price 1.55426 mismatches)
2013.05.17 06:00:05 TestGenerator: unmatched data error (high value 1.56886 at 2013.05.01 23:10 is not reached from the least timeframe, high price 1.56866 mismatches)
1 2013.04.18 08:38 buy stop 1 0.21 1.56452 1.55024 1.56702 0.00 10000.00
2 2013.04.18 12:22 buy 1 0.21 1.56452 1.55024 1.56702 0.00 10000.00
3 2013.04.18 12:43 t/p 1 0.21 1.56702 1.55024 1.56702 32.03 10032.03
4 2013.04.22 06:53 buy stop 2 0.23 1.56507 1.55190 1.57201 0.00 10032.03
5 2013.04.22 13:12 buy 2 0.23 1.56507 1.55190 1.57201 0.00 10032.03
6 2013.04.25 08:32 t/p 2 0.23 1.57201 1.55190 1.57201 96.11 10128.14
7 2013.04.29 16:02 buy stop 3 0.20 1.57261 1.55738 1.58447 0.00 10128.14
8 2013.04.29 18:59 buy stop 4 0.30 1.56756 1.55738 1.58447 0.00 10128.14
9 2013.04.29 19:46 buy 4 0.30 1.56756 1.55738 1.58447 0.00 10128.14
10 2013.05.01 14:08 buy 3 0.20 1.57261 1.55738 1.58447 0.00 10128.14
11 2013.05.03 07:08 close 4 0.30 1.57349 1.55738 1.58447 104.99 10233.13
12 2013.05.03 07:08 close 3 0.20 1.57349 1.55738 1.58447 7.14 10240.27
13 2013.05.06 15:49 buy stop 5 0.34 1.57037 1.56107 1.57770 0.00 10240.27
14 2013.05.06 16:17 buy stop 6 0.57 1.56671 1.56115 1.57770 0.00 10240.27
15 2013.05.07 10:22 delete 6 0.57 1.56671 1.56115 1.57770 0.00 10240.27
16 2013.05.07 10:22 delete 5 0.34 1.57037 1.56107 1.57770 0.00 10240.27
17 2013.05.07 12:00 buy stop 7 0.61 1.56671 1.56150 1.57770 0.00 10240.27
18 2013.05.07 12:01 delete 7 0.61 1.56671 1.56150 1.57770 0.00 10240.27
19 2013.05.15 04:00 sell stop 8 0.31 1.55044 1.56050 1.54408 0.00 10240.27
20 2013.05.15 04:01 sell stop 9 0.18 1.54358 1.56050 1.53961 0.00 10240.27
21 2013.05.15 05:43 sell 8 0.31 1.55044 1.56050 1.54408 0.00 10240.27
22 2013.05.16 23:59 close at stop 8 0.31 1.55629 1.56050 1.54408 -118.58 10121.69
Data from broker to broker is never the same, you will find moving averages in different places from broker to broker, live data is not always the same as demo data, therefore you may get stopped out from one broker but not the other, same with pivots, they are all calculated from different candles.
Hit the Ctrl + D key and compare the prices of MA,s, it's hard enough trading but when we have the goal posts moved from time to time, that makes it even harder.
Regards
Andy