how to calculate level in option chain

Hoang888

New member
Hi all, I am trying to calculate level of trike price in option chain
ex: on the Call i try to find what is a strike price down 7 lines from the strike price ATM
or the Put what is the strike price goes back 7 lines from the strike price ATM

it looks like when you set top loss by select level instead % or +/-

what is a code to calculate a level in option chain?
this is a draft that I came up with

Code:
``````input level = 7 and -7;
input DTE = (default 14, 20, 30); #number of day of period

def Symbol = underfying;
def Strike = getstrike();

plot output = if (isput level = -7) and (level = 7) and (DTE = 14) then 1 else 0;

assignBackgroundColor(if ouput == 1 then color.GREEN else color.CURRENT);``````

Any advice and suggestions would be greatly appreciated.

​

Not sure about script but I have been playing a bit with RTD And see a possible solution there in excel

Thanks, I did RTD in excel, it worked well. But now I try to use directly on TOS instead export or RTD on excel
this project that I build a custom column in option chain it show output whereas Delta = .20 - 25 and strike around 7 level down from strike ATM for Call and Put opposite Delta = -.20 - -.25 and strike around -7 level up from strike ATM

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
408 Online

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• Add-ons and resources
• 1 full year of unlimited support

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?