Archives: RSM Indicator for ThinkorSwim

Status
Not open for further replies.
Quick post here. I understand that not every indicator is perfect ( hahah), including this one, but this I thought this would be a good post on the aspect of learning how to trade. (Which I am still doing for the record). I ended up trading puts on SPY this morning and was on the positive side. I came across this trade while doing other work and figured it was a good example of waiting for setups. I did not take this trade for the record, buts shows how an indicator can be used to assist in trading. The first part of this is finding the setups or letting them work themselves out. All the books on candle patterns exist for a reason and you have to continuously draw them out so you can get better a spotting them.

I would like to say one of the key benefits of this indicator is that it helps with entry (once you've identified a proper one, this indicator is not going to tell you if the entry will ultimately be good or not), the indicator at least is plotting a stop loss for you to adhere to incase it does not work out and help you preserver your capital. If it does work out, then you have some targets to look to for profit. Some of those targets should already be in your head. The break of the first resistance point, break of second resistance (HOD) and then the targets provided by the dynamic ADR/ATR calculation.

I've read a couple of posts on here over the weekend of folks looking for that holy grail indicator, guess what guys, it does not exist!!!!

It's called learning how to trade. I have to be honest, I am writing this for me as much as I am for anyone else. Just figured I would give a quick opinion. Constructive criticism always welcomed.

EDIT - I've been toying with the idea of incorporating ADX into the indicator to help with trend identification and improve the signal. There are times when this indicator misses the mark, but once you do find a good trade, I think it does a good job of keeping you safely in the trade and providing an adequate exit.

EDIT #2 - I went back and looked at this on 2m chart (which is where I took the PUT trade this morning) and the setup is very nice for the long position as well.

DAIDBUn.jpg
 

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

Off topic, but it keeps bothering me. I set up the same RSI, Stoch and MACD on ToS and TradingView. Values of RSI and MACD are may be close, but Stoch is not. To the point where it will give different entry signals. What am I doing wrong? Any comments?

Daily /ES Chart on 1/29

ToS RSI: 32.51
TradingView RSI: 32.34

ToS MACD: 34.78 and 19.73
TradingView MACD: 35.99 and 21.85

ToS Stoch: 46.14
TradingView Stoch: 50.10

WwShUny.png


rQFp7Kr.png
 
@barbaros Settings look good. I don't suspect you are doing anything wrong. I'm not terribly familiar with TV, but I've seen @BenTen mention several times on other threads that TV #'s may be a little different. Not sure as to why.
 
What are your thoughts @BenTen? The original author of this strategy uses TradingView. It seems like ToS setup is not matching TV's numbers and most importantly signals.
 
@barbaros I trust that the calculation from @cos251 version is the same. I've seen discrepancy in prices between the two platforms, which could be the culprit.
 
@BenTen That seems to be the case.

ToS 1/29 close: 3696.5
TV 1/29 close: 3705.25

However, CME matches to TV. It never occurred to me to check before. Is there a setting in ToS that might be influencing prices?

sr6R0Ib.png
 
@barbaros Without seeing the underlying code for each indicator, and knowing both scripting languages, it would be impossible to give any further opinion on any differences... I only know Thinkscript but @BenTen and a few other members know both...
 
Thanks @rad14733. I agree, however, the issue seems to be the close prices of the /ES on these platforms.
Remember, Futures don't all run from centralized servers so the two platforms could pull data from different servers... And volume is virtually impossible to match for Futures for this very reason...
 
@barbaros So, naturally my curiosity is piqued and did a bit of digging on TOS and Trade View. TOS is showing 16:30 as a close candle for the day and TradeView is showing 16:00 as close candle of the day, try this on a 30m chart. This is not just Friday's close, the same for Monday too.

-S
 
@cos251 @SuryaKiranC if you want to do swing trading with power what time frame do you use. For one of the ticker ($SOL) i see i can swing on 1 hr where as on a daily chart i see price target is down. Can you please explain your strategy?
 
Hey @cos251 just a quick request. Can you make this indicator a strategy? I know on the power x optimizer it has the winrate and % gain on the ticker. I found a floating p&l indicator on this forum and can use it to mimic the power x optimizer. Sorry that I didn’t make it myself - I’m a total newbie to think script. Thanks in advance
-Bones
 
@bobbybones All you need is enter and exit orders right? there are plenty of examples, if you search on net and here the forum to write your own strategy on long or short signals.
-S
 
Hey @cos251 just a quick request. Can you make this indicator a strategy? I know on the power x optimizer it has the winrate and % gain on the ticker. I found a floating p&l indicator on this forum and can use it to mimic the power x optimizer. Sorry that I didn’t make it myself - I’m a total newbie to think script. Thanks in advance
-Bones
@bobbybones - I've added a starter script for a strategy to the first post (at the bottom). Please take a peek. Feel free to use and modify as you like.
 
@cos251 @SuryaKiranC if you want to do swing trading with power what time frame do you use. For one of the ticker ($SOL) i see i can swing on 1 hr where as on a daily chart i see price target is down. Can you please explain your strategy?
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
 
Perfect.
Code for Watchlist Posed per Request.

Code:
# RSM_WL
#
#CHANGELOG
# 2021.1.31 - V1.0 @SuryaKiranC - RSM Watch List study - to be used as watchlist:
#              Based on @Cos251 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 "@Joseph Patrick 18"
#
#LINK
# https://rockwell-files.s3.amazonaws.com/PXCompanionGuide2ndEd_cover.pdf
# Markus Heikoetter who is the author of the Power X Strategy
# https://usethinkscript.com/threads/mimicking-power-x-strategy-by-markus-heitkoetter.4283/
#
################################################################
##########                 RSI                         #########
################################################################

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);

################################################################
##########                 Stochastic Slow             #########
################################################################
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;

#################################################################
############           MACD Calculation                 #########
#################################################################
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;

#################################################################
############          SCAN Variables                    #########
#################################################################

# 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);
Hello for the 1.3 lower pane indicator the RSI average line I can barely see it when it's overlaying the green shaded area what line of code can i adjust to make it more visible?
 
Hello for the 1.3 lower pane indicator the RSI average line I can barely see it when it's overlaying the green shaded area what line of code can i adjust to make it more visible?
if you must, you can find and comment the following line on.

Code:
RSI.AssignValueColor(if calcRSI > 50 and calcSlowK > 50 and calcValue > calcAvg then Color.GREEN else if calcRSI < 50 and calcSlowK < 50 and calcValue < calcAvg then Color.RED else Color.DARK_GRAY);
 
if you must, you can find and comment the following line on.

Code:
RSI.AssignValueColor(if calcRSI > 50 and calcSlowK > 50 and calcValue > calcAvg then Color.GREEN else if calcRSI < 50 and calcSlowK < 50 and calcValue < calcAvg then Color.RED else Color.DARK_GRAY);
i removed the _Dark and now it's better thanks.
 
@bobbybones - I've added a starter script for a strategy to the first post (at the bottom). Please take a peek. Feel free to use and modify as you like.
Hey, thanks for making the strategy. I just checked it out - it doesn't appear on the daily time frame and sometimes it doesn't enter a trade when it should. For example, when price went above the previous candle's high, there was no entry. Sorry for not trying to change it myself - im a complete newbie. It also doesn't exit on gray bars and doesn't take profits/cut losses on ADR values. I don't know if im too stupid to realize that you didn't intend for it to do that, or it is just bugged.

Sorry for the headache ~Bones
 
Status
Not open for further replies.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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