RSM Indicator for ThinkorSwim

Hello people; try this in your custom quote!!

Code:
# RSM_WL
#
#CHANGELOG
# 2021.1.31 - V1.0 [USER=5065]@SuryaKiranC[/USER] - RSM Watch List study - to be used as watchlist:
#              Based on [USER=6343]@cos251[/USER] RSM_SCAN Code.
#            - Stocks currently in UpTrend
#            - Stocks currently in DownTrend
#            - Stocks where UpTrendJustSarted - first bar of UpTrend for scanend TF
#            - Stocks where DownTrendJustStarted - first bar of DownTrend for scanned TF
#            - Stocks where UpTredJustEnded - first NO Trend bar after UpTrend
#            - Stocks where DownTrendJustEnded - first NO Trend bar after DownTrend
#            - Recommend using default studies for SCANS of RSI, Stochastics or MACD for efficiency
#          
#REQUIREMENTS - RSI Set to 7, EXPONENTIAL
#               Stoch Slow 14 and 3 WILDERS
#               MACD 12,26,9 WEIGHTED
#
#
#CREDITS
# requesed by "[USER=4682]@Joseph Patrick 18[/USER]"
#
#LINK
# [URL]https://rockwell-files.s3.amazonaws.com/PXCompanionGuide2ndEd_cover.pdf[/URL]
# Markus Heikoetter who is the author of the Power X Strategy
# [URL]https://usethinkscript.com/threads/mimicking-power-x-strategy-by-markus-heitkoetter.4283/[/URL]
#


def lengthRSI = 7;
def price = close;
def averageTypeRSI = AverageType.EXPONENTIAL;
def NetChgAvg = MovingAverage(averageTypeRSI, price - price[1], lengthRSI);
def TotChgAvg = MovingAverage(averageTypeRSI, AbsValue(price - price[1]), lengthRSI);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
def RSI = 50 * (ChgRatio + 1);


def over_boughtSt = 80;
def over_soldSt = 20;
def KPeriod = 14;
def DPeriod = 3;
def priceH = high;
def priceL = low;
def priceC = close;
def averageTypeStoch = AverageType.WILDERS;
def SlowK = reference StochasticFull(over_boughtSt,  over_soldSt,  KPeriod,  DPeriod,  priceH,  priceL,  priceC,  3, if (averageTypeStoch == 1) then AverageType.SIMPLE else AverageType.EXPONENTIAL).FullK;
def SlowD = reference StochasticFull(over_boughtSt,  over_soldSt,  KPeriod,  DPeriod,  priceH,  priceL,  priceC,  3, if (averageTypeStoch == 1) then AverageType.SIMPLE else AverageType.EXPONENTIAL).FullD;


def fastLength = 12;
def slowLength = 26;
def MACDLength = 9;
def averageTypeMACD = AverageType.WEIGHTED;
def Value = MovingAverage(averageTypeMACD, close, fastLength) - MovingAverage(averageTypeMACD, close, slowLength);
def Avg = MovingAverage(averageTypeMACD, Value, MACDLength);
def Diff = Value - Avg;



# If you want to scan for stocks that are not in either trend you can add two filters and scan for false for both conditions

# The UpTrend and DownTrend plots can be used to scan for stocks that are currently in that trend
def UpTrend = if RSI > 50 and SlowK > 50 and Value > Avg then 1 else 0;
def DownTrend = if RSI < 50 and SlowK < 50 and Value < Avg then 1 else 0;

# The UpTrendJustStarted and DownTrendJustStarted plots can be used to find stocks that have just started
# a trend in either direction
def UpTrendJustStartedBool = if RSI > 50 and SlowK > 50 and Value > Avg then 1 else 0;
def DownTrendJustStartedBool = if RSI < 50 and SlowK < 50 and Value < Avg then 1 else 0;
def UpTrendJustStarted = if UpTrendJustStartedBool == 1 and UpTrendJustStartedBool[1] == 0 then 1 else 0;
def DownTrendJustStarted = if DownTrendJustStartedBool == 1 and DownTrendJustStartedBool[1] == 0 then 1 else 0;
def UpTrendJustEnded = if UpTrendJustStartedBool[1] == 1 and UpTrendJustStartedBool == 0 then 1 else 0;
def DownTrendJustEnded = if DownTrendJustStartedBool[1] == 1 and DownTrendJustStartedBool == 0 then 1 else 0;

def GetTrend = if UptrendJustStarted then 3 else if Uptrend then 2 else if UpTrendJustEnded then 1 else if DownTrendJustStarted then -1 else if DownTrend then -2 else if DownTrendJustEnded then -3 else 0;

AddLabel (yes, if GetTrend == 3 then "UpTrendJustStarted" else if GetTrend == 2 then "UpTrend" else if GetTrend == 1 then "UpTrendJustEnded" else if GetTrend == -1  then "DownTrendJustStarted" else if GetTrend == -2  then "DownTrend" else if GetTrend == -3 then "DownTrendJustEnded" else "NoTrend",Color.BLACK);

AssignBackgroundColor( if GetTrend == 3 then Color.LIGHT_GREEN else if GetTrend == 2 then Color.Green else if GetTrend == -1 then Color.LIGHT_RED else if GetTrend == -2 then Color.RED else Color.WHITE);
 

Volatility Trading Range

VTR is a momentum indicator that shows if a stock is overbought or oversold based on its Weekly and Monthly average volatility trading range.

Download the indicator

Hi @cos251 ,

I just realized something while coding up a Trailing Stop label and price chart marker for my personal use - not really expecting it to be implemented here. Read back through the PowerX book to verify this because I felt something seemed off. Something got overlooked.

We have been using the Close price of the first green candle as the keystone for calculations of the Trend Start price, Entry Price, Target Points and Stop Loss. The book says that when going Long to Enter on the next candle that is .01c above the High of the first green candle that started the trend. It also uses that Entry point for the ATR / ADR Stop Loss and Target points. The inverse being true when going Short, enter at .01c below the Low of first green candle. We should be using the High (or Low) of that green candle as a keystone instead of the Close.

Depending on how tall the first green trend candle is and where the close lands in relation to the high (or low). It does alter where the Targets and Stop Loss points lie. I know these points are not laid in stone as hard, fast rules. Not sure how close you want your calculations to be to the original idea that spawned this creation. Just thought I would mention this. Am rethinking how I did some of my coding to adapt.

Cheers,
Rick
 
Last edited by a moderator:
Sorry for the basic question. I can't get the script for RSM MTF Labels to display at the top. The labels do not look like the 1st post where all the time frames are displayed at the top. The only thing I see is one label "D". When I go into the settings, I can only choose one time frame, instead of having all of them displayed. I've reset TOS to the default. Thank you for all the wonderful work here!
 
@thinkscriptnewb you need to add that script again for each individual time frame you want. Then set each one separately per the time desired. So if you want 30min, 1hr, day, week on your chart then you need to add it four times.

Features
  1. Provides chart labels (upper left corner of price chart) with current status of MTF RSM Trend for the following TF's
    1. 1m, 2m, 3m, 4m, 5m, 10m, 15m, 20m, 30m, 1h, 2h, 4h, 1d, 2d, 3d, 4d, 1wk, 1mnth
    2. Add indicator for each time frame you would like shown


edit - Welcome to the forums. :) (y)
 
Last edited by a moderator:
Sorry for the basic question. I can't get the script for RSM MTF Labels to display at the top. The labels do not look like the 1st post where all the time frames are displayed at the top. The only thing I see is one label "D". When I go into the settings, I can only choose one time frame, instead of having all of them displayed. I've reset TOS to the default. Thank you for all the wonderful work here!
The Indicator need to be added to your setup multiple times each one set to a different timeframe like @RickAns suggested, and only the labels from the current chart timeframe and above will display.

EX: if you configured every available timeframe and looking at 30m chart only labels from 30m,1H,2H and above will display. In 1m charts all the configured labels will display.
 
I'm curious for swing trading if folks are adjusting the ADR and associated profit levels/stop loss when occupying a position for multiple days or does the initial ADR and associated profit levels/stop loss get locked in until exiting the position.
 
That is why I am trying to find a good way to adapt a trailing stop of some kind to this also. For stocks that have climbed above the original ADR profit targets and continues to run while the trend is still green and strong. Like SPCE for example, $25+ above the last ADR mark and still moving it seems.
 
I did notice a difference in a few (but not all) situations @SuryaKiranC between the SlowK(14) and SlowD(3). I should have taken screencaps but was busy with something else at the time. The exits seemed the same for both but occasionally the SlowD entered a position a few bars later than the SlowK. Which is opposite of what I would have thought would happen. An instance that sticks out in my mind is SlowK got in just before a small dip of a few bars and SlowD got in just after the dip. I want to go back and examine it more to see if I can recreate that. I have modified some coding since then. Will keep you updated if you are interested.

Thanks for asking @dominos101. My original stop marker labels display differently depending on if using ATR or ADR for the calculations. How are you mostly using this.... daily or intraday? I have a few ideas I am working on to see what works best. Will let you know.
 
What indicators time frames or strategies do you all like to add to this strategy to increase the winning Percentage?
I like longs only when price is above the 200 EMA and not pulled to far away from 20 EMA.
 
Hello
I have a question the lower RSM just shows the RSI and doesn't show the MACD and Stochastic. can you help me with that

thank you
 
For the lower study (Stochastic) are you guys using the settings in the screen shot ( 5,3) or the 14, 3 like the upper study?
 
For the lower study (Stochastic) are you guys using the settings in the screen shot ( 5,3) or the 14, 3 like the upper study?
14, 3 for Stochastic across the board, Including the scanners, as per the original Strategy guide. If you like to change and play with them, I would recommend 2 sets of studies, and make sure each set is a match for your parameters and do some side-by-side comparison.

-S
 
14, 3 for Stochastic across the board, Including the scanners, as per the original Strategy guide. If you like to change and play with them, I would recommend 2 sets of studies, and make sure each set is a match for your parameters and do some side-by-side comparison.

-S
Does the up/down arrow only display on the daily chart? I don't see it on the weekly, monthly, or yearly
 
How are you guys calculating portion size? I am playing with say 5000 $ per play, some larger stocks the stop loss might be -75 . Other smaller ones with a big candle the stop loss might be -570
Whats the best strategy here to keep it even across the board? Because in his pdf and videos its saying even if you're right 50% of the time you still make a profit because of the stop losses
 
How are you guys calculating portion size? I am playing with say 5000 $ per play, some larger stocks the stop loss might be -75 . Other smaller ones with a big candle the stop loss might be -570
Whats the best strategy here to keep it even across the board? Because in his pdf and videos its saying even if you're right 50% of the time you still make a profit because of the stop losses

I think he(Markus) sets his stops at 1.5*ADR

and position size is your risk amount/1.5ADR

So if your risking $100 on a stock that cost $25 and the ADR is 2

1.5 * adr = 3 so your stop is at $22

100(risk)/3(1.5ADR) = 33.33shares **position size

(total cost of trade 33 shares *$25= $833)

take profit is 3*adr so 6+25=31
 
Does anyone use this indicator to trade live? It looks nice backtesting but when I tested it in real time I found that you have to wait three bars after the initial signal for confirmation that the signal is actually valid. By that time you're usually too late. If anyone does use it, I'd be interested to know how you are able to compensate for this disadvantage.
I use it live to swing trade. I use the daily timeframe as my entry as originally designed also W would be in trend as well for a better entry I use the 65min/30min also in trend as the signal to enter the trade.
 

New Indicator: Buy the Dip

Check out our Buy the Dip indicator and see how it can help you find profitable swing trading ideas. Scanner, watchlist columns, and add-ons are included.

Download the indicator

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
284 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