How to determine if the symbol is an option?

evanevans

evanevans

Member
What's the prevailing method for figuring out if the symbol of a chart, is an option's contract?
 
BenTen

BenTen

Administrative
Staff
VIP
Ticker for S&P 500 = SPY. Ticker for the SPY call option (Expiration: September 11. Strike = 340) = .SPY200911C340
 
evanevans

evanevans

Member
Thanks @BenTen, but I am asking something different, I will try and explain.

What I mean is, how can ThinkScript know if the current chart is displaying an option or a stock? But I guess you gave me one hint. I could check if the ticker symbol starts with a "."
 
evanevans

evanevans

Member
This is what I wound up using, seems to have worked:
Code:
def IsOption = if GetStrike()>0 then 1 else 0;
 

Similar threads

Top