PureBytes Links
Trading Reference Links
|
--- In amibroker@xxxxxxxxxxxxxxx, "JD Fagan" <jd.fagan@xxx> wrote:
>
> --- In amibroker@xxxxxxxxxxxxxxx, "l_abarr" <l_abarr@> wrote:
> >
> > Hi,
> >
> > Does anyone know how to code William Blau's Tick Volume Indicator?
> > Blau defines TVI in this manner:
> >
> > TVI (r,s) = [Double EMA(upticks,r,s)-Double EMA(downticks,r,s)]/
> > [Double EMA(upticks,r,s)+Double EMA(downticks,r,s)]
> >
> > I really appreciate help from anyone. I'm obviously poor at coding...
> >
> Wasn't sure what the r and s meant, but here's a shot with assumption
> that uptick is when rate of change since last bar is 0% or up and
> downtick is less than 0%:
>
> function tvi(array, periods) {
> upticks = Cum(ROC(array, 1) >= 0);
> downticks = Cum(ROC(array, 1) < 0);
> return (DEMA(upticks, periods) - DEMA(downticks, periods)) /
> (DEMA(upticks, periods) + DEMA(downticks, periods));
> }
>
> //Example usage
> Plot(tvi(Close, 10), "Blau's TVI for Close", colorBlue, styleLine);
> Plot(tvi(Volume, 10), "Blau's TVI for Volume", colorGreen, styleLine);
>
This may be more what you wanted for upticks vs. downticks..it seems
to generate more oscillating type lines:
upticks = Sum(ROC(array, 1) >= 0, periods);
downticks = Sum(ROC(array, 1) < 0, periods);
JD
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/
|