Can anybody convert the TD Ameritrade indicator to AFL?

input emaLength = 6;
input vsiLength = 14;
input over_bought = 80;
input over_sold = 20;

def ema = ExpAverage(close, emaLength);
def avgVolUp = WildersAverage(if close > ema then volume else 0, vsiLength);
def avgVolDown = WildersAverage(if close < ema then volume else 0, vsiLength);

plot SlowVSI = if avgVolUp + avgVolDown == 0 then 50 else 100 * avgVolUp / (avgVolUp + avgVolDown);
plot OverBought = over_bought;
plot MiddleLine = 50;
plot OverSold = over_sold;

SlowVSI.SetDefaultColor(GetColor(1));
OverBought.SetDefaultColor(GetColor(5));
MiddleLine.SetDefaultColor(GetColor(5));
MiddleLine.SetStyle(Curve.LONG_DASH);
OverSold.SetDefaultColor(GetColor(5));

1 Like

@chaser2009,

It makes it hard for forum members to help you when there is no "Hi" or "Please" or "Thanks"!

1 Like

I'm sorry. I did not mean to come off as rude or demanding.

Try this:

emaLength = 6;
vsiLength = 14;
over_bought = 80;
over_sold = 20;
MiddleLine = 50;

CloseEMA = EMA(close, emaLength);
avgVolUp = Wilders(IIf( Close > CloseEMA, Volume, Null), vsiLength);
avgVolDown = Wilders(IIf( Close < CloseEMA, Volume, Null), vsiLength);
SLowVSI = IIf((avgVolUp + avgVolDown) == 0, 50, 100 * avgVolUp / (avgVolUp + avgVolDown));

Plot(SlowVSI, "SlowVSI", colorBlue, styleLine);
Plot(over_bought, "", colorGrey40, styleDashed);
Plot(MiddleLine, "", colorGrey40, styleDashed);
Plot(over_sold, "", colorGrey40, styleDashed);

1 Like

@chaser2009 What's the name of this indicator? Any article or explanation to this indicator? Interested to read it.
Thanks.

@bursaware I am not sure since @chaser2009 tells us nothing about the logic, origin, or creator of the indicator. But I think the indicator looks like it is from an article in Technical Analysis of Stocks and Commodities by Vitali Apirine.

The Slow Volume Strength Index published in the June 2015 issue but coded in the August 2015 issue.

http://www.amibroker.com/members/traders/08-2015.html

4 Likes

Thanks @portfoliobuilder. I googled SlowVSI and found similar reference to Vitali Apirine. Might be it.

A slight correction after looking at the article @portfoliobuilder provided. They are the same indicator created Vitali Apirine.

emaLength = 6;
vsiLength = 14;
over_bought = 80;
over_sold = 20;
MiddleLine = 50;

CloseEMA = EMA(close, emaLength);
avgVolUp = Wilders(IIf( Close > CloseEMA, Volume, 0), vsiLength);
avgVolDown = Wilders(IIf( Close < CloseEMA, Volume, 0), vsiLength);
SLowVSI = IIf((avgVolUp + avgVolDown) == 0, 50, 100 * avgVolUp / (avgVolUp + avgVolDown));

Plot(SlowVSI, "SlowVSI", colorBlue, styleLine);
Plot(over_bought, "", colorGrey40, styleDashed);
Plot(MiddleLine, "", colorGrey40, styleDashed);
Plot(over_sold, "", colorGrey40, styleDashed);
3 Likes

https://tlc.thinkorswim.com/center/reference/Tech-Indicators/studies-library/R-S/SlowVSI.html
It is SlowVSI, Hope you like!

1 Like

Thank you very much!

These are Slow VSI and Slow RSI indicators, I like both, Thank you very much!