3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machines

John Ehler's supersmoother

I think I did this test some time ago but now is a new era of my system so why not to repeat this test, simple to filter the price data using John Ehler's super smoother.

According to him the aliasing noise and spectral dilation should go away so it should be much easier to predict from this data than from raw data. This what theory says.

here is a link to his presentation


and here are the results

before smoothing

Code:
>> resultsAll('')
resultsAll('*Peg*')
resultsAll('*CHIRP*')
resultsAll('*J48*')
resultsAll('*RBM*')
resultsAll('*SDAE*')
resultsAll('*ELM*')
   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
153524895.60         1.10        -0.31        63.57         0.33      2057179      1142804          685         1146        47.98

   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
 18313270.30         1.06        -0.35        62.34         0.37       396627       231428          115          191        29.16

   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
 99547243.10         1.51        -0.17        67.07         0.34       347466       161197          128          191       195.70

   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
 28772075.10         1.10        -0.33        62.44         0.36       381382       203698          111          191        49.18

   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
-44923482.80         0.81        -0.37        60.81         0.23       245033       165306          105          191      -109.48

   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
 43758625.80         1.19        -0.34        66.31         0.31       326497       167161          112          191        88.64

   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
  8057164.10         1.03        -0.31        62.31         0.35       360174       214014          114          191        14.03

>>

and after smoothing

Code:
>> resultsAll('')
resultsAll('*Peg*')
resultsAll('*CHIRP*')
resultsAll('*J48*')
resultsAll('*RBM*')
resultsAll('*SDAE*')
resultsAll('*ELM*')
   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
-101993241.90         0.94        -0.34        60.33         0.32      1963830      1207497          627         1146       -32.16

   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
-80552728.10         0.80        -0.37        60.33         0.39       399735       266821          112          191      -120.85

   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
  4939925.40         1.02        -0.23        61.31         0.35       355152       204655          117          191         8.82

   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
 16094468.20         1.05        -0.34        61.36         0.36       376003       212934          113          191        27.33

   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
-41257476.50         0.76        -0.45        51.70         0.14       143284       118435           63          191      -157.64

   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
-12799560.40         0.95        -0.41        61.73         0.30       321478       188821          109          191       -25.08

   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
 11582129.50         1.04        -0.30        62.14         0.36       368178       215831          113          191        19.83

>>

so clearly it degrades the performance. PF down from 1.1 to 0.94. As result is based on 3.2 mln trades i think is quite significant.

Krzysztof
 
Krzysztof, in your algo your target is the price ? return ? direction next bars ? what traget you try to predict ?

Regards
Ludo.
 
Krzysztof, in your algo your target is the price ? return ? direction next bars ? what traget you try to predict ?

Regards
Ludo.

Target is to make profit so successful trade (TP) or class 1. If you lost money class is 0 (FP).

Krzysztof
 
Krzysztof,

If i understand you use matlab with MT4 or MT5 ? what interface you use for communicate with MT/matlab ? a dll ? a file ?

Regards.
 
2nd attempt

Its my second attempt to denoise the data using Ehler SS. This time I denoised
inputs partially i.e. price returns only. PF returned to previous value (1.09 vs 1.1 when no denoising) but still not improvement. So conclusion for me is that Ehler SS does not improve at all the performance and when applied to valuable inputs degrade the performance.

In the next step I will denoise the data using Wavelet and Empirical Mode Decomposition and check the impact for performance of strategies.

Krzysztof

Code:
>> resultsAll('')
resultsAll('*Peg*')
resultsAll('*CHIRP*')
resultsAll('*J48*')
resultsAll('*RBM*')
resultsAll('*SDAE*')
resultsAll('*ELM*')
   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
146829788.00         1.09        -0.31        63.54         0.33      2060102      1154090          675         1146        45.68

   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
 -2356058.10         0.99        -0.36        61.19         0.38       398130       242752          107          191        -3.68

   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
105986961.10         1.58        -0.17        67.69         0.34       348438       157569          129          191       209.46

   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
 47452333.90         1.18        -0.33        62.50         0.37       389005       204304          113          191        79.98

   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
-53654157.60         0.78        -0.38        61.06         0.23       241635       166947          102          191      -131.32

   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
 43377306.90         1.19        -0.34        66.31         0.31       326761       167698          114          191        87.73

   NORMAL DATA AVERAGE RESULTS
      Profit           PF         avMC         avPP         avRC        totTP        totFP         PF>1     algosnum     perTrade
  6023401.80         1.02        -0.30        62.37         0.35       356133       214820          110          191        10.55

>>
 
Hello Krzysztof

Yes try wavelet in particular wavelet modwt its good for denoising !!

Regards
 
denoising and SNR

Recently I was working on denosing market data and here is some results which i want to share. It's written in a lot of papers that denoising of marktet data improves predictive power of certain predictive algos (e.g ARIMA) so why not to check it. Here is a little function for measuing signal to noise ratio for noisy/denoised pair of signals

In the following posts I examine SNR obtained using Ehler Supersmoother, Wavelet and EMD methods against 1min
GBPJPY data

Code:
function [mse, SNR, PSNR, cross_core] = evaluate_denoising_metrics(noisy,denoised)

%Computes metrics of denoising (1-D)signal algorithms

%Metrics mean squared error, mean absolute error, signal to noise ratio, peak signal to noise ratio, cross correlation have been computed

%Code published has been by Aditya Sundar, Department of Electrical, Electronics and Instrumentation, BITS Pilani KK Birla Goa Campus/ Texas Instruments 

% Please contact me [email protected] if any issues or message me on https://www.researchgate.net/profile/Aditya_Sundar 

% Some potential applications : Biomedical signal denoising measure (ECG, EEG etc), Audio (speech) signal denoising etc.

temp=noisy;
y=denoised;

%MSE %Mean squared error
mse=0;
for i=1:length(temp)
mse=mse+(y(i)-temp(i))^2;
end
mse=mse/length(temp);
fprintf('mean squared error %f\n',mse);

%MAE %Mean absolute error
mae=0;
for i=1:length(temp)
mae=mae+abs(y(i)-temp(i));
end
mae=mae/length(temp);
fprintf('mean absolute error %f\n',mae);


%SNR and PSNR %signal to noise ratio %peak signal to noise ratio
num=0;
den=0;
for i=1:length(temp)
den=den+(y(i)-temp(i))^2;
end
for i=1:length (temp)
num=num+temp(i)^2;
end
SNR = 20*log10(sqrt(num)/sqrt(den));
PSNR= 20*log10(max(temp)/sqrt(mse));
fprintf('signal to noise ratio %f db\n',SNR);
fprintf('peak signal to noise ratio %f db\n',PSNR);


%Cross correlation 
cc = corrcoef(y,temp);
cross_core = cc(1,2);
fprintf('cross correlation %f\n',cross_core);

end
 
Last edited:
Ehler supersmoother and SMA

Some time ago by visual inspection I found out that Ehler Super smoother (see post 281 for his video presentation) performs exactly the same like SMA with half of the Ehler SS period. Now I measured exact SNR of SMA and EhlerSS. Here is a picture.

So I don't know but response of SMA(5) is almost the same like EhlerSS(10) but according to this presentation it should be very different. So either those frequency components which suppouse to be attenuated in price data (aliasing noise, spectral dilation) don't exist (as SNR would differ if they would exist) or there is some bug in his work.
 

Attachments

  • smaEhSS_comp.jpg
    smaEhSS_comp.jpg
    49.3 KB · Views: 401
Last edited:
Wavelet denoising

And here is SNR obtained using Wavelet smoothing. It was measured on 1 min data every 60 min for different observation windows (1 day, 5days, 20 days). Wavelet used was MODWT 'Haar' with hard thresolding
 

Attachments

  • SNR_WAV_comp.jpg
    SNR_WAV_comp.jpg
    58.4 KB · Views: 360
EMD denoising

And here is SNR obtained using Huang's Empirical Mode Decomposition where IMFs with Hurst Exponent < 0.5 are discarded. Very noisy !!!! Ater smoothing with 1000 SMA looks better. Second picture for H=0.5, 0.6 and 0.7.
 

Attachments

  • EMD.jpg
    EMD.jpg
    66.1 KB · Views: 370
  • EMD_comp.jpg
    EMD_comp.jpg
    67 KB · Views: 375
Last edited:
all togehter

and all of them together. Clearly Wavelet seems to look the best but if any of them will improve predictive power of the models its another story....as checked in previous posts EhlerSS actually decreased performance of the predictive algos. When I will get access to my computer infrastructure I will check if Wavelet or EMD give some improvement however to be honest i doubt it....as I see now its not where the money is....

Krzysztof
 

Attachments

  • SNR_comp.jpg
    SNR_comp.jpg
    65.3 KB · Views: 410
Last edited:
Top