mbarcala
Active member
Here I bring you ASI, (Absolute Strength Indicator). I saw it in Trading view. I tried simultaneously while I operating in TOS platform, and now finally get it converted with the HELP a friend IgorF. You can change and play with the settings as you like and try the 3 option that come inside as RSI, Stochastic and ADX.
Original trading view link: https://www.tradingview.com/script/WbkLdhzL-Absolute-Strength-MTF-Indicator/
Photos:
Script:
As I always think if you try please share your experience!
Original trading view link: https://www.tradingview.com/script/WbkLdhzL-Absolute-Strength-MTF-Indicator/
Photos:
Script:
Code:
# Absolute Strength Indicator converter to TOS by mbarcala and IgorF
# Original TradingView Code: https://www.tradingview.com/script/WbkLdhzL-Absolute-Strength-MTF-Indicator/ by alexgrover
declare lower;
input length = 20;
input Smooth = 5;
input Mode = {default RSI, STOCHASTIC, ADX};
input Ma = {default SMA, EMA, LSMA};
def Bulls;
def Bears;
switch (Mode) {
case RSI:
Bulls = 0.5 * (AbsValue(close - close[1]) + (close - close[1]));
Bears = 0.5 * (AbsValue(close - close[1]) - (close - close[1]));
case Stochastic:
Bulls = close - Lowest(close, length);
Bears = Highest(close, length) - close;
case ADX:
Bulls = 0.5 * (AbsValue(high - high[1]) + (high - high[1]));
Bears = 0.5 * (AbsValue(low[1] - low) + (low[1] - low));
}
def AvgBulls;
def AvgBears;
def SmthBulls;
def SmthBears;
switch (Ma) {
case SMA:
AvgBulls = SimpleMovingAvg(Bulls, length);
AvgBears = SimpleMovingAvg(Bears, length);
SmthBulls = SimpleMovingAvg(AvgBulls, Smooth);
SmthBears = SimpleMovingAvg(AvgBears, Smooth);
case EMA:
AvgBulls = ExpAverage(Bulls, length);
AvgBears = ExpAverage(Bears, length);
SmthBulls = ExpAverage(AvgBulls, Smooth);
SmthBears = ExpAverage(AvgBears, Smooth);
case LSMA:
AvgBulls = InertiaAll(Bulls, length, 0);
AvgBears = InertiaAll(Bears, length, 0);
SmthBulls = InertiaAll(AvgBulls, Smooth, 0);
SmthBears = InertiaAll(AvgBears, Smooth, 0);
}
def trend = if SmthBulls > SmthBears then 1 else -1;
plot sgnBull = SmthBulls;
sgnBull.SetDefaultColor(CreateColor(0, 101, 255));
sgnBull.SetLineWeight(5);
sgnBull.HideBubble();
sgnBull.HideTitle();
plot sgnBear = SmthBears;
sgnBear.SetDefaultColor(CreateColor(230,15,88));
sgnBear.SetLineWeight(5);
sgnBear.HideBubble();
sgnBear.HideTitle();
AddCloud(SmthBulls, SmthBears, CreateColor(0, 101, 255), CreateColor(230,17,125));
plot cDot = if SmthBulls crosses above SmthBears then SmthBulls else if SmthBulls crosses below SmthBears then SmthBears else Double.NaN;
cDot.SetPaintingStrategy(paintingStrategy.POINTS);
cDot.SetDefaultColor(Color.WHITE);
cDot.SetLineWeight(2);
cDot.HideBubble();
cDot.HideTitle();
#for scanner purpose only, you need to change the other plots on top as def and uncomment this to at the bottom!
#plot upBull = sgnBull crosses above sgnBear;
#plot dnBear = sgnBull crosses below sgnBear;
As I always think if you try please share your experience!
Last edited: