logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
metalog  
#1 Posted : Friday, September 27, 2013 10:51:10 AM(UTC)
metalog

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/26/2013(UTC)
Posts: 1

please dear coders, convert this EasyLanguage formula to metastock..
details here: http://www.stockspotter....PredictiveIndicators.pdf
the formula is..

{
My Stochastic Indicator © 2013 John F. Ehlers
}
Inputs: Length(20);
Vars: alpha1(0), HP(0), a1(0), b1(0), c1(0), c2(0), c3(0) , Filt(0), HighestC(0), LowestC(0), count(0), Stoc(0), MyStochastic(0);

//Highpass filter cyclic components whose periods are shorter than 48 bars
alpha1 = (Cosine(.707*360 / 48) + Sine (.707*360 / 48) -1) / Cosine(.707*360 / 48);
HP = (1-alpha1 / 2)*(1-alpha1 / 2)*(Close-2*Close[1] + Close[2]) + 2*(1-alpha1)*HP[1]-(1alpha1)*(1-alpha1)*HP[2];

//Smooth with a Super Smoother Filter
a1 = expvalue(-1.414*3.14159 / 10);
b1 = 2*a1*Cosine(1.414*180 / 10);
c2 = b1;
c3 = -a1*a1;
c1 = 1 -c2 -c3;
Filt = c1*(HP + HP[1]) / 2 + c2*Filt[1] + c3*Filt[2];

HighestC = Filt;
LowestC = Filt;
For count = 0 to Length -1 Begin
If Filt[count] > HighestC then HighestC = Filt[count];
If Filt[count] < LowestC then LowestC = Filt[count];
End;
Stoc = (Filt - LowestC) / (HighestC - LowestC);

MyStochastic = c1*(Stoc + Stoc[1]) / 2 + c2*MyStochastic[1] + c3*MyStochastic[2];

Plot1(MyStochastic);
Plot2(.8);
Plot6(.2);



Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.