Fresh Support and Resistance Levels for ThinkorSwim

BenTen

Administrative
Staff member
Staff
VIP
Lifetime
Here is another support and resistance indicator for ThinkorSwim to add on top of our big collection of S/R scripts here.

This indicator displays the high and low of the past 5 trading days. Hence, the term "fresh."

You can also use this indicator to identify the short-term trend of a stock. For example, if price is currently above most of the past 5 trading days' high levels, we can assume that it is in an uptrend.

es5PDV3.png


Code:
# Fresh Supply & Demand Levels
# Assembled by BenTen at UseThinkScript.com

input aggregationPeriod = AggregationPeriod.DAY;
def high = high(period = aggregationPeriod);
def low = low(period = aggregationPeriod);

plot h1 = high[1];
plot l1 = low[1];
plot h2 = high[2];
plot l2 = low[2];
plot h3 = high[3];
plot l3 = low[3];
plot h4 = high[4];
plot l4 = low[4];
plot h5 = high[5];
plot l5 = low[5];

h1.AssignValueColor(color.red);
h2.AssignValueColor(color.red);
h3.AssignValueColor(color.red);
h4.AssignValueColor(color.red);
h5.AssignValueColor(color.red);
l1.AssignValueColor(color.green);
l2.AssignValueColor(color.green);
l3.AssignValueColor(color.green);
l4.AssignValueColor(color.green);
l5.AssignValueColor(color.green);
 
Hi Ben,

I'm looking for last 2 days highs on a 5DAY 1MIN chart. I want to show the horizontal lines only for today's chart(Similar to Dynamic Daily Pivots). Can you please help?

Code:
plot R1 = HIGH(period = "day" )[1];
r1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R1.SetDefaultColor(Color.RED);
R1.SetLineWeight(2);

plot R2 = HIGH(period = "day" )[2];
r2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R2.SetDefaultColor(Color.RED);
R2.SetLineWeight(2);

eXzzIq2.png



GEN01i7.png


Thanks
 
Last edited:
@sreenivasaraovaka Here you go, remember to hit the like button if you found this post useful

Code:
def aggregationPeriod = AggregationPeriod.day;
def displace = -1;
def showOnlyLastPeriod = Yes;
plot PrevDayClose;
if showOnlyLastPeriod and !IsNaN(high(period = aggregationPeriod)[-1]) {
    PrevDayClose = Double.NaN;
} else {
    PrevDayClose = Highest(high(period = aggregationPeriod)[-displace], 1);
}
PrevDayClose.SetDefaultColor(GetColor(9));
PrevDayClose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);


def length2 = 1;
def displace2 = -2;
plot Prev2DayClose;
if showOnlyLastPeriod and !IsNaN(high(period = aggregationPeriod)[-1]) {
    Prev2DayClose = Double.NaN;
} else {
    Prev2DayClose = Highest(high(period = aggregationPeriod)[-displace2], length2);
}
Prev2DayClose.SetDefaultColor(GetColor(9));
Prev2DayClose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
 
@sreenivasaraovaka Refer to post #3... i just tried it with this ticker SE on 1 Minute and it works fine and plots the highs on current day only as you requested.

Make sure you can see 2 days ago on your chart, if you cant see 2 days ago and you have it set to 1minute TODAY then the study will not work as it cant see the previous 2 days because your chart cant see it. It will only plot what the chart can see.
 
Hi! Can someone helps me to find out why this HiLo_last10days study suddenly only shows the last 3 days of Highs and Lows - it was showing 10 days before. How to fix the codes ? Thanks in advance.

Code:
#Declare Hide_on_daily;
plot Data = close;#High and Lows per day for last 10 days on chart
    #   Put together by Horserider
input painthigh = 4;#Hint painthigh: 1=dots,2=dashes,3=squares,4=horizontal
def paintingStrategyhigh = if painthigh == 1 then PaintingStrategy.POINTS else if painthigh == 4 then PaintingStrategy.Horizontal else if painthigh == 3 then PaintingStrategy.SQUARES else PaintingStrategy.DASHES;

input paintlow = 4; #Hint paintlow: 1=dots,2=dashes,3=squares,4=horizontal
def paintingStrategylow = if paintlow == 1 then PaintingStrategy.POINTS else if paintlow == 2 then PaintingStrategy.DASHES else if paintlow == 3 then PaintingStrategy.SQUARES else PaintingStrategy.HORIZONTAL;


DefineGlobalColor("Global1", CreateColor(0, 0, 255));
#
input colorhigh = 7;#Hint colorhigh: 0=magenta,1=cyan,2=light-red,3=light_green,4=yellow,5=red,6=green,7=light_gray,8=gold,9=white
input colorlow = 7;#Hint colorlow: 0=magenta,1=cyan,2=light-red,3=light_green,4=yellow,5=red,6=green,7=light_gray,8=gold,9=white
input AggPeriod = AggregationPeriod.DAY;
rec high1 = if GetDay() == GetLastDay() then high(period = AggregationPeriod.DAY) else high1[1];
#rec high3 = if GetDay() == GetLastDay() then high(period = AggPeriod)[-3], 1) else high3[1];
plot h1 = high1;
h1.SetPaintingStrategy(paintingStrategyhigh);
h1.SetDefaultColor(GetColor(colorhigh));
rec high2 = if GetDay() == GetLastDay() - 1 then high(period = AggregationPeriod.DAY) else high2[1];
plot h2 = high2;
h2.SetPaintingStrategy(paintingStrategyhigh);
h2.SetDefaultColor(GetColor(colorhigh));
rec high3 = if GetDay() == GetLastDay() - 2 then high(period = AggregationPeriod.DAY) else high3[1];
plot h3 = high3;
h3.SetPaintingStrategy(paintingStrategyhigh);
h3.SetDefaultColor(GetColor(colorhigh));
rec high4 = if GetDay() == GetLastDay() - 3 then high(period = AggregationPeriod.DAY) else high4[1];
plot h4 = high4;
h4.SetPaintingStrategy(paintingStrategyhigh);
h4.SetDefaultColor(GetColor(colorhigh));
rec high5 = if GetDay() == GetLastDay() - 4 then high(period = AggregationPeriod.DAY) else high5[1];
plot h5 = high5;
h5.SetPaintingStrategy(paintingStrategyhigh);
h5.SetDefaultColor(GetColor(colorhigh));
rec high6 = if GetDay() == GetLastDay() - 5 then high(period = AggregationPeriod.DAY) else high6[1];
plot h6 = high6;
h6.SetPaintingStrategy(paintingStrategyhigh);
h6.SetDefaultColor(GetColor(colorhigh));
rec high7 = if GetDay() == GetLastDay() - 6 then high(period = AggregationPeriod.DAY) else high7[1];
plot h7 = high7;
h7.SetPaintingStrategy(paintingStrategyhigh);
h7.SetDefaultColor(GetColor(colorhigh));
rec high8 = if GetDay() == GetLastDay() - 7 then high(period = AggregationPeriod.DAY) else high8[1];
plot h8 = high8;
h8.SetPaintingStrategy(paintingStrategyhigh);
h8.SetDefaultColor(GetColor(colorhigh));
rec high9 = if GetDay() == GetLastDay() - 8 then high(period = AggregationPeriod.DAY) else high9[1];
plot h9 = high9;
h9.SetPaintingStrategy(paintingStrategyhigh);
h9.SetDefaultColor(GetColor(colorhigh));
rec high10 = if GetDay() == GetLastDay() - 9 then high(period = AggregationPeriod.DAY) else high10[1];
plot h10 = high10;
h10.SetPaintingStrategy(paintingStrategyhigh);
h10.SetDefaultColor(GetColor(colorhigh));
rec high11 = if GetDay() == GetLastDay() - 10 then high(period = AggregationPeriod.DAY) else high11[1];
plot h11 = high11;
h11.SetPaintingStrategy(paintingStrategyhigh);
h11.SetDefaultColor(GetColor(colorhigh));
rec high12 = if GetDay() == GetLastDay() - 11 then high(period = AggregationPeriod.DAY) else high12[1];
plot h12 = high12;
h12.SetPaintingStrategy(paintingStrategyhigh);
h12.SetDefaultColor(GetColor(colorhigh));
rec high13 = if GetDay() == GetLastDay() - 12 then high(period = AggregationPeriod.DAY) else high13[1];
plot h13 = high13;
h13.SetPaintingStrategy(paintingStrategyhigh);
h13.SetDefaultColor(GetColor(colorhigh));
rec high14 = if GetDay() == GetLastDay() - 13 then high(period = AggregationPeriod.DAY) else high14[1];
plot h14 = high14;
h14.SetPaintingStrategy(paintingStrategyhigh);
h14.SetDefaultColor(GetColor(colorhigh));
rec high15 = if GetDay() == GetLastDay() - 14 then high(period = AggregationPeriod.DAY) else high15[1];
plot h15 = high15;
h15.SetPaintingStrategy(paintingStrategyhigh);
h15.SetDefaultColor(GetColor(colorhigh));


rec low1 = if GetDay() == GetLastDay() then low(period = AggregationPeriod.DAY) else low1[1];
plot l1 = low1;
l1.SetPaintingStrategy(paintingStrategylow);
l1.SetDefaultColor(GetColor(colorlow));
rec low2 = if GetDay() == GetLastDay() - 1 then low(period = AggregationPeriod.DAY) else low2[1];
plot l2 = low2;
l2.SetPaintingStrategy(paintingStrategylow);
l2.SetDefaultColor(GetColor(colorlow));
rec low3 = if GetDay() == GetLastDay() - 2 then low(period = AggregationPeriod.DAY) else low3[1];
plot l3 = low3;
l3.SetPaintingStrategy(paintingStrategylow);
l3.SetDefaultColor(GetColor(colorlow));
rec low4 = if GetDay() == GetLastDay() - 3 then low(period = AggregationPeriod.DAY) else low4[1];
plot l4 = low4;
l4.SetPaintingStrategy(paintingStrategylow);
l4.SetDefaultColor(GetColor(colorlow));
rec low5 = if GetDay() == GetLastDay() - 4 then low(period = AggregationPeriod.DAY) else low5[1];
plot l5 = low5;
l5.SetPaintingStrategy(paintingStrategylow);
l5.SetDefaultColor(GetColor(colorlow));
rec low6 = if GetDay() == GetLastDay() - 5 then low(period = AggregationPeriod.DAY) else low5[1];
plot l6 = low6;
l6.SetPaintingStrategy(paintingStrategylow);
l6.SetDefaultColor(GetColor(colorlow));
rec low7 = if GetDay() == GetLastDay() - 6 then low(period = AggregationPeriod.DAY) else low7[1];
plot l7 = low7;
l7.SetPaintingStrategy(paintingStrategylow);
l7.SetDefaultColor(GetColor(colorlow));
rec low8 = if GetDay() == GetLastDay() - 7 then low(period = AggregationPeriod.DAY) else low8[1];
plot l8 = low8;
l8.SetPaintingStrategy(paintingStrategylow);
l8.SetDefaultColor(GetColor(colorlow));
rec low9 = if GetDay() == GetLastDay() - 8 then low(period = AggregationPeriod.DAY) else low9[1];
plot l9 = low9;
l9.SetPaintingStrategy(paintingStrategylow);
l9.SetDefaultColor(GetColor(colorlow));
rec low10 = if GetDay() == GetLastDay() - 9 then low(period = AggregationPeriod.DAY) else low10[1];
plot l10 = low10;
l10.SetPaintingStrategy(paintingStrategylow);
l10.SetDefaultColor(GetColor(colorlow));
rec low11 = if GetDay() == GetLastDay() - 10 then low(period = AggregationPeriod.DAY) else low11[1];
plot l11 = low11;
l11.SetPaintingStrategy(paintingStrategylow);
l11.SetDefaultColor(GetColor(colorlow));
rec low12 = if GetDay() == GetLastDay() - 11 then low(period = AggregationPeriod.DAY) else low12[1];
plot l12 = low12;
l12.SetPaintingStrategy(paintingStrategylow);
l12.SetDefaultColor(GetColor(colorlow));
rec low13 = if GetDay() == GetLastDay() - 12 then low(period = AggregationPeriod.DAY) else low13[1];
plot l13 = low13;
l13.SetPaintingStrategy(paintingStrategylow);
l13.SetDefaultColor(GetColor(colorlow));
rec low14 = if GetDay() == GetLastDay() - 13 then low(period = AggregationPeriod.DAY) else low14[1];
plot l14 = low14;
l14.SetPaintingStrategy(paintingStrategylow);
l14.SetDefaultColor(GetColor(colorlow));
rec low15 = if GetDay() == GetLastDay() - 14 then low(period = AggregationPeriod.DAY) else low15[1];
plot l15 = low15;
l15.SetPaintingStrategy(paintingStrategylow);
l15.SetDefaultColor(GetColor(colorlow));
 
Here is another support and resistance indicator for ThinkorSwim to add on top of our big collection of S/R scripts here.

This indicator displays the high and low of the past 5 trading days. Hence, the term "fresh."

You can also use this indicator to identify the short-term trend of a stock. For example, if price is currently above most of the past 5 trading days' high levels, we can assume that it is in an uptrend.

es5PDV3.png


Code:
# Fresh Supply & Demand Levels
# Assembled by BenTen at UseThinkScript.com

input aggregationPeriod = AggregationPeriod.DAY;
def high = high(period = aggregationPeriod);
def low = low(period = aggregationPeriod);

plot h1 = high[1];
plot l1 = low[1];
plot h2 = high[2];
plot l2 = low[2];
plot h3 = high[3];
plot l3 = low[3];
plot h4 = high[4];
plot l4 = low[4];
plot h5 = high[5];
plot l5 = low[5];

h1.AssignValueColor(color.red);
h2.AssignValueColor(color.red);
h3.AssignValueColor(color.red);
h4.AssignValueColor(color.red);
h5.AssignValueColor(color.red);
l1.AssignValueColor(color.green);
l2.AssignValueColor(color.green);
l3.AssignValueColor(color.green);
l4.AssignValueColor(color.green);
l5.AssignValueColor(color.green);
Is it possible to use this on larger time frames for swing trading?
 
Hi, I want to find or create a study to draw High (HOD) and Low (LOD) for all days (Daily timeframe) and plot them where i add the study (Daily, 1min, 5min.. )
- ideally the line starts from that Daily candle or it can be full width of screen

Can you point me in the right direction?

9gVuV2G.jpg

bEn6EhQ.jpg
 
Good evening; hope you are doing great, I have problems coding this and perhaps you may help me.
I want to look for the highest high and lowest low of the past 10 days for example, but in an intraday chart; I haven't been able to do it since going back like this "[]" means bars and when I try to subtract the number of days from a date it gives me an error since it doesn't plot anything in the chart, is there a way to do this?
Thank you in advance.
 
I'm trying to figure out what type of indicator this is based off on but I can't seem to figure it out. I already checked out support and resistance zone indicators but nothing close comes up. Has anyone seen this before somewhere? Thank you for your time
unknown.png
 
I paid decent money for it along with his discord training group . He has some videos on you tube about it
 
He ran a special for memorial day was 299 . He also says that you get all the future updates and tweaks if he changes anything. . Hard call but it's basically designed to give you better entries and exits
 

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