Adding Colums for final result

Jcabrales

New member
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.


RHI29.324138384120413938Total score =296
1769777025399.png


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:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
1738 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top