Machine learning in trading: theory, models, practice and algo-trading - page 320

 
Mihail Marchukajtes:

<Graphs>.

I would shorten the optimization dates by a factor of six, so that the optimizer sees only the tip of all these graphs, and optimize with the flip date in the parameters as I wrote above.

And then to check the best found results already run the test on several months of data, purely visually evaluate.

 
Mihail Marchukajtes:

The point is that we are not going to talk about NS, but about Sequent, so look at its equity with different input values at the same period of work. I didn't optimize it, I just went through it by hand.

5-5

6-6

7-7

This is a much more interesting case with the 4-8 parameter, the same period. And it works with a stop loss of 300 pips.

This is from January 1 to the present day. I confess that I have picked the last screen with the optimizer, well, there are only 49 passes in the optimizer. That is, in fact, I have to learn to choose correctly the right parameters not from the dimensionless set, but from the finite set, and with such a small number of variants. So..........


Why don't you use Reshetov's RNN, but the classifier? It has an interesting logical core there, and the bot can be made to earn by default

Now there is such a task, to feed the input of NS with oscillator and regression slope for a given number of bars. In theory, oscillators only work in the flat, and they are pouring in the trend. If we add normalized values of the regression slope, the grid will take into account the trend slope. So far, it is in points, and from how many to how many points to normalize :)

double CalcRegression(double &PricesArray[])
     {
      double Summ_x=0.0;
      double Summ_y=0.0;
      double Summ_xy=0.0;
      double Summ_x_2=0.0;
      int jcount;
      for(int xcount=1; xcount<=глубина_анализа && !IsStopped(); xcount++)
        {
         jcount=глубина_анализа-xcount;
         Summ_x+=xcount;
         Summ_y+=PricesArray[jcount];
         Summ_xy+=xcount*PricesArray[jcount];
         Summ_x_2+=MathPow(xcount,2);
        }

      double bcoef=(глубина_анализа*Summ_xy-Summ_x*Summ_y)/(глубина_анализа*Summ_x_2-MathPow(Summ_x,2));  
      return(bcoef);
     }

And this is the RNN neuron itself, only 3 values of the oscillator are fed to the input, which of course is not very correct

double RNN(double p1,double p2,double p3)
  {
//--- вероятности для правил из базы знаний экспертной системы
   double y0 = x0; // Вероятность правила №0 в процентах
   double y1 = x1; // Вероятность правила №1 в процентах
   double y2 = x2; // Вероятность правила №2 в процентах
   double y3 = x3; // Вероятность правила №3 в процентах
   double y4 = x4; // Вероятность правила №4 в процентах
   double y5 = x5; // Вероятность правила №5 в процентах
   double y6 = x6; // Вероятность правила №6 в процентах
   double y7 = x7; // Вероятность правила №7 в процентах

//--- база знаний, состоящая из набора взаимоисключающих правил
   double probability=
                      (1.0 - p1) * (1.0 - p2) * (1.0 - p3) * y0 + // Правило №0
                      (1.0 - p1) * (1.0 - p2) * p3 * y1 +         // Правило №1
                      (1.0 - p1) * p2 * (1.0 - p3) * y2 +         // Правило №2
                      (1.0 - p1) * p2 * p3 * y3 +                 // Правило №3
                      p1 * (1.0 - p2) * (1.0 - p3) * y4 +         // Правило №4
                      p1 * (1.0 - p2) * p3 * y5 +                 // Правило №5
                      p1 * p2 * (1.0 - p3) * y6 +                 // Правило №6
                      p1 * p2 * p3 * y7;                          // Правило №7

//--- конвертируем проценты в вероятности 
   probability=probability/100.0;

//--- возвращаем результат в виде вероятности
   return(probability);
  }
 
Maxim Dmitrievsky:


Why don't you use Reshetov's RNN and the classifier? It has an interesting logic engine and you can make the bot make money by default.

The theory is that oscillators work only in the flat, and in the trend they are pouring out. In theory, oscillators only work in the flat, and they are pouring in the trend. If we add normalized values of the regression slope, the grid will take into account the trend slope. So far, it is in points, and from how many to how many points to normalize :)

And this is the RNN neuron itself, only 3 values of oscillator are fed to it, which is not very correct


Thanks for the tip, I will definitely try it on my data today.

Please tell me where to download it, I can not find it upfront. Thank you!

 
Mihail Marchukajtes:


Thanks for the tip, I will definitely try it on my data today.

Can you please tell me where to download it, that's a pushover I could not find. Thank you!

I have RNN and RNN3 and its unpublished article in MQL5 but it should not be so. RNN is a better optimizer than RNN3.
Files:
RNN_MT5.zip  223 kb
 
Maxim Dmitrievsky:

And this is the RNN neuron itself, only 3 oscillator values are fed to the input, which, of course, is not very correct

Interesting code, thanks. And for the article too.


RNN(double p1,double p2,double p3)

All values of parameters p1, p2, p3 should be from 0 to 1. If one of these parameters takes value B from regression, it must be normalized to the same interval [0;1].


Generally, this strategy is based on the theory that high RSI value means that price is about to go down. It takes three RSI values for accurate prediction and according to the rules of probability theory we get one estimation from three parameters.
It means that if instead of the third RSI you give your own signal, the high value of this signal must mean that the price will go down. Otherwise you will break the strategy.

 
Dr. Trader:

Interesting code, thank you. And for the article, too.

If you pass B from regression to one of these parameters, you have to normalize it to the same interval [0;1].


Yes, that's right. Only we should invert the regression values, if we want it to buy on a rising market and sell on a falling one, because it will buy if the probability <0.5 at the output of the neuron, while rsi should tend to zero and regression will also fall when <0.5, while we want it to grow >0.5
 
Dr. Trader:

In general this strategy is based on the theory that high RSI value means price will go down. It takes three RSI values for accurate prediction and according to probability theory it obtains the same estimate from three parameters.
It means that if instead of the third RSI you give your own signal, the high value of this signal must mean that the price will go down. Otherwise you will break the strategy.


Yes, exactly, above I just wrote about it :)

Default grid optimized on m5 put in monitoring https://www.mql5.com/ru/signals/297732

Then I'll experiment more with different inputs for the neuron

Торговые сигналы для MetaTrader 5: NEUROSHELL test
Торговые сигналы для MetaTrader 5: NEUROSHELL test
  • Maxim Dmitrievsky
  • www.mql5.com
Торговый Сигнал NEUROSHELL test для MetaTrader 5: копирование сделок, мониторинг счета, автоматическое исполнение сигналов и социальный трейдинг
 

https://www.mql5.com/ru/code/127

Only there is some error in the code, in my opinion, the indicator is not rationed correctly

Наклон линейной регрессии
Наклон линейной регрессии
  • votes: 24
  • 2010.07.05
  • Vladimir
  • www.mql5.com
Наклон линейной регрессии, нормализованный к SMA
 
Maxim Dmitrievsky:
I've got RNN and RNN3 and his unpublished article on MQL5 there, but it's for nothing. RNN works better in optimizer than RNN3.


Thanks!!! Of course it's a pity that it's a 5, but anyway, I'll try to spin it with my data....

 
Mihail Marchukajtes:


Thanks!!! Of course it's a pity that it's a fiver, but anyway, I'll try to spin it with my data....


on 5 is convenient because you can do forward tests, just the same for NS, and for 4 the same, in my opinion, was in the codebase, if you look

https://www.mql5.com/ru/code/10616

RNN_MT4
RNN_MT4
  • votes: 2
  • 2012.02.20
  • Yury Reshetov
  • www.mql5.com
Советник со встроенной экспертной системой
Reason: