Skippidooo
New member
Could someone please add necessary code to make this script multiple time frame?
Thank You In Advance.
declare lower;
input length = 14;
input price = close;
input averageType = AverageType.WILDERS;
def NetChgAvg = MovingAverage(averageType, price - price[1], length);
def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
plot RSI = 50 * (ChgRatio + 1);
input average1Type = AverageType.SIMPLE;
input average1Length = 9;
input average2Type = AverageType.WILDERS;
input average2Length = 45;
plot avg1 = MovingAverage(average1Type, RSI, average1Length);
avg1.setDefaultColor(Color.GREEN);
plot avg2 = MovingAverage(average2Type, RSI, average2Length);
avg2.setDefaultColor(Color.RED);
avg1.SetPaintingStrategy(PaintingStrategy.LINE_VS_POINTS);
avg1.SetLineWeight(2);
avg1.DefineColor("Up", Color.GREEN);
avg1.DefineColor("Down", Color.RED);
avg1.DefineColor("Flat", Color.GRAY);
avg1.AssignValueColor(if avg1[0] > avg1[1] then avg1.Color("Up") else if avg1[0] <
avg1[1] then avg1.Color("Down") else avg1.Color("Flat"));
def cond1 = if rsi > avg1
then Double.POSITIVE_INFINITY
else Double.NEGATIVE_INFINITY;
def cond2 = if rsi < avg1
then Double.POSITIVE_INFINITY
else Double.NEGATIVE_INFINITY;
input showclouds = yes;
AddCloud(if showclouds
then cond1
else Double.NaN,
cond2,
Color.dark_GREEN, Color.Dark_RED);
Thank You In Advance.
declare lower;
input length = 14;
input price = close;
input averageType = AverageType.WILDERS;
def NetChgAvg = MovingAverage(averageType, price - price[1], length);
def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
plot RSI = 50 * (ChgRatio + 1);
input average1Type = AverageType.SIMPLE;
input average1Length = 9;
input average2Type = AverageType.WILDERS;
input average2Length = 45;
plot avg1 = MovingAverage(average1Type, RSI, average1Length);
avg1.setDefaultColor(Color.GREEN);
plot avg2 = MovingAverage(average2Type, RSI, average2Length);
avg2.setDefaultColor(Color.RED);
avg1.SetPaintingStrategy(PaintingStrategy.LINE_VS_POINTS);
avg1.SetLineWeight(2);
avg1.DefineColor("Up", Color.GREEN);
avg1.DefineColor("Down", Color.RED);
avg1.DefineColor("Flat", Color.GRAY);
avg1.AssignValueColor(if avg1[0] > avg1[1] then avg1.Color("Up") else if avg1[0] <
avg1[1] then avg1.Color("Down") else avg1.Color("Flat"));
def cond1 = if rsi > avg1
then Double.POSITIVE_INFINITY
else Double.NEGATIVE_INFINITY;
def cond2 = if rsi < avg1
then Double.POSITIVE_INFINITY
else Double.NEGATIVE_INFINITY;
input showclouds = yes;
AddCloud(if showclouds
then cond1
else Double.NaN,
cond2,
Color.dark_GREEN, Color.Dark_RED);