Quote from jcl:
Highpass, lowpass, and bandpass filters. This is the lite-C code for a simple second degree lowpass filter:
Code:var smoothF(int period) { return 2./(period+1); } var LowPass(var *Data, int Period) { var *LP = series(*Data,3); var a = smoothF(Period); var a2 = a*a; return LP[0] = (a-a2/4)*Data[0] + 0.5*a2*Data[1] - (a-0.75*a2)*Data[2] + 2*(1.-a)*LP[1] - (1.-a)*(1.-a)*LP[2]; }
This is no moving average. MA crossing strategies are normally not profitable because of lag.
Using such filters in trade strategies is described on a website to which I can't post a link here out of consideration for the sponsors of this forum. I already got chastised by a moderator for posting too much info.
Quote from jcl:
This is no moving average. MA crossing strategies are normally not profitable because of lag.
If a system is profitable depends on many factors, not alone on the filter. But it's certainly easier to write a profitable system with a second order filter, than with an EMA. The filter catches market changes earlier because it has far less lag. You can easily test this when you have a trade platform with a C style language - just replace the EMA with my code above.Quote from ssrrkk:
So you are saying that going from first order to second order filters makes an unprofitable system become profitable. I suppose it's plausible, but I still haven't had the chance to check.
Quote from jcl:
Highpass, lowpass, and bandpass filters. This is the lite-C code for a simple second degree lowpass filter:
Code:var smoothF(int period) { return 2./(period+1); } var LowPass(var *Data, int Period) { var *LP = series(*Data,3); var a = smoothF(Period); var a2 = a*a; return LP[0] = (a-a2/4)*Data[0] + 0.5*a2*Data[1] - (a-0.75*a2)*Data[2] + 2*(1.-a)*LP[1] - (1.-a)*(1.-a)*LP[2]; }
This is no moving average. MA crossing strategies are normally not profitable because of lag.
Using such filters in trade strategies is described on a website to which I can't post a link here out of consideration for the sponsors of this forum. I already got chastised by a moderator for posting too much info.