Конкурс советников внутри советника – Статьи по MQL4 – [PRO VSA EA] Best Forex Expert Advisors 2018

Конкурс советников внутри советника – Статьи по MQL4

https://www.mql5.com/ru/articles/1578

third party intervention

Lord developers and researchers Exchange spaces!

Frequently many commercial systems (TC) have stability in certain time slots, but after a while the balance curve starts to move down. The trader is disappointed, begins to invent new graali, optimize settings, etc.

I offer you a tool to commit virtual transactions VirtualTrend.mqh. Using my proposed functions, you can open, close, and trawling virtual transactions.

the usefulness of this tool is the following:

  1. ability to create Adaptive advisers that will enable or disable the real deal depending on the previously carried out the trades.
  2. maintain a rating between multiple trading systems (TC) (in this example, 5 trading systems) in percentage depending on profitability. According to the results of the virtual competition establishes the preferred trading system for further bidding in the real market.
  3. the opportunity to implement trading strategies using multiple transactions open at one time on one instrument, the trading platform Meta Trader 5, which uses the cumulative position (this feature is not described in this article, and it is proposed as a use case).

look at the first two statements.

For example the Adaptive expert advisor consider the code Competition_v1.0.mq4, which are selected on a competitive basis, any trading system use.
5 used in the expert advisor trading systems (if you want, you can add), selected by me accidentally, which more or less stable on the daily chart
EURUSD.

important! you must use a stable trading system that can either steadily profitable or stable to merge at a certain period of time.

for example, trading system, a series of WINS which is: “PPPPPPPUUUUUUUUPPUPPPPPPPP” is suitable for use in this EA, and if the order of the results of the transactions has the form: “UUPPUPUUPPPUUPUPPUPUPUUUPPUPU”, It is not appropriate (“y”-losing trade, “p”-profit).

torgovaja system in which trades occur more frequently than profitable, but lucrative deals cover all previous unprofitable because the Adviser simply will not have time to adapt to profitability.

the stability of trading system “by eye” is determined according to the results of tests performed during the maximum period (the whole story) in the tester. On a schedule change is determined by the weighted average number of transactions at the end of which there is a change in the trend. For example: trading system has committed a series of transactions the following: PPPPPPPPUUUUUUPPPPPPPPPUPUUUUUUUUUUUPPPPPPPUUUUUUUUUUUUUPPPPPPUUUUUUUUUUPUPPPUUPPPPPP. The trend is changing the balance of approximately 6-8 transactions. The averaging period balance when calculating rankings it is recommended to install half of the number of these transactions. That is 3 or 4.

to enable or disable the rating system that helps counsel to adapt to the changing nature of profitability, is controlled by RatingON. Using it you can easily pick up the averaging period balance and install it in the
Tõ.PeriodRating.

each of the trading systems, you can enable or disable at will using Th parameter Enabled, where x is the number of the VEHICLE.

all the following tests are performed on trading systems the tool EURUSD (timeframe D1) on the period from 1999.01.01 to advisors.

trading system no. 1

  • condition of entry: the intersection of fast moving average slow (see function T1_SignalOpen.)
  • condition: the opposite intersection (see the function T1_SignalClose ()).


Figure 1.
Test No. 1 trading system without adaptation (RatingON = false)

test results we can conclude that after every 18-20 transactions this trading strategy is changing the nature of profitability.

So the T1. PeriodRating is set to 20.


Figure 2.
Test No. 1 trading system adaptation enabled (RatingON = true)

trading system # 2

  • condition of entry: indicator CCI a certain level from the top down. (See the function T2_SignalOpen ())
  • : the emergence of a signal in another direction. (See the function T2_SignalClose ())

when conducting the test during the same period, we know that stability is approximately equal to 10 transactions.


Figure 3.
Test No. 2 trading system without adaptation


Figure 4.
Test No. 2 trading system adaptation enabled

trading system # 3

login and logout Logic is the same as your VEHICLE No. 1, only averaging periods other moving averages.

a small digression: you can generally rewrite the whole Competition_v1.0.mq4 and collect it from the strategies that will only contain moving averages with different periods.

Is an interesting study I did not, but if you spend, ladies know.


Figure 5.
Test No. 3 trading system without adaptation

This VEHICLE commits very few transactions over a long period (nearly 11 years). In real trade this strategy use I do not recommend because of disastrously low number of transactions in the tester.

in the article I added for clarity, to show my works to develop adaptation. For this TS parameter T3. PeriodRating is set to 2.


Figure 6.
Test No. 3 trading system adaptation enabled

trading system # 4

this strategy more than once have I in literature.

it seems attractive and without adaptation, but to use it in trading-automated trading is not required for its sustainability.

  • Input takes place when lining up three moving averages in order, and if MACD above a certain level of T4. LimitMACD.
    (see the function T4_SignalOpen ())
  • Output if the price crosses the second moving average (see the function T4_SignalClose ()).


Figure 7.
Test No. 4 trading system without adaptation

This trading strategy has a constant stability, so processing period for calculating the rating must be at least 20 transactions. I set the T4. PeriodRating = 20.


Figure 8.
Test No. 4 trading system adaptation enabled

trading system no. 5

This VEHICLE developed myself and want it to share with you in such a sophisticated manner.

  • Purchase we make, if the indicator the CCI crosses a certain level of T5. LevelCCI from the bottom up. (see the function T5_SignalOpen ()). Set the closing level on T5 MyLevel. TralingCCI indicator points lower than the level of the opening of T5. LevelCCI. See indicator CCI and closing level MyLevel way with certain steps so that the distance between the current value of the progress bar CCI and levels were no more than double MyLevel T5. TralingCCI.
  • Close open purchase, if the indicator CCI crossed the MyLevel level from top to bottom. (see the function T5_SignalClose ()).


Figure 9.
Test No. 5 trading system without adaptation

such a schedule can even adapt, but for decency will install T5. PeriodRating = 10.


Figure 10.
Test trading system no. 5 with enabled adaptation

Multisystem Expert Advisor

above have been shown how to operate 5 expert advisors without limitation and adaptation-enabled transactions.

Now is invited to consider the example of the joint work of all these advisers:

Symbol EURUSD (Euro vs. US Dollar)

from

Day (D1) 1999.05.24 2010.07.05-00:00 00:00 (1999.01.01-2010.07.05)

model

checkpoints (very rough method, the results do not take into account)

RatingON = false; FastTest = true;
file = “virtual.csv”; MinRating = 50; _tmp1_ = “-trading system-1”; T1. Enabled = 1; T1. Magic = 101; T1.lot = 0.1; T1. Fast = 10;
T1. Slow = 100; T1. TS = 7000; T1. PeriodRating = 20; _tmp2_ = “-trading system-2”; T2. Enabled = 1; T2. Magic = 102; T2.lot = 0.1;
T2. Periodcci = 30; T2. LevelCCI = 200; T2. SL = 500; T2. PeriodRating = 10;
_tmp3_ = “-trading system-3”; T3. Enabled = 1; T3. Magic = 103;
T3.lot = 0.1; T3. Fast = 30; T3. Slow = 200; T3. TS = 5000; T3. PeriodRating = 2;
_tmp4_ = “-trading system-4”; T4. Enabled = 1; T4. Magic = 104;
T4.lot = 0.1; T4. SL = 5000; T4. TS = 5000; T4. LimitMACD = 0.002; T4. PeriodRating = 60;
_tmp5_ = “-trading system-5”; T5. Enabled = 1; T5. Magic = 105;
T5.lot = 0.1; T5. Periodcci = 90; T5. LevelCCI = 100; T5. TralingCCI = 100; T5. SL = 5000;
T5. TS1 = 5000; T5. PeriodRating = 10;






bars in history

2994 Modelled ticks

219840 Quality modeling

n/a

initial deposit





500000.00 net profit

617173.70

Gross profit

1342671.82

gross loss

-725498.13

1.85 Profitability

expected payoff

2373.74



the absolute drawdown 76798.13

Maximum etcdraught

172676.05 (28.98%)

the relative drawdown 28.98% (172676.05)


transactions Total 260

short positions (won%)

126 (29.37%)

long positions (won%)

(33.58%) 134


profitable trades (% of total)

82 (31.54%)

loss trade (% of total)

178 (68.46%)

the biggest profit

78151.67

losing trade-18831.39

medium

profit 16374.05

losing trade-4075.83

m MAX DC amount

continuous WINS (profit)

6 (89681.19)

of continuous losses (loss)

21 (100325.23)

Maximum continuous profit (number of WINS)

95057.65 (3)

consecutive loss (count of losses)

-100325.23 (21)

medium

consecutive wins 2

consecutive losses 4

Figure 11. Testing multi-system Adviser without adaptation

as a result of the mixing of trading systems has increased profits, drawdown and the number of transactions.

and now look the same test but with the RatingON.

Day (D1) 1999.05.24 2010.07.05-00:00 00:00 (1999.01.01-2010.07.05)

checkpoints (very rough method, the results do not take into account)

RatingON = true; FastTest = true;
file = “virtual.csv”; MinRating = 1; _tmp1_ = “-trading system-1”; T1. Enabled = 1; T1. Magic = 101; T1.lot = 0.1; T1. Fast = 10;
T1. Slow = 100; T1. TS = 7000; T1. PeriodRating = 20; _tmp2_ = “-trading system-2”; T2. Enabled = 1; T2. Magic = 102; T2.lot = 0.1;
T2. Periodcci = 30; T2. LevelCCI = 200; T2. SL = 500; T2. PeriodRating = 10; _tmp3_ = “-trading system-3”; T3. Enabled = 1; T3. Magic = 103; T3.lot = 0.1;
T3. Fast = 30; T3. Slow = 200; T3. TS = 5000; T3. PeriodRating = 2; _tmp4_ = “-trading system-4”; T4. Enabled = 1; T4. Magic = 104; T4.lot = 0.1;
T4. SL = 5000; T4. TS = 5000; T4. LimitMACD = 0.002; T4. PeriodRating = 60;
_tmp5_ = “-trading system-5”; T5. Enabled = 1; T5. Magic = 105;
T5.lot = 0.1; T5. Periodcci = 90; T5. LevelCCI = 100; T5. TralingCCI = 100; T5. SL = 5000;
T5. TS1 = 5000; T5. PeriodRating = 10;

bars in history

2994 Modelled ticks

219840 Quality modeling

n/a

initial deposit

500000.00 net profit

227123.75

Gross profit

388438.79

gross loss

-161315.05

Profitability 2.41

expected payoff

2341.48

the absolute drawdown 10921.17

Maximum DD

76482.03 (12.48%)

the relative drawdown 12.48% (76482.03)

transactions 97

short positions (won%)

50 (40.00%)

long positions (won%)

47 (46.81%)

profitable trades (% of total)

42 (43.30%)

loss trade (% of total)

55 (56.70%)

the biggest profit

71192.28

losing trade-12680.47

medium

profit 9248.54

losing trade-2933.00

Ma ksimalnoe number

continuous WINS (profit)

5 (80463.85)

of continuous losses (loss)

13 (50753.48)

Maximum continuous profit (number of WINS)

80463.85 (5)

consecutive loss (count of losses)

-50753.48 (13)

medium

consecutive wins 2

consecutive losses 3

Figure. 12. the multi-system Testing adaptation enabled Advisor

the balance line leveled off, the number of sharp drawdowns decreased profit decreased 2.71 time drawdown decreased 2.32 times the number of deals decreased by 2.68 times profitability increased 1.3 times.

figure. 12in contrast to previous tests, appeared the schedule of volumes. This was due to the activity of the rating system.

It works as follows: first summed profit Th. PeriodRating virtual closed deals and is divided by the number of days for which the transactions were committed. Plus the number of added the total profits of all open positions, common for the number of days of activity of open positions.

if the number came out negative then it is equal to zero. is done for each trading VEHICLE.

rating system differentiates one trading strategy from another using magic numbers assigned to active trading strategies in elementary settings Th. Magic. Finds the most profitable VEHICLE for maximum profit and value is assigned to this trading system rating 100%.

the rest of the VEHICLE is assigned a rating of relative rankings of the leading VEHICLE. as a result of action creates a table with three columns.

example:

Magic Profit Rating%
1 9
40.9 2 0 0.0
3 3
13.6 4 10 45. 5
5 0 0.0
6 17
7 77.3 0 0
8 12
54.5 9 0 0.0
10 22 100.0

during real trading the resulting value rating is multiplied by the stake and is divided into 100 Tх.lot. In this case, the actual trading will participate all trading systems, with a rating of greater than zero.

to the real trade participated only lidernaja trading system, you need a parameter in MinRating Competition_v expert 1.0 set to 100.

Conclusion

Presented the technique does not give 100% guarantee profitability, but I can say with confidence that the balance curve smoothing is achieved. Namely: reducing profit slump and the number of transactions is guaranteed! The increase in profitability is ambiguous.

is it good or bad-you decide.

Decryption parameters: Competition_v1.0.mq4

  • RatingOn switch rating (if unchecked, the transactions in the file must match the actual trafficking)
  • FastTest-do not modify the
    file whenever an array of virtual transactions during testing.
  • file -file virtual trade (appears in the directory TerminalPath () + “expertsfiles”)
  • MinRating-minimum rating percentage needed to open a real position
  • Tõ.Enabled -TC switch
  • Tõ. Magic-magic number
  • Tõ.lot is the maximum lot, which sells 100% strategy
  • Tõ.Fast -fast Ma Period
  • Tõ. Slow-slow Ma Period
  • Th. SL-stop loss in points
  • Tх.TS1-Disposable trejlingstop paragraphs (converts StopLoss at break-even)
  • Tõ.TS -Trailing Stop level in points
  • Tõ.PeriodRating -period of averaging the rankings (number of transactions history)

Related-topic links: http://forum.the mql 4.com/en/

23455

Leave a comment