Archives: RSM Indicator for ThinkorSwim

Status
Not open for further replies.
If I am looking for Swing, I would normally look for RSL/Stoch/ MACD if they were starting from bottom and cracking their mid lines or dropping from top and turned around any crossing mid lines, if it is the later I would be cautious. Timeframes 1D, 4H,2H & 1H.

-S
on all time frames RSI?Stoc/MACD should be above mid lines coming from bottom?
 
Amazing work that you and all the collaboration members have been working together to come up with this. Absolutely amazing! So much work and efforts and spirit of giving and kindness that you all have. Thank you very much!!! I especially love the upper chart and the lower chart that use MACDonly for its calculation. I am wondering if this MACDonly configuration can turn into a watchlist in which it identifies cross over that potentially signal the bull/bear trend? This will be a powerful column in my opinion that we can quickly see on our WL.

Thanks again to all for your contribution!

Best Regards!
 
This is excellent work. I have successfully put the scanner and indicator into TOS. I am trying to utilize the RSM_WL. How do I install that?
 
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);
 
I still have to go through this entire thread and load the scripts as well, but can anyone here kindly advise if these scripts can be used on the Futures instruments like ES, NQ etc or is this mainly geared towards stocks?
 
Amazing work that you and all the collaboration members have been working together to come up with this. Absolutely amazing! So much work and efforts and spirit of giving and kindness that you all have. Thank you very much!!! I especially love the upper chart and the lower chart that use MACDonly for its calculation. I am wondering if this MACDonly configuration can turn into a watchlist in which it identifies cross over that potentially signal the bull/bear trend? This will be a powerful column in my opinion that we can quickly see on our WL.

Thanks again to all for your contribution!

Best Regards!
is there anyway to turn the grey bars into white bars? ive tried manually but it will not work
 
Hi, @cos251. I was thinking how handy your labels for the Targets are for quick reference when it occurred to me it might also be nice to have that for the Stops as well. Maybe you or someone else will find this useable.

This is what I whipped up for the daily, long side. It can be adapted to short side and intra-day. The trailing part follows the previous days close with the original ATR from trend start. For example if you are six days or so into an uptrend and already past a few target levels. This would offer a handy exit level proportional to the original.

Code:
##  my add for Daily Entry StopLoss for UpTrend
AddLabel(showADRLabels and UpTrend, "Entry Stop: " +round(UpTrendStopLoss,2)+ " ", Color.Pink);

##  my add for Daily Trailing StopLoss for Uptrend
def StopDiff = CloseUpTrendStart - UpTrendStopLoss;
AddLabel(showADRLabels and UpTrend, "Trailing Stop: " +round(Close(period = AggregationPeriod.Day)[1] - StopDiff,2)+ " ", Color.Orange);

@stockscouter87 Look for the section called Assign Price Color then change grey to white.
 
I still have to go through this entire thread and load the scripts as well, but can anyone here kindly advise if these scripts can be used on the Futures instruments like ES, NQ etc or is this mainly geared towards stocks?
yes this can be used on futures
 
is there anyway to turn the grey bars into white bars? ive tried manually but it will not work

find the "AssignPriceColor" line and change the color to White in the Upper Indicator Script. should be around line 128 to 135.

Code:
AssignPriceColor(if paintBars and RSI >= 50 and SlowK >= 50 and Value > Avg then Color.GREEN else if paintBars and RSI < 50 and SlowK < 50 and Value < Avg then Color.RED else if paintBars then Color.WHITE else Color.CURRENT);
 
find the "AssignPriceColor" line and change the color to White in the Upper Indicator Script. should be around line 128 to 135.

Code:
AssignPriceColor(if paintBars and RSI >= 50 and SlowK >= 50 and Value > Avg then Color.GREEN else if paintBars and RSI < 50 and SlowK < 50 and Value < Avg then Color.RED else if paintBars then Color.WHITE else Color.CURRENT);
@SuryaKiranC - Yeah check out post #23. There is as assign price color in the lower study that appears to be overriding the upper study??? I ended up commenting it out from the lower and I my color changed to white as you specified and then everything worked. May be this was an issue just for me, but until I commented out the lower assign price color statement, no amount of changing of the upper would work. I also wonder if the selection of the paint color option is also impacted by this???
 
@SuryaKiranC - Yeah check out post #23. There is as assign price color in the lower study that appears to be overriding the upper study??? I ended up commenting it out from the lower and I my color changed to white as you specified and then everything worked. May be this was an issue just for me, but until I commented out the lower assign price color statement, no amount of changing of the upper would work. I also wonder if the selection of the paint color option is also impacted by this???
Lower Indicator, has an option that can be turned off, you don't have to edit the code. It's in there to help out somebody who's not using the upper indicator, with the color coding alone. Upper indicator, as you may have noticed by now, does lot more than the arrows.

For Lower Indicator, with out modifying code, Set "paint bars" to "No"
 
@SuryaKiranC - Yeah check out post #23. There is as assign price color in the lower study that appears to be overriding the upper study??? I ended up commenting it out from the lower and I my color changed to white as you specified and then everything worked. May be this was an issue just for me, but until I commented out the lower assign price color statement, no amount of changing of the upper would work. I also wonder if the selection of the paint color option is also impacted by this???
Well I guess if you're looking for the hard way or cheezy way to do it, I'm your guy. You all thought of just about everything. Thanks for all the support and happy to be enlightened by you all, I'm amazed at the level of knowledge and attention to detail by this group. Thanks again
 
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
 
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)
 
Status
Not open for further replies.

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
421 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