Author's

 

Good afternoon

I want to try to realize a project to write an EA.

I am not asking for flooding, comments and suggestions on the merits if possible, pointing to the source. If I make a statement, please give precise definitions for further formalization and validation. Better to do a linear regression analysis and talk about the slope and variance .

So the goal is:

To write a self-adapting Expert Advisor.

Assumptions

1 History repeats itself (to be checked). According to my observations the market pattern repeats itself, i.e. regression angle, variance and period of intersection with the price. Similar segments can be found e.g. by correlation of the current moment with historical data.

2 It is possible to write a mathematical model for any section of the market (verification is not necessary, it is enough to optimize the masks, they will adequately describe the market in the selected section).

If the system worked on the history similar to the current time, it should work satisfactorily in the current time (to be checked).

4 Expert Advisor can steadily work ( not to lose), for a period exceeding several times the optimization period, if there is a function that analyzes the results of work by Equity and this function prohibits or allows the trade (tested). Virtual trading is meant here.

5.........

It is necessary to

1 Block of "similarity" analysis in relation to the current moment .

2 Selecting the current time window .

A Just take the time window day , week , month , quarter .

B Min/max for the period .

C Zig-Zag break is almost the same .

D Go through until the current low of n candles is similar to the history low of n+m candles .

3 Than compare two periods .

A Spearman correlation .

B Measuring degrees of similarity of functions . (Yukio Sato "Signal Processing First Encounter Page 61 ")

C ......

4 Optimization function of the EA within the chosen interval, in order to get the trading strategy waving , RSI, CCI ...... and optimal parameters

5 Equity analysis function, which conducts virtual trading and permits or disallows trading

A Lastn trades

B Number of trades since the last drawdown

C ....

I would be happy to read all the nudges and remarks , except for the flooding .

 
do you just need specific block algorithms? or are you planning to do it with more than one participant?
 

Watched Yukio Sato - methodically for half the book he invents the Pearson correlation coefficient. I wonder if he knows what he's got? Calculating correlation without a mean is something! Sorry for the flub.

п. 4. You can just play this in the tester - forward test, without bothering with coding.

п. 5. You can start with a script to process the report after the test, and see if that makes sense.

 

1 Dogma - history repeats itself ( subject to verification) .

We should start with the main point (1).

According to my observations, history does not repeat itself.

Until "1" is proven, we should not go further into the thicket.

We must decide if history repeats itself or not. The rest is easier.

 

sergeev:

вам просто нужны конкретные алгоритмы блоков? или вы планируете делать его с несколькими участниками?

I plan to start the project publicly, and then as the curve will bear out. So if you can lay out the algorithms will be glad, I think not just me. Separate spz with a brush for ideas and nudges.

To her.human

History repeats itself. This thesis must be made clear, otherwise everyone will take it in his own way.

I suggest that history repeats itself. History repeats for specific TS within periods of profitability - unprofitability. For example we take two cars, do optimization on an arbitrary chosen area . If we now run this TS on all available data, we can notice that there are periods of profitable-loss-making . Correspondingly, we can say that in a profitable area the history repeated itself . I did such a thing on 4, the results are not the grail, but the direction of excavation is kind of correct.

 

first brick

Below is the average indicator. On the basis of the average, a signal line is drawn which is calculated as the average difference between the closing price and the average itself. The beauty of it lies in the fact that only one average is used, which allows to reduce the calculations significantly (in comparison with two averages) with acceptable results. The application is standard .

First hitch . Here is the script. Can you tell me what to tweak in the conservatory?

#property version   "1.00"
#include <MovingAverages.mqh>
//+------------------------------------------------------------------+
void OnStart()
  {
   double Mass[]={1,2,3,4,5,6,7,8,9,10},aaa=0,aaa1=0 ;
   int i ;
      for (i=0;i<10;i++)
         {
            aaa1=aaa1+Mass[i] ;
         }
     Alert("Расчет средней вручную = ",aaa1/10) ;
     aaa=SimpleMA(0,10,Mass) ;
     Alert("Расчет средней стандартной библиотекой = ",aaa) ;
     
  }
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Линии индикаторов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Линии индикаторов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы индикаторов / Линии индикаторов - Документация по MQL5
Files:
OneMa.mq5  4 kb
 
Look at the source code of SimpleMA(), it will not read the data the way you want.
 

The trailer includes a correlation calculation class and indicator as an example application .

To Rosh

Got it, got it. Thanks for the slap in the face.

 
There is a need to make a tester inside the EA. Can anyone from the respected community share their ideas (and so immodestly their expertise)
 
ivandurak:
There is a need to make a tester inside the EA. Maybe someone from the respected community will share ideas (and so immodestly the workings)
Read Dr. Tradlove, or How I stopped worrying and wrote a self-learning Expert Advisor
 

Rosh:
Почитайте Доктор Трейдлав, или Как я перестал беспокоиться и написал самообучающийся эксперт

If it were possible to formulate an in-house tester as a class to be connected in your code, I would honestly marry it. I would honestly marry it.

---------------------------------------------------------------------------------------------------------------------------------------------------------

I was playing around today. I've taken correlated sections on a charts and optimized them on one and ran them on the other. The results are encouraging.

Reason: