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

 
Maxim Dmitrievsky:

What's the second one for?

 ReturnsBuffer[i]=log(pr2);
 

I'm wrong, I took the logarithm twice, in the last line if you remove it, it's like this:


 
elibrarius:

why the second one?

Yes, I've already found it.)

Well, how to train something on such a game?

 
Maxim Dmitrievsky:

Yes, I've already found it.)

Well, how do you train something on such a game?

I do not know. But in the first case both with log and without it - the graphs are identical
 
elibrarius:
I don't know. But in the first case either with or without log the graphs are identical

Yes, in the first case, just if you need inputs to the NS from -1 to 1 and make a detrend

in the case of subtraction it doesn't look like a detrend

 

Maxim Dmitrievsky:

for(int i=start;i<rates_total;i++) 
     {
      bool invert = false;
      double pr = close[i]-close[i-ReturnsPeriod];
      if(pr<0)
       {
        pr = pr*-1;
        invert = true;
       }
      double pr2 = log(pr);
      if(invert) pr2 = pr2*-1;
      ReturnsBuffer[i]=log(pr2);
     
     }

There's something wrong with the logarithm. What you want can be achieved with sqrt() instead of log()

 
Maxim Dmitrievsky:

Yes, in the first case, just if you need inputs to the NS from -1 to 1 and make a detrend

in case of subtraction it doesn't look like detrend

Well, if log is only used for detrending, then yes. I thought you also wanted to remove the outliers...

Can you play with the logarithm, maybe decimal would be more interesting? Or calculate with another base... 1000 for example

 
Dr. Trader:

There's something wrong with the logarithm. What you want can be achieved with sqrt() instead of log()

I don't want anything from it )) I just want the center to be zero.

 
elibrarius:
Well, if log is only used for detrending, then yes. I thought you wanted to remove outliers too...

Can we play with the logarithm, maybe it would be more interesting with decimal? Or with a different basis to calculate... 1000 for example

To remove outliers, we need to make a logarithmic scale by time, not by price.

http://berg.com.ua/graph/logarythmic-scale-trend-lines/
Логарифмическая шкала цен для трендовых линий — Берг
Логарифмическая шкала цен для трендовых линий — Берг
  • IAMWW
  • berg.com.ua
Трендовые линии имеют интересное свойство: проявлять себя на графиках с логарифмической ценовой шкалой (а не арифметической). Если в абсолютном отношении на графике можно наблюдать ускорение роста цены (или замедление падения), то на этом же графике но с относительной (т.е. логарифмической) шкалой цен, вероятно, проявится отчетливая линия...
 
Maxim Dmitrievsky:

to remove outliers, you need to do a logarithmic scale by time, not by price

You should remove the outliers of time)))
Reason: