Hello Team,
I'm wondering if someone would be able to customize a script to add all the scores from all colums into a final number. At this point i'm exporting everything into excel using math formulas to come up with the final score but this process is taking up lots of my time.
Here is the script i use. which gives me this scores on different time frames as you can see on the attachment. Just looking for a script that would add all colums and give me the final score which is = 296.
Thank you for taking the time to read this post and greately appreciate any help
I'm wondering if someone would be able to customize a script to add all the scores from all colums into a final number. At this point i'm exporting everything into excel using math formulas to come up with the final score but this process is taking up lots of my time.
Here is the script i use. which gives me this scores on different time frames as you can see on the attachment. Just looking for a script that would add all colums and give me the final score which is = 296.
| RHI | 29.32 | 41 | 38 | 38 | 41 | 20 | 41 | 39 | 38 | Total score =296 |
Thank you for taking the time to read this post and greately appreciate any help
Code:
declare lower;
input length = 13;
input over_Bought = 70;
input over_Sold = 30;
input price = close;
input averageType = AverageType.WILDERS;
input showBreakoutSignals = yes;
input showRSI = yes;
input showMidLines = yes;
input showRsiChartLabel = yes;
input rsiLabelDecimals = 0;
input showStartTimeLine = yes;
input showEndTimeLine = yes;
input startTime = 0930;
input endTime = 1600;
input showHorRsiLine = yes;
input showAvgRsi = yes;
input avgRsiLength = 3;
input avgRsiAverageType = 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);
plot OverSold = over_Sold;
plot OverBought = over_Bought;
plot UpSignal = if RSI <= OverSold then OverSold else Double.NaN;
plot DownSignal = if RSI >= OverBought then OverBought else Double.NaN;
plot forty = if showMidLines then 40 else Double.NaN;
forty.SetDefaultColor(Color.LIGHT_GRAY);
forty.SetPaintingStrategy(PaintingStrategy.DASHES);
forty.SetLineWeight(1);
plot fifty = if showMidLines then 50 else Double.NaN;
fifty.SetDefaultColor(Color.ORANGE);
fifty.SetPaintingStrategy(PaintingStrategy.DASHES);
fifty.SetLineWeight(1);
plot sixty = if showMidLines then 60 else Double.NaN;
sixty.SetDefaultColor(Color.LIGHT_GRAY);
sixty.SetPaintingStrategy(PaintingStrategy.DASHES);
sixty.SetLineWeight(1);
RSI.DefineColor("OverBought", GetColor(6));
RSI.DefineColor("Normal", GetColor(7));
RSI.DefineColor("OverSold", GetColor(1));
RSI.AssignValueColor(if RSI > over_Bought then RSI.color("OverBought") else if RSI < over_Sold then RSI.color("OverSold") else RSI.color("Normal"));
RSI.SetHiding(!showRSI);
OverSold.SetDefaultColor(GetColor(8));
OverBought.SetDefaultColor(GetColor(8));
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.POINTS);
UpSignal.SetLineWeight(5);
UpSignal.SetHiding(!showBreakoutSignals);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.POINTS);
DownSignal.SetLineWeight(5);
DownSignal.SetHiding(!showBreakoutSignals);
#Place vertical lines at start and end times
def startTimeValue = SecondsFromTime(StartTime) == 0;
def endTimeValue = SecondsFromTime(endTime) == 0;
def aggOk = if GetAggregationPeriod() < AggregationPeriod.DAY then 1 else Double.NaN;
AddVerticalLine(aggOk and showStartTimeLine and startTimeValue,"Start",Color.GREEN,Curve.SHORT_DASH);
AddVerticalLine(aggOk and showEndTimeLine and endTimeValue,"End",Color.RED,Curve.SHORT_DASH);
#Display RSI Chart Label
AddLabel(showRsiChartLabel, " " + Round(rsi, rsiLabelDecimals), if rsi < over_Sold then RSI.color("OverSold") else if rsi > over_Bought then RSI.color("OverBought") else RSI.color("Normal"));
#Plot moving rsiLine across chart at current RSI level
plot rsiLine = if showHorRsiLine then HighestAll(if !IsNaN(RSI) and IsNaN(RSI[-1]) then RSI else Double.NaN) else Double.NaN;
rsiLine.SetDefaultColor(Color.BLACK);
rsiLine.AssignValueColor(if RSI > over_Bought then RSI.color("OverBought") else if RSI < over_Sold then RSI.color("OverSold") else RSI.color("Normal"));
rsiLine.SetPaintingStrategy(PaintingStrategy.LINE_VS_TRIANGLES);
rsiLine.SetLineWeight(1);
#Trending Color Average Line
plot avgRsi = if showAvgRsi then MovingAverage(avgRsiAverageType, RSI, avgRsiLength) else Double.NaN;
avgRsi.DefineColor("UpTrend", Color.GREEN);
avgRsi.DefineColor("DownTrend", Color.RED);
avgRsi.SetLineWeight(2);
avgRsi.SetPaintingStrategy(PaintingStrategy.LINE);
avgRsi.SetStyle(Curve.FIRM);
avgRsi.AssignValueColor(if avgRsi > avgRsi[1] then avgRsi.Color("UpTrend") else avgRsi.Color("DownTrend"));
#END - RSI_Extreme
Last edited by a moderator: