Trading Strategies Based On Digital Filters - page 83

 

...

Now that hatchets are buried (for good I hope), I want to congratulate to all of you taking part in the joint efforts of the past few days.

Isn't it better than quarreling?

regards to all of you

mladen

 

leledc

"If x is less than -1 or exceeds 1, the MathArccos(x) returns NaN (indeterminate value)." I did not get that error in testing but to make it safe all you need to change is this (line 253):

w=MathArccos(b/2.0);[/php]to this : [php] w=MathArccos(MathMax(MathMin(b/2.0,1),-1));

regards

mladen

leledc:
I have made a mistake:that was an experiment based on Double stoch ...Now i'll correct the mistake.Thanks

P.s. i'm working on an ea to set best FFT settings in automated mode but there is a problem:when i launch the ea i have this

2010.01.18 16:47:30 Fourier_Extrapolation_of_Indicator Color 1.2 EURUSD,M5: invalid value for MathArccos function.

I don't know how to correct the error(i have tried but without success)...Mladen if you are here please can you give me your great help?????Thank you
 

simba,leledc and company

how can we get this,?could you explain this simba?i want to take the turns...

Files:
gbpjpyh4.gif  79 kb
 

take the turns

learntrader:
how can we get this,?could you explain this simba?i want to take the turns...

Learntrader,

I suggested you one way to train yourself in using a tool for trading....What about the 2 days of training?

Now,you are again falling prey of the HG search...

There is no HG,there are only good and bad tools and good and bad ways to use them,that`s all.

The most important tool is price behaviour at support and resistance...then with these kind of Fouriers and a good strategy you can get an additional edge...BUT,you will never catch all the turns.

I think that even mladen catches at most 92% of the turns,and MrTools probably can get 89% of them at best.

Regards

S

 
learntrader:
how can we get this,?could you explain this simba?i want to take the turns...

Yes what makes the arrow on charts ?

Didn't understand clearly guys, sorry about that.

Forgot my intelligence pills today.

 
mrtools:
Hi Leledc, Not sure but this may be similar to what your looking for.

Oh thank you but i have made a double post(in tradestation thread too)and mladen has yet suggested the same solution as you!Thanks

 
Big Joe:
Yes what makes the arrow on charts ?

Didn't understand clearly guys, sorry about that.

Forgot my intelligence pills today.

If i remeber well Simba uses supersignals for those arrows...

 
leledc:
Oh thank you but i have made a double post(in tradestation thread too)and mladen has yet suggested the same solution as you!Thanks

Woops didn't see that Mladen had answered you over there posting the other version.

 
leledc:
Hi I have a tradestation fucntion:i 'd like to convert it in mql(to port a tradestation indi in mt4).Below original and my version of function in mql.It doesn't work well so i'd like an help from some expert here.thanks

Easylanguage

{Gaussian Filter}

Inputs: Price(NumericSeries), iptPeriod(NumericSimple), iptPoles(NumericSimple);

variables: aa(0), b(0), w(0), x(0), y(0), y1(0), y2(0), y3(0), y4(0),

a_1(0), a_12(0), a_13(0), a_14(0), a2(0), a3(0), a4(0), Pi(3.141592654),

sqrtOf2(1.414213562), Period(2), poles(0);

if (iptPeriod < 2) then

Period = 2

else

Period = iptPeriod;

// Number of filter poles must be between 1 and 4, inclusive

if iptPoles < 1 then

poles = 1

else if iptPoles > 4 then

poles = 4

else

poles = iptPoles;

// initialization - performed only for first bar

if CurrentBar = 1 then

begin

w = 2 * Pi / Period; // omega

w = 180 * w / Pi; // in degrees

b = (1 - cosine(w)) / (power(sqrtOf2, 2.0/poles) - 1.0);

aa = -b + squareroot(b*b + 2*b);

a_1 = 1.0 - aa;

a_12 = a_1 * a_1;

a_13 = a_1 * a_1 * a_1;

a_14 = a_12 * a_12;

a2 = aa * aa;

a3 = aa * aa * aa;

a4 = a2 * a2;

y1 = Price;

y2 = y1;

y3 = y2;

y4 = y3;

end;

{ Calculate your indicator value here }

x = Price;

if (poles = 1) then

y = aa * x + a_1 * y1

else if (poles = 2) then

y = a2 * x + 2 * a_1 * y1 - a_12 * y2

else if (poles = 3) then

y = a3 * x + 3 * a_1 * y1 - 3 * a_12 * y2 + a_13 * y3

else if (poles = 4) then

y = a4 * x + 4 * a_1 * y1 - 6 * a_12 * y2 + 4 * a_13 * y3 - a_14 * y4;

y4 = y3; // delayed by four bars

y3 = y2; // delayed by three bars

y2 = y1; // delayed by two bars

y1 = y; // delayed by one bar

Gauss = y;

[/php]Mql

[php]

double Gauss(double Price, double iptPeriod,double iptPoles){

double aa, b, w, x, y, y1, y2, y3, y4,a_1, a_12, a_13, a_14, a2, a3, a4;

double Pi=3.141592654;

double period=21, poles;

if (iptPeriod < 2)

period = 2;

else

period = iptPeriod;

if (iptPoles < 1){

poles = 1;

}

else if (iptPoles > 4){

poles = 4;

}

else{

poles = iptPoles;

}

// initialization - performed only for first bar

for(int i = Price; i >= 0; i--){

w = 2 * Pi / period; // omega

w = 180 * w / Pi; // in degrees

b = (1 - MathCos(w)) / (MathPow(MathSqrt(2.0),2.0/poles) - 1.0);

aa = -b + MathSqrt(b*b + 2*b);

a_1 = 1.0 - aa;

a_12 = a_1 * a_1;

a_13 = a_1 * a_1 * a_1;

a_14 = a_12 * a_12;

a2 = aa * aa;

a3 = aa * aa * aa;

a4 = a2 * a2;

y1 = Price;

y2 = y1;

y3 = y2;

y4 = y3;

}

for(i = Price; i >= 0; i--){

x = Price;

y = a4 * x + 4 * a_1 * y1 - 6 * a_12 * y2 + 4 * a_13 * y3 - a_14 * y4;//we don't need y1 y2 y3 y4

}

return (y);

}

Hi Leledc,

Not sure but this may be similar to what your looking for.

EDIT: Posted wrong version correct version on post#841

 
leledc:
If i remeber well Simba uses supersignals for those arrows...

Thanks !

Reason: