Hi!!
Thanks a lot to Roser and Mohany.
Regards
Hitesh
[EMAIL PROTECTED] wrote:
This may work. Need to compare the plots with a known graph.
_SECTION_BEGIN("Klinger Oscillator");
x = H+L+C;
trend = IIf(x>Ref(x,-1), 1, -1);
//trend = Cum(trend0);
dm = (H-L);
trend_dif = trend - Ref(trend, -1);
cm_today = IIf(trend_dif != 0, Ref(dm, -1), 0);
sf = IIf(trend_dif !=0, 1, 0); //Smoothing factor -- 1 or '0'
fb = IIf(trend_dif == 0, 1, 0); // feedback factor -- 1 or '0', gets yerterdays
value through AMA
//Cm0 = dm + fb * AMA(cm_today, 0);
cm = dm + sf*Ref(dm, -1) + fb * AMA(cm_today, 0);
Vf0 = (dm/cm -1 ) *2;
Vf = Vf0 * V *trend*100;
KO = EMA(Vf,34) - EMA(Vf,55);
Plot(ko, _DEFAULT_NAME(), ParamColor( "Color", colorBlue ), ParamStyle("Style")
);
_SECTION_END();
-------------- Original message ----------------------
From: "hitash_pandya"
> Hello,
> I am looking for the Klinger Volume Oscillator (KVO) in afl script.
> May I request help for this ?
> AFL written by me is not seems to be accurare. I think, Loop should
> be used in AFL, which I am not conversent with. AFL written by me is
> as under:-
>
> /////////////////////////////////////////////////////////////////
> a=H+L+C;
> b=Ref(a,-1);
> Trend=IIf(a > b, 1,-1);
> //dm = daily movement
> dm = H - L;
> Cm = Cum(dm);
> Cm = IIf(trend=-1,Ref(Cm,-1)+dm, Ref(dm,-1) + dm);
> Vf= V * (2 *( dm/Cm -1)) * trend * 100;
> KO = EMA(Vf,34) - EMA(Vf,55);
> Plot(ko,"KO",colorBlue,styleLine);
> TL = EMA(KO,13);
> Plot(TL,"TL",colorBlue,styleLine);
> ////////////////////////////////////////////////////////////////
>
> Mathamatical Experssion of KVO availabe at:-
> http://www.fmlabs.com/reference/default.htm?url=KO.htm
>
> Thanks in advance.
> Hitesh
>
>
From: "hitash_pandya" <[EMAIL PROTECTED]>
To: [email protected]
Subject: [amibroker] Help for Klinger Volume Oscillator (KVO)
Date: Fri, 11 Apr 2008 07:21:50 +0000
Hello,
I am looking for the Klinger Volume Oscillator (KVO) in afl script.
May I request help for this ?
AFL written by me is not seems to be accurare. I think, Loop should
be used in AFL, which I am not conversent with. AFL written by me is
as under:-
/////////////////////////////////////////////////////////////////
a=H+L+C;
b=Ref(a,-1);
Trend=IIf(a > b, 1,-1);
//dm = daily movement
dm = H - L;
Cm = Cum(dm);
Cm = IIf(trend=-1,Ref(Cm,-1)+dm, Ref(dm,-1) + dm);
Vf= V * (2 *( dm/Cm -1)) * trend * 100;
KO = EMA(Vf,34) - EMA(Vf,55);
Plot(ko,"KO",colorBlue,styleLine);
TL = EMA(KO,13);
Plot(TL,"TL",colorBlue,styleLine);
////////////////////////////////////////////////////////////////
Mathamatical Experssion of KVO availabe at:-
http://www.fmlabs.com/reference/default.htm?url=KO.htm
Thanks in advance.
Hitesh
---------------------------------
Did you know? You can CHAT without downloading messenger. Click here