simple resistance and support line using open interest

taipanaz

New member
here is a simple resistance and support lines script, i use it for taking the 5 highest open interest in both calls and puts and then plot a dotted line on your chart. call1 and put1 has the thickest line. would love if someone could help make it automatic by pulling the 1week options and plotting the 5 highest open interest calls and puts. even better would be using the options volume, so its in real time.

Code:
def thickness1 = 5;
def thickness2 = 4;
def thickness3 = 3;
def thickness4 = 2;
def thickness5 = 1;

input call1 = 0.0;
plot call1a = call1;
call1a.SetDefaultColor(Color.GREEN);
call1a.SetStyle(Curve.SHORT_DASH);
call1a.SetLineWeight(thickness1);

input call2 = 0.0;
plot call2a = call2;
call2a.SetDefaultColor(Color.GREEN);
call2a.SetStyle(Curve.SHORT_DASH);
call2a.SetLineWeight(thickness2);

input call3 = 0.0;
plot call3a = call3;
call3a.SetDefaultColor(Color.GREEN);
call3a.SetStyle(Curve.SHORT_DASH);
call3a.SetLineWeight(thickness3);

input call4 = 0.0;
plot call4a = call4;
call4a.SetDefaultColor(Color.GREEN);
call4a.SetStyle(Curve.SHORT_DASH);
call4a.SetLineWeight(thickness4);

input call5 = 0.0;
plot call5a = call5;
call5a.SetDefaultColor(Color.GREEN);
call5a.SetStyle(Curve.SHORT_DASH);
call5a.SetLineWeight(thickness5);

input put1 = 0.0;
plot put1a = put1;
put1a.SetDefaultColor(Color.RED);
put1a.SetStyle(Curve.SHORT_DASH);
put1a.SetLineWeight(thickness1);

input put2 = 0.0;
plot put2a = put2;
put2a.SetDefaultColor(Color.RED);
put2a.SetStyle(Curve.SHORT_DASH);
put2a.SetLineWeight(thickness2);

input put3 = 0.0;
plot put3a = put3;
put3a.SetDefaultColor(Color.RED);
put3a.SetStyle(Curve.SHORT_DASH);
put3a.SetLineWeight(thickness3);

input put4 = 0.0;
plot put4a = put4;
put4a.SetDefaultColor(Color.RED);
put4a.SetStyle(Curve.SHORT_DASH);
put4a.SetLineWeight(thickness4);

input put5 = 0.0;
plot put5a = put5;
put5a.SetDefaultColor(Color.RED);
put5a.SetStyle(Curve.SHORT_DASH);
put5a.SetLineWeight(thickness5);
 
Solution
here is a simple resistance and support lines script, i use it for taking the 5 highest open interest in both calls and puts and then plot a dotted line on your chart. call1 and put1 has the thickest line. would love if someone could help make it automatic by pulling the 1week options and plotting the 5 highest open interest calls and puts. even better would be using the options volume, so its in real time.

Code:
def thickness1 = 5;
def thickness2 = 4;
def thickness3 = 3;
def thickness4 = 2;
def thickness5 = 1;

input call1 = 0.0;
plot call1a = call1;
call1a.SetDefaultColor(Color.GREEN);
call1a.SetStyle(Curve.SHORT_DASH);
call1a.SetLineWeight(thickness1);

input call2 = 0.0;
plot call2a = call2;
call2a.SetDefaultColor(Color.GREEN)...
here is a simple resistance and support lines script, i use it for taking the 5 highest open interest in both calls and puts and then plot a dotted line on your chart. call1 and put1 has the thickest line. would love if someone could help make it automatic by pulling the 1week options and plotting the 5 highest open interest calls and puts. even better would be using the options volume, so its in real time.

Code:
def thickness1 = 5;
def thickness2 = 4;
def thickness3 = 3;
def thickness4 = 2;
def thickness5 = 1;

input call1 = 0.0;
plot call1a = call1;
call1a.SetDefaultColor(Color.GREEN);
call1a.SetStyle(Curve.SHORT_DASH);
call1a.SetLineWeight(thickness1);

input call2 = 0.0;
plot call2a = call2;
call2a.SetDefaultColor(Color.GREEN);
call2a.SetStyle(Curve.SHORT_DASH);
call2a.SetLineWeight(thickness2);

input call3 = 0.0;
plot call3a = call3;
call3a.SetDefaultColor(Color.GREEN);
call3a.SetStyle(Curve.SHORT_DASH);
call3a.SetLineWeight(thickness3);

input call4 = 0.0;
plot call4a = call4;
call4a.SetDefaultColor(Color.GREEN);
call4a.SetStyle(Curve.SHORT_DASH);
call4a.SetLineWeight(thickness4);

input call5 = 0.0;
plot call5a = call5;
call5a.SetDefaultColor(Color.GREEN);
call5a.SetStyle(Curve.SHORT_DASH);
call5a.SetLineWeight(thickness5);

input put1 = 0.0;
plot put1a = put1;
put1a.SetDefaultColor(Color.RED);
put1a.SetStyle(Curve.SHORT_DASH);
put1a.SetLineWeight(thickness1);

input put2 = 0.0;
plot put2a = put2;
put2a.SetDefaultColor(Color.RED);
put2a.SetStyle(Curve.SHORT_DASH);
put2a.SetLineWeight(thickness2);

input put3 = 0.0;
plot put3a = put3;
put3a.SetDefaultColor(Color.RED);
put3a.SetStyle(Curve.SHORT_DASH);
put3a.SetLineWeight(thickness3);

input put4 = 0.0;
plot put4a = put4;
put4a.SetDefaultColor(Color.RED);
put4a.SetStyle(Curve.SHORT_DASH);
put4a.SetLineWeight(thickness4);

input put5 = 0.0;
plot put5a = put5;
put5a.SetDefaultColor(Color.RED);
put5a.SetStyle(Curve.SHORT_DASH);
put5a.SetLineWeight(thickness5);

EDIT 3/2
some posts have been changed around in the thread.
post #1 now has the current version.
https://usethinkscript.com/threads/option-heatmap-and-oi-strikes.10664/

===============


maybe this will give you some ideas.
it plots lines for open interest, for several strikes.
https://usethinkscript.com/threads/option-heatmap-and-oi-strikes.10664/page-4#post-94445
look at post 67 and 68.
 
Last edited:
Solution

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