[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Help for Klinger Volume Oscillator (KVO)



PureBytes Links

Trading Reference Links

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" <hitash_pandya@xxxxxxxxxxx>
> 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
> 
> 



------------------------------------

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

--- Begin Message ---

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="">

Thanks in advance.
Hitesh


--- End Message ---