Technical Method For Rating Stocks For ThinkOrSwim

mc01439

Well-known member
2019 Donor
VIP
I have been using this rating system as part of a longer term trading strategy on WealthLab.

Would like to use on TOS as well but TDAmeritrade did not summit the code for this Technical Analysis of Stocks & Commodities June 2018 article. Anyone like to take a shot at the code.
 
Last edited by a moderator:

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
Technical Stock Rating Labels

This TOS indicator provides labels that are colored blue and only appear when bullish conditions exist
(the blue labels on chart are the default)

GepxtdL.png


With this modified version of the indicator, the labels always appear: green colored for Bullish and Red for Bear.

Also added an additional label "score" which is defined in the TOS Technical Stock Rating Strategy.

Ruby:
# TOS TechnicalStockRating

input vfiLength = 130;
input averageLength = 100;
input trendQualityLength = 63;
input maxStiffness = 7;
input marketIndex = "SPY";
input weightForMoneyFlow = 1.0;
input weightForTradingAboveAverage = 1.0;
input weightForUptrend = 1.0;
input weightForTrendQuality = 1.0;
input weightForMarketDirection = 2.0;

def vfi = reference VolumeFlowIndicator(length = vfiLength, "max volume cut off" = 2.5);
def sma = Average(close, averageLength);
def ema = ExpAverage(close(marketIndex), averageLength);
def stiffness = Sum(close < sma, trendQualityLength);

def Score;
def MoneyFlow = vfi > 0;
def TradingAboveAverage = close > sma;
def Uptrend = sma > sma[4];
def TrendQuality = stiffness <= maxStiffness;
def MarketDirection = ema >= ema[2];

Score = weightForMoneyFlow * MoneyFlow + weightForTradingAboveAverage * TradingAboveAverage + weightForUptrend * Uptrend + weightForTrendQuality * TrendQuality + weightForMarketDirection * MarketDirection;

DefineGlobalColor("Pre_Cyan", CreateColor(50, 200, 255)) ;
DefineGlobalColor("LabelGreen",  CreateColor(0, 165, 0)) ;
DefineGlobalColor("LabelRed",  CreateColor(225, 0, 0)) ;
AddLabel(yes, "Score=" +score,
         if Score> 5 then GlobalColor("Pre_Cyan") else
         if Score==5 then GlobalColor("LabelGreen") else GlobalColor("LabelRed"));
AddLabel(yes, "Money flow",
         if MoneyFlow then GlobalColor("LabelGreen") else GlobalColor("LabelRed"));
AddLabel(yes, "Trading above average",
         if TradingAboveAverage then GlobalColor("LabelGreen") else GlobalColor("LabelRed") );
AddLabel(yes, "Uptrend",
         if Uptrend then GlobalColor("LabelGreen") else GlobalColor("LabelRed"));
AddLabel(yes, "Trend quality",
         if TrendQuality then GlobalColor("LabelGreen") else GlobalColor("LabelRed"));
AddLabel(yes, "Market direction",
         if MarketDirection then GlobalColor("LabelGreen") else GlobalColor("LabelRed"));
 
Last edited:
@MerryDay You're awesome... works like a charm... now if I can only get the daily trend range problem fixed, I'll be golden. THANKS !! Wow... all my stocks are 5's and 6's... ugh... That's strong sell, right?
 
Last edited:

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
@Ronathan Edwards

As per the TOS Technical Stock Rating Strategy:
"The stock symbol receives one point for meeting each of the above criteria if all the weights are set to 1.0. By default, only the "overall market direction" weight is equal to 2.0; however, you are free to assign the weights according to your preferences.
By default, the strategy adds a simulated buy to open order if the currently selected stock receives a rating score of 5.0 or higher"


A 6 is a perfect rating. A 5 is a strong indicator
 
  • Like
Reactions: xad

kls06541

Member
VIP
Technical Stock Rating Labels

This TOS indicator provides labels that are colored blue and only appear when bullish conditions exist
(the blue labels on chart are the default)

GepxtdL.png


With this modified version of the indicator, the labels always appear: green colored for Bullish and Red for Bear.

Also added an additional label "score" which is defined in the TOS Technical Stock Rating Strategy.

Here is the study link: http://tos.mx/N2Wufe3
Can the Score be scanned, please?

How about searching for all items with Score greater than 3?
 

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
Can the Score be scanned, please?

How about searching for all items with Score greater than 3?
Add this to the bottom of the script:
Ruby:
plot scan = score > 3 ;
In the scan hacker:
Ruby:
scan is true
 

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.
Top