Watch how to download trading robots for free
Find us on Facebook!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Experts

Simplest Hedging EA ever - expert for MetaTrader 4

Views:
63359
Rating:
(26)
Published:
2010.04.06 16:32
Updated:
2014.04.21 14:54
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

This EA comprises only 20 lines of code, and does all its trading in two lines! if there is a simpler EA out there I would love to see it!

The EA doesn't use any indicators. Instead, it simply and blindly opens two opposing positions at the beginning of the first new bar it comes across. It waits until both positions have closed by hitting their stop-losses or take-profit levels, and then opens the next pair of positions.

After optimisation manually select the best result where the stop-loss is lower than take-profit level, in which case each pair of trades will have one of the following outcomes.

  • Both positions win (hurrah!)
  • One wins and one loses (in which case the winner covers the losses of the loser)
  • Both lose (oh no!)

It is OK to optimise the EA using "Open prices only", because it only trades at the opening of a new bar.

In my experiments, EURGBP 5M provides the best results, although positive results are also available from EURUSD, GBPUSD, EURCHF and probably others.

Please feel free to improve the code to your heart's content!




SymbolEURGBP (Euro vs Great Britain Pound )
Period5 Minutes (M5) 2009.10.01 00:00 - 2010.01.31 23:55 (2009.10.01 - 2010.02.01)
ModelEvery tick (the most precise method based on all available least timeframes)
Parameterslots=1; stop_loss=76; take_profit=750;

Bars in test25154Ticks modelled3758809Modelling quality90.00%
Mismatched charts errors0




Initial deposit10000.00



Total net profit7842.50Gross profit27413.50Gross loss-19571.00
Profit factor1.40Expected payoff76.89

Absolute drawdown792.50Maximal drawdown3539.00 (23.17%)Relative drawdown23.17% (3539.00)

Total trades102Short positions (won %)51 (56.86%)Long positions (won %)51 (19.61%)

Profit trades (% of total)39 (38.24%)Loss trades (% of total)63 (61.76%)
Largestprofit trade727.00loss trade-750.00
Averageprofit trade702.91loss trade-310.65
Maximumconsecutive wins (profit in money)1 (727.00)consecutive losses (loss in money)7 (-2543.50)
Maximalconsecutive profit (count of wins)727.00 (1)consecutive loss (count of losses)-2543.50 (7)
Averageconsecutive wins1consecutive losses2

#TimeTypeOrderSizePriceS / LT / PProfitBalance
12009.10.01 00:00buy11.000.915980.915220.92317
22009.10.01 00:00sell21.000.915670.923170.90848
32009.10.01 05:46s/l11.000.915220.915220.92317-76.009924.00
42009.10.01 14:35t/p21.000.908480.923170.90848719.0010643.00
52009.10.01 14:40buy31.000.909560.908800.91675
62009.10.01 14:40sell41.000.909250.916750.90206
72009.10.02 10:38s/l41.000.916750.916750.90206-749.009894.00
82009.10.02 10:38t/p31.000.916750.908800.91675717.5010611.50
92009.10.02 10:40buy51.000.917170.916410.92436
102009.10.02 10:40sell61.000.916860.924360.90967
112009.10.02 11:10s/l51.000.916410.916410.92436-76.0010535.50
122009.10.06 09:22s/l61.000.924360.924360.90967-748.009787.50
132009.10.06 09:25buy71.000.924550.923790.93174
142009.10.06 09:25sell81.000.924240.931740.91705
152009.10.06 09:31s/l71.000.923790.923790.93174-76.009711.50
162009.10.08 13:30t/p81.000.917050.931740.91705723.0010434.50
172009.10.08 13:35buy91.000.917030.916270.92422
182009.10.08 13:35sell101.000.916720.924220.90953
192009.10.09 09:30s/l101.000.924220.924220.90953-749.009685.50
202009.10.09 09:41t/p91.000.924220.916270.92422717.5010403.00
212009.10.09 09:45buy111.000.924430.923670.93162
222009.10.09 09:45sell121.000.924120.931620.91693
232009.10.09 09:48s/l111.000.923670.923670.93162-76.0010327.00
242009.10.12 07:12s/l121.000.931620.931620.91693-749.009578.00
252009.10.12 07:15buy131.000.931740.930980.93893
262009.10.12 07:15sell141.000.931430.938930.92424
272009.10.13 06:35s/l141.000.938930.938930.92424-749.008829.00
282009.10.13 08:25t/p131.000.938930.930980.93893717.509546.50
292009.10.13 08:30buy151.000.939080.938320.94627
302009.10.13 08:30sell161.000.938770.946270.93158
312009.10.13 09:39s/l151.000.938320.938320.94627-76.009470.50
322009.10.14 06:21t/p161.000.931580.946270.93158720.0010190.50
332009.10.14 06:25buy171.000.931860.931100.93905
342009.10.14 06:25sell181.000.931550.939050.92436
352009.10.14 08:32s/l171.000.931100.931100.93905-76.0010114.50
362009.10.15 07:55t/p181.000.924360.939050.92436722.0010836.50
372009.10.15 08:00buy191.000.924230.923470.93142
382009.10.15 08:00sell201.000.923920.931420.91673
392009.10.15 08:04s/l191.000.923470.923470.93142-76.0010760.50
402009.10.15 11:05t/p201.000.916730.931420.91673719.0011479.50
412009.10.15 11:10buy211.000.915790.915030.92298
422009.10.15 11:10sell221.000.915480.922980.90829
432009.10.15 11:38s/l211.000.915030.915030.92298-76.0011403.50
442009.10.20 14:04t/p221.000.908290.922980.90829722.0012125.50
452009.10.20 14:05buy231.000.907990.907230.91518
462009.10.20 14:05sell241.000.907680.915180.90049
472009.10.20 14:06s/l231.000.907230.907230.91518-76.0012049.50
482009.10.21 11:43t/p241.000.900490.915180.90049720.0012769.50
492009.10.21 11:45buy251.000.900290.899530.90748
502009.10.21 11:45sell261.000.899980.907480.89279
512009.10.23 09:30s/l261.000.907480.907480.89279-746.0012023.50
522009.10.23 09:30t/p251.000.907480.899530.90748713.0012736.50
532009.10.23 09:35buy271.000.910040.909280.91723
542009.10.23 09:35sell281.000.909730.917230.90254
552009.10.23 10:38s/l281.000.917230.917230.90254-750.0011986.50
562009.10.23 10:39t/p271.000.917230.909280.91723719.0012705.50
572009.10.23 10:40buy291.000.917780.917020.92497
582009.10.23 10:40sell301.000.917470.924970.91028
592009.10.23 10:41s/l291.000.917020.917020.92497-76.0012629.50
602009.10.26 17:43t/p301.000.910280.924970.91028720.0013349.50
612009.10.26 17:45buy311.000.910280.909520.91747
622009.10.26 17:45sell321.000.909970.917470.90278
632009.10.26 17:47s/l311.000.909520.909520.91747-76.0013273.50
642009.10.28 13:51t/p321.000.902780.917470.90278721.0013994.50
652009.10.28 13:55buy331.000.902660.901900.90985
662009.10.28 13:55sell341.000.902350.909850.89516
672009.10.28 14:49s/l331.000.901900.901900.90985-76.0013918.50
682009.10.29 11:37t/p341.000.895160.909850.89516722.0014640.50
692009.10.29 11:40buy351.000.894590.893830.90178
702009.10.29 11:40sell361.000.894280.901780.88709
712009.10.29 11:42s/l351.000.893830.893830.90178-76.0014564.50
722009.11.02 08:08s/l361.000.901780.901780.88709-748.0013816.50
732009.11.02 08:10buy371.000.901890.901130.90908
742009.11.02 08:10sell381.000.901580.909080.89439
752009.11.02 08:21s/l371.000.901130.901130.90908-76.0013740.50
762009.11.03 15:33t/p381.000.894390.909080.89439720.0014460.50
772009.11.03 15:35buy391.000.894880.894120.90207
782009.11.03 15:35sell401.000.894570.902070.88738
792009.11.03 16:27s/l391.000.894120.894120.90207-76.0014384.50
802009.11.11 10:40s/l401.000.902070.902070.88738-742.0013642.50
812009.11.11 10:45buy411.000.902710.901950.90990
822009.11.11 10:45sell421.000.902400.909900.89521
832009.11.11 10:46s/l411.000.901950.901950.90990-76.0013566.50
842009.11.12 20:35t/p421.000.895210.909900.89521722.0014288.50
852009.11.12 20:40buy431.000.895210.894450.90240
862009.11.12 20:40sell441.000.894900.902400.88771
872009.11.12 21:23s/l431.000.894450.894450.90240-76.0014212.50
882009.11.16 17:23t/p441.000.887710.902400.88771721.0014933.50
892009.11.16 17:25buy451.000.888140.887380.89533
902009.11.16 17:25sell461.000.887830.895330.88064
912009.11.17 07:42s/l451.000.887380.887380.89533-77.5014856.00
922009.11.19 14:20s/l461.000.895330.895330.88064-745.0014111.00
932009.11.19 14:25buy471.000.895190.894430.90238
942009.11.19 14:25sell481.000.894880.902380.88769
952009.11.19 14:35s/l471.000.894430.894430.90238-76.0014035.00
962009.11.23 01:16s/l481.000.902380.902380.88769-748.0013287.00
972009.11.23 01:20buy491.000.902240.901480.90943
982009.11.23 01:20sell501.000.901930.909430.89474
992009.11.23 01:33s/l491.000.901480.901480.90943-76.0013211.00
1002009.11.26 07:37s/l501.000.909430.909430.89474-745.0012466.00
1012009.11.26 07:40buy511.000.909380.908620.91657
1022009.11.26 07:40sell521.000.909070.916570.90188
1032009.11.26 07:42s/l511.000.908620.908620.91657-76.0012390.00
1042009.12.04 14:00t/p521.000.901880.916570.90188727.0013117.00
1052009.12.04 14:05buy531.000.901860.901100.90905
1062009.12.04 14:05sell541.000.901550.909050.89436
1072009.12.04 14:17s/l531.000.901100.901100.90905-76.0013041.00
1082009.12.08 10:00s/l541.000.909050.909050.89436-748.0012293.00
1092009.12.08 10:05buy551.000.908960.908200.91615
1102009.12.08 10:05sell561.000.908650.916150.90146
1112009.12.08 10:35s/l551.000.908200.908200.91615-76.0012217.00
1122009.12.09 13:03t/p561.000.901460.916150.90146720.0012937.00
1132009.12.09 13:05buy571.000.900990.900230.90818
1142009.12.09 13:05sell581.000.900680.908180.89349
1152009.12.09 14:57s/l581.000.908180.908180.89349-750.0012187.00
1162009.12.09 15:05t/p571.000.908180.900230.90818719.0012906.00
1172009.12.09 15:10buy591.000.908220.907460.91541
1182009.12.09 15:10sell601.000.907910.915410.90072
1192009.12.09 16:39s/l591.000.907460.907460.91541-76.0012830.00
1202009.12.11 15:19t/p601.000.900720.915410.90072723.0013553.00
1212009.12.11 15:20buy611.000.900670.899910.90786
1222009.12.11 15:20sell621.000.900360.907860.89317
1232009.12.11 16:09s/l611.000.899910.899910.90786-76.0013477.00
1242009.12.15 20:54t/p621.000.893170.907860.89317721.0014198.00
1252009.12.15 20:55buy631.000.893210.892450.90040
1262009.12.15 20:55sell641.000.892900.900400.88571
1272009.12.16 10:02s/l631.000.892450.892450.90040-77.5014120.50
1282009.12.17 04:32t/p641.000.885710.900400.88571723.0014843.50
1292009.12.17 04:35buy651.000.885700.884940.89289
1302009.12.17 04:35sell661.000.885390.892890.87820
1312009.12.21 12:45s/l661.000.892890.892890.87820-748.0014095.50
1322009.12.22 10:00t/p651.000.892890.884940.89289714.5014810.00
1332009.12.22 10:05buy671.000.893870.893110.90106
1342009.12.22 10:05sell681.000.893560.901060.88637
1352009.12.22 11:12s/l671.000.893110.893110.90106-76.0014734.00
1362009.12.24 10:30s/l681.000.901060.901060.88637-746.0013988.00
1372009.12.24 10:35buy691.000.900600.899840.90779
1382009.12.24 10:35sell701.000.900290.907790.89310
1392009.12.24 10:44s/l691.000.899840.899840.90779-76.0013912.00
1402009.12.30 15:53t/p701.000.893100.907790.89310723.0014635.00
1412009.12.30 15:55buy711.000.893460.892700.90065
1422009.12.30 15:55sell721.000.893150.900650.88596
1432009.12.30 16:15s/l711.000.892700.892700.90065-76.0014559.00
1442009.12.31 17:15t/p721.000.885960.900650.88596722.0015281.00
1452009.12.31 17:20buy731.000.886250.885490.89344
1462009.12.31 17:20sell741.000.885940.893440.87875
1472010.01.04 15:27s/l741.000.893440.893440.87875-748.0014533.00
1482010.01.04 15:33t/p731.000.893440.885490.89344716.0015249.00
1492010.01.04 15:35buy751.000.893970.893210.90116
1502010.01.04 15:35sell761.000.893660.901160.88647
1512010.01.05 10:40s/l761.000.901160.901160.88647-749.0014500.00
1522010.01.05 10:51t/p751.000.901160.893210.90116717.5015217.50
1532010.01.05 10:55buy771.000.901010.900250.90820
1542010.01.05 10:55sell781.000.900700.908200.89351
1552010.01.05 11:27s/l771.000.900250.900250.90820-76.0015141.50
1562010.01.06 08:28t/p781.000.893510.908200.89351720.0015861.50
1572010.01.06 08:30buy791.000.893460.892700.90065
1582010.01.06 08:30sell801.000.893150.900650.88596
1592010.01.06 08:30s/l791.000.892700.892700.90065-76.0015785.50
1602010.01.06 15:01s/l801.000.900650.900650.88596-750.0015035.50
1612010.01.06 15:05buy811.000.900120.899360.90731
1622010.01.06 15:05sell821.000.899810.907310.89262
1632010.01.06 15:30s/l811.000.899360.899360.90731-76.0014959.50
1642010.01.08 11:06t/p821.000.892620.907310.89262723.0015682.50
1652010.01.08 11:10buy831.000.892800.892040.89999
1662010.01.08 11:10sell841.000.892490.899990.88530
1672010.01.08 18:13s/l841.000.899990.899990.88530-750.0014932.50
1682010.01.08 18:15t/p831.000.899990.892040.89999719.0015651.50
1692010.01.08 18:20buy851.000.900390.899630.90758
1702010.01.08 18:20sell861.000.900080.907580.89289
1712010.01.08 18:23s/l851.000.899630.899630.90758-76.0015575.50
1722010.01.13 08:18t/p861.000.892890.907580.89289722.0016297.50
1732010.01.13 08:20buy871.000.892920.892160.90011
1742010.01.13 08:20sell881.000.892610.900110.88542
1752010.01.13 09:32s/l871.000.892160.892160.90011-76.0016221.50
1762010.01.15 02:20t/p881.000.885420.900110.88542723.0016944.50
1772010.01.15 02:25buy891.000.884430.883670.89162
1782010.01.15 02:25sell901.000.884120.891620.87693
1792010.01.15 02:25s/l891.000.883670.883670.89162-76.0016868.50
1802010.01.19 02:22t/p901.000.876930.891620.87693721.0017589.50
1812010.01.19 02:25buy911.000.877100.876340.88429
1822010.01.19 02:25sell921.000.876790.884290.86960
1832010.01.19 07:01s/l911.000.876340.876340.88429-76.0017513.50
1842010.01.20 11:56t/p921.000.869600.884290.86960720.0018233.50
1852010.01.20 12:00buy931.000.869500.868740.87669
1862010.01.20 12:00sell941.000.869190.876690.86200
1872010.01.20 12:04s/l931.000.868740.868740.87669-76.0018157.50
1882010.01.22 12:31s/l941.000.876690.876690.86200-746.0017411.50
1892010.01.22 12:35buy951.000.877080.876320.88427
1902010.01.22 12:35sell961.000.876770.884270.86958
1912010.01.22 12:36s/l951.000.876320.876320.88427-76.0017335.50
1922010.01.26 04:53t/p961.000.869580.884270.86958721.0018056.50
1932010.01.26 04:55buy971.000.869590.868830.87678
1942010.01.26 04:55sell981.000.869280.876780.86209
1952010.01.26 05:16s/l971.000.868830.868830.87678-76.0017980.50
1962010.01.28 10:24t/p981.000.862090.876780.86209723.0018703.50
1972010.01.28 10:25buy991.000.862250.861490.86944
1982010.01.28 10:25sell1001.000.861940.869440.85475
1992010.01.28 11:24s/l991.000.861490.861490.86944-76.0018627.50
2002010.01.31 22:09s/l1001.000.869440.869440.85475-749.0017878.50
2012010.01.31 22:09buy1011.000.869530.868770.87672
2022010.01.31 22:09sell1021.000.869220.876720.86203
2032010.01.31 22:44s/l1011.000.868770.868770.87672-76.0017802.50
2042010.01.31 23:59close at stop1021.000.868820.876720.8620340.0017842.50
A measure of fractal self-similarity A measure of fractal self-similarity

This indicator measure the dispersion of the fractal dimension of various timeframes around the fractal dimension of a reference timeframe (which is the longer timeframe considered).

Indicator for evaluation of trading strategies Indicator for evaluation of trading strategies

With this system you will be able to evaluate strategies in an objective way, to develop strategies and see immediate trading results after making changes, to test multi-currency strategies, etc. Sample trading indicator is also included.

Three Indians Three Indians

Detection of a pattern "three Indians" on the basis of the ZigZag.

Simple Adviser EMA WMA RSI Simple Adviser EMA WMA RSI

Simple Expert Advisor. In this version RSI and Trailing Stop has been added.