Mansfield Strength For ThinkOrSwim

drasp

Member
Hi guys,

I'm looking to add a moving average to the Mansfield relative strength indicator:
http://tos.mx/gFXXs0G

I'm aware that the zero line acts like a 200 period moving average cross. But I'm trying to add an additional 20 period moving average that is not the zero line but a trailing line like a moving average does with price.

Can anybody help?

add a 20 period moving average to the indicator
Thanks
Rich (BB code):
declare lower;

input Correlation_with_Security = "EDOW";
input length = 200;
input Period = AggregationPeriod.DAY;
input averagetype = AverageType.simple;

def price = close;
def RSD = close/(close(correlation_with_security));
def RSDavg = MovingAverage(averagetype, RSD, length);

plot RSM = (( RSD / RSDavg) - 1 ) * 100;
plot zeroline = 0;

zeroline.SetDefaultColor(GetColor(2));
 
Last edited:
Hello,

Im currently using the "standard" Mansfield RS indicator that has a Flat Zero Line. Im trying to use the 52wk MA as the zero line. Ive seen the code for it for Stockcharts, but dont know how to write it for TOS. Below is current code...

Thank YOu

Current TOS Code:
declare lower;

input CorrelationWithSecurity = "SPX";
def SPXclose = close(CorrelationWithSecurity);
def R52 = close/SPXclose;


def RS_today = close / SPXclose;
def BSAverage = (sum(r52, 52)/52);
Plot RS2 = ((R52/BSAverage)-1)*10;
plot zeroline = 0; Trying to get this to be the 52week moving average

RS2.SetDefaultColor(GetColor(6));plot Data = close;

Thank you
 
Hello,

Im currently using the "standard" Mansfield RS indicator that has a Flat Zero Line. Im trying to use the 52wk MA as the zero line. Ive seen the code for it for Stockcharts, but dont know how to write it for TOS. Below is current code...

Thank YOu

Current TOS Code:
declare lower;

input CorrelationWithSecurity = "SPX";
def SPXclose = close(CorrelationWithSecurity);
def R52 = close/SPXclose;


def RS_today = close / SPXclose;
def BSAverage = (sum(r52, 52)/52);
Plot RS2 = ((R52/BSAverage)-1)*10;
plot zeroline = 0; Trying to get this to be the 52week moving average

RS2.SetDefaultColor(GetColor(6));plot Data = close;

Thank you
See if you can make this work for you:
https://usethinkscript.com/threads/mansfield-strength-for-thinkorswim.9600/#post-91147
 
Hi guys,

I'm looking to add a moving average to the Mansfield relative strength indicator:
http://tos.mx/gFXXs0G
oM8Vw21.png

Ruby:
input Correlation_with_Security = "EDOW";
input length = 20;
input averagetype = AverageType.simple;

def price = close;
def RSD = close/(close(correlation_with_security));
def RSDavg = MovingAverage(averagetype, RSD, length);
# ########################################################
# Charting & Fomatting
declare lower;
declare real_size ;

plot pIndicator = RSD;
     pIndicator.SetLineWeight(3);
     pIndicator.AssignValueColor(
  if pIndicator > pIndicator[1] then color.green else color.red);

plot pIndicator_ma = RSDavg ;
     pIndicator_ma.SetLineWeight(3);
     pIndicator_ma.SetDefaultColor(color.violet);
     pIndicator_ma.SetPaintingStrategy(PaintingStrategy.DASHES);

AddCloud(pIndicator, pIndicator_ma, color.green, color.red);
 
I would like to create a script to compare taking into account the MRS
between stocks in the same sector in order to know the relative position of a stock compared to its peers in the sector.

Percentile % = (k/n) * 100

K: value position
n : total values of the list (sector, subsector, industry, etc)

I mean what is the position that NFLX occupies in XLF from 0 to 100% according to its MRS . Thanks

I want to send an image but this message appears: Image cannot be loaded from the passed link.
I found a script on amibroker, I want to send a photo but I can't
 
Last edited by a moderator:
I would like to create a script to compare taking into account the MRS
between stocks in the same sector in order to know the relative position of a stock compared to its peers in the sector.

Percentile % = (k/n) * 100

K: value position
n : total values of the list (sector, subsector, industry, etc)
this can be done with the indicator provided. You just change the ticker.
SO if you're trading NFLX, you can change the ticker to XLK on the MRS. Just play with it
 
I want to send an image but this message appears: Image cannot be loaded from the passed link.
I found a script on amibroker, I want to send a photo but I can't
Unfortunately, as a free forum, we don't have the capacity to store images and must use the IMGUR image sharing.
https://usethinkscript.com/threads/how-to-insert-image-in-a-post-thread.277/

It is not possible to provide a script unless these variables can be mathematically defined within the ToS platform
K: value position
n : total values of the list (sector, subsector, industry, etc)

What is value, what is total value???
the Mansfield Strength of the security as a percentage of the Mansfield Strength of the sector?
If that is what you are looking for then follow @drasp instructions.

Otherwise, I believe the reason that the definition of the variables are so difficult for you to quantify is because the information is not available to us through the ToS data stream. ToS does not provide any information as to the position that NFLX occupies in XLF nor total values of the list (sector, subsector, industry, etc)
 

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