Price Pivots for NSE Index & F&O Stocks
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Arun_K_Bhaskar

//@version=5

// Updated on 24 June 2022
// Included Indexs: NIFTY, BANKNIFTY, FINNIFTY, MIDCPNIFTY, MCX
// Included Equities: All F&O listed stocks as per the updated date.

// Formula Reference: Intrangle - Straddle / Strangle By Saravanan_Ragavan
// Source Link: https://in.tradingview.com/script/BWsF0S4k-Intrangle-Straddle-Strangle/



indicator(title="Price Pivots for NSE Index & F&O Stocks", shorttitle="Price Pivots", overlay=true)




////////////////////////////////////////////////////////// F&O Index & Equity Symbols


// Symbols of Strike Price Difference 1
sym_001_spd_1 = "BHEL"
sym_002_spd_1 = "FEDERALBNK"
sym_003_spd_1 = "GMRINFRA"
sym_004_spd_1 = "IDEA"
sym_005_spd_1 = "IDFC"
sym_006_spd_1 = "IDFCFIRSTB"
sym_007_spd_1 = "IOC"
sym_008_spd_1 = "L_TFH"
sym_009_spd_1 = "NBCC"
sym_010_spd_1 = "NTPC"
sym_011_spd_1 = "PFC"
sym_012_spd_1 = "PNB"
sym_013_spd_1 = "SAIL"
// Symbols of Strike Price Difference 2.5
sym_014_spd_2_5 = "ABCAPITAL"
sym_015_spd_2_5 = "APOLLOTYRE"
sym_016_spd_2_5 = "ASHOKLEY"
sym_017_spd_2_5 = "BANKBARODA"
sym_018_spd_2_5 = "BEL"
sym_019_spd_2_5 = "COALINDIA"
sym_020_spd_2_5 = "CUB"
sym_021_spd_2_5 = "EXIDEIND"
sym_022_spd_2_5 = "FSL"
sym_023_spd_2_5 = "GAIL"
sym_024_spd_2_5 = "HINDCOPPER"
sym_025_spd_2_5 = "ITC"
sym_026_spd_2_5 = "MANAPPURAM"
sym_027_spd_2_5 = "MOTHERSON"
sym_028_spd_2_5 = "M_MFIN"
sym_029_spd_2_5 = "NATIONALUM"
sym_030_spd_2_5 = "NMDC"
sym_031_spd_2_5 = "ONGC"
sym_032_spd_2_5 = "PETRONET"
sym_033_spd_2_5 = "POWERGRID"
sym_034_spd_2_5 = "RBLBANK"
sym_035_spd_2_5 = "RECLTD"
// Symbols of Strike Price Difference 5
sym_036_spd_5 = "ABFRL"
sym_037_spd_5 = "AMARAJABAT"
sym_038_spd_5 = "AMBUJACEM"
sym_039_spd_5 = "BANDHANBNK"
sym_040_spd_5 = "BIOCON"
sym_041_spd_5 = "BPCL"
sym_042_spd_5 = "CANBK"
sym_043_spd_5 = "CROMPTON"
sym_044_spd_5 = "DABUR"
sym_045_spd_5 = "DELTACORP"
sym_046_spd_5 = "DLF"
sym_047_spd_5 = "GLENMARK"
sym_048_spd_5 = "GRANULES"
sym_049_spd_5 = "GSPL"
sym_050_spd_5 = "HDFCLIFE"
sym_051_spd_5 = "HINDPETRO"
sym_052_spd_5 = "IBULHSGFIN"
sym_053_spd_5 = "ICICIPRULI"
sym_054_spd_5 = "IEX"
sym_055_spd_5 = "IGL"
sym_056_spd_5 = "INDHOTEL"
sym_057_spd_5 = "INDIACEM"
sym_058_spd_5 = "INDUSTOWER"
sym_059_spd_5 = "LICHSGFIN"
sym_060_spd_5 = "MARICO"
sym_061_spd_5 = "NAM_INDIA"
sym_062_spd_5 = "RAIN"
sym_063_spd_5 = "STAR"
sym_064_spd_5 = "SUNTV"
sym_065_spd_5 = "TATAPOWER"
sym_066_spd_5 = "ZEEL"
sym_067_spd_5 = "ZYDUSLIFE"
// Symbols of Strike Price Difference 8.5
sym_068_spd_8_5 = "VEDL"
// Symbols of Strike Price Difference 10
sym_069_spd_10 = "ADANIPORTS"
sym_070_spd_10 = "APLLTD"
sym_071_spd_10 = "AUBANK"
sym_072_spd_10 = "AUROPHARMA"
sym_073_spd_10 = "AXISBANK"
sym_074_spd_10 = "BALRAMCHIN"
sym_075_spd_10 = "BERGEPAINT"
sym_076_spd_10 = "BHARATFORG"
sym_077_spd_10 = "BHARTIARTL"
sym_078_spd_10 = "BSOFT"
sym_079_spd_10 = "CANFINHOME"
sym_080_spd_10 = "CHAMBLFERT"
sym_081_spd_10 = "CIPLA"
sym_082_spd_10 = "COLPAL"
sym_083_spd_10 = "CONCOR"
sym_084_spd_10 = "COROMANDEL"
sym_085_spd_10 = "GODREJCP"
sym_086_spd_10 = "GUJGASLTD"
sym_087_spd_10 = "HINDALCO"
sym_088_spd_10 = "ICICIBANK"
sym_089_spd_10 = "JINDALSTEL"
sym_090_spd_10 = "JSWSTEEL"
sym_091_spd_10 = "JUBLFOOD"
sym_092_spd_10 = "LAURUSLABS"
sym_093_spd_10 = "LUPIN"
sym_094_spd_10 = "MCDOWELL_N"
sym_095_spd_10 = "MFSL"
sym_096_spd_10 = "MGL"
sym_097_spd_10 = "M_M"
sym_098_spd_100 = "OFSS"
sym_099_spd_10 = "RAMCOCEM"
sym_100_spd_10 = "SBICARD"
sym_101_spd_10 = "SBILIFE"
sym_102_spd_10 = "SBIN"
sym_103_spd_10 = "SRTRANSFIN"
sym_104_spd_10 = "SUNPHARMA"
sym_105_spd_10 = "SYNGENE"
sym_106_spd_10 = "TATACONSUM"
sym_107_spd_10 = "TATAMOTORS"
sym_108_spd_10 = "TORNTPOWER"
sym_109_spd_10 = "TVSMOTOR"
sym_110_spd_10 = "UPL"
sym_111_spd_10 = "WIPRO"
// Symbols of Strike Price Difference 20
sym_112_spd_20 = "AARTIIND"
sym_113_spd_20 = "ABB"
sym_114_spd_20 = "ACC"
sym_115_spd_20 = "ADANIENT"
sym_116_spd_20 = "ASTRAL"
sym_117_spd_20 = "BALKRISIND"
sym_118_spd_20 = "BATAINDIA"
sym_119_spd_20 = "BRITANNIA"
sym_120_spd_20 = "CHOLAFIN"
sym_121_spd_20 = "CUMMINSIND"
sym_122_spd_20 = "DALBHARAT"
sym_123_spd_100 = "EICHERMOT"
sym_124_spd_20 = "ESCORTS"
sym_125_spd_20 = "GNFC"
sym_126_spd_20 = "GODREJPROP"
sym_127_spd_20 = "GRASIM"
sym_128_spd_20 = "HAL"
sym_129_spd_20 = "HAVELLS"
sym_130_spd_20 = "HCLTECH"
sym_131_spd_20 = "HDFC"
sym_132_spd_20 = "HDFCAMC"
sym_133_spd_20 = "HDFCBANK"
sym_134_spd_20 = "HEROMOTOCO"
sym_135_spd_20 = "HINDUNILVR"
sym_136_spd_20 = "ICICIGI"
sym_137_spd_20 = "INDIGO"
sym_138_spd_20 = "INDUSINDBK"
sym_139_spd_20 = "INFY"
sym_140_spd_20 = "INTELLECT"
sym_141_spd_20 = "IPCALAB"
sym_142_spd_20 = "IRCTC"
sym_143_spd_20 = "KOTAKBANK"
sym_144_spd_20 = "LT"
sym_145_spd_20 = "MCX"
sym_146_spd_20 = "MUTHOOTFIN"
sym_147_spd_20 = "OBEROIRLTY"
sym_148_spd_20 = "PIDILITIND"
sym_149_spd_20 = "PVR"
sym_150_spd_50 = "RELIANCE"
sym_151_spd_20 = "SIEMENS"
sym_152_spd_20 = "TATACHEM"
sym_153_spd_20 = "TATACOMM"
sym_154_spd_20 = "TATASTEEL"
sym_155_spd_20 = "TECHM"
sym_156_spd_20 = "TRENT"
sym_157_spd_20 = "UBL"
sym_158_spd_20 = "VOLTAS"
sym_159_spd_20 = "WHIRLPOOL"
// Symbols of Strike Price Difference 50
sym_160_spd_50 = "ASIANPAINT"
sym_161_spd_50 = "BAJAJ_AUTO"
sym_162_spd_50 = "DEEPAKNTR"
sym_163_spd_50 = "DIVISLAB"
sym_164_spd_50 = "DRREDDY"
sym_165_spd_50 = "JKCEMENT"
sym_166_spd_50 = "LALPATHLAB"
sym_167_spd_50 = "METROPOLIS"
sym_168_spd_50 = "MPHASIS"
sym_169_spd_50 = "NIFTY"
sym_170_spd_50 = "PEL"
sym_171_spd_50 = "PIIND"
sym_172_spd_50 = "POLYCAB"
sym_173_spd_50 = "SRF"
sym_174_spd_50 = "TCS"
sym_175_spd_50 = "TITAN"
sym_176_spd_50 = "TORNTPHARM"
// Symbols of Strike Price Difference 100
sym_177_spd_100 = "APOLLOHOSP"
sym_178_spd_100 = "ATUL"
sym_179_spd_100 = "BAJFINANCE"
sym_180_spd_100 = "BANKNIFTY"
sym_181_spd_100 = "COFORGE"
sym_182_spd_100 = "DIXON"
sym_183_spd_100 = "FINNIFTY"
sym_184_spd_100 = "INDIAMART"
sym_185_spd_100 = "LTI"
sym_186_spd_100 = "LTTS"
sym_187_spd_100 = "MARUTI"
sym_188_spd_100 = "MINDTREE"
sym_189_spd_100 = "NAUKRI"
sym_190_spd_100 = "NAVINFLUOR"
sym_191_spd_100 = "NESTLEIND"
sym_192_spd_100 = "PERSISTENT"
sym_193_spd_100 = "ULTRACEMCO"
// Symbols of Strike Price Difference 200
sym_194_spd_200 = "MIDCPNIFTY"
// Symbols of Strike Price Difference 250
sym_195_spd_250 = "ABBOTINDIA"
sym_196_spd_50 = "ALKEM"
sym_197_spd_250 = "BAJAJFINSV"
sym_198_spd_250 = "BOSCHLTD"
sym_199_spd_250 = "SHREECEM"
// Symbols of Strike Price Difference 500
sym_200_spd_500 = "HONAUT"
sym_201_spd_500 = "MRF"
sym_202_spd_500 = "PAGEIND"

////////////////////////////////////////////////////////// Common Strike Price Difference in NSE F&O

spd_1 = 1
spd_2_5 = 2.5
spd_5 = 5
spd_8_5 = 8.5
spd_10 = 10
spd_20 = 20
spd_50 = 50
spd_100 = 100
spd_200 = 200
spd_250 = 250
spd_500 = 500




////////////////////////////////////////////////////////// Price Pivots 


ttSrc = "• Custom: Enter the price manually after choosing the Source as Custom to show the Pivots at that price.\n• LTP: Pivot is calculated based on Last Traded Price.\n• Day Open: Pivot is calculated based on current day opening price.\n• PD Close: Pivot is calculated based on previous day closing price.\n• PD HL2: Pivot is calculated based on previous day average of High and Low.\n• PD HLC3: Pivot is calculated based on previous day average of High, Low and Close."
ttHis = "Increase numbers for prevoius pivots"
ttCus = "Enter price manually to calculate pivots of that price level"

gpPP = "Price Pivots"

show_pp = input.bool(true, title="Show Price Pivots", group=gpPP, inline="01")
show_pp_label = input.bool(true, title="Price Labels", group=gpPP, inline="01")
i_timeframe = input.string("D", title="Timeframe", options=["1", "3", "5", "15", "30", "45", "60", "120", "180", "240", "D", "5D", "W", "2W", "3W", "M", "3M", "6M", "12M"], group=gpPP)
i_source = input.string("PD Close", title="Source", options=["Custom", "LTP","Day Open", "PD Close", "PD HL2", "PD HLC3"], group=gpPP, tooltip=ttSrc)
i_pd_ltp_o = input.int(0, title="Historical (If Source is Day Open)", minval=0, group=gpPP, tooltip=ttHis)
i_pd_c_hl2_hlc3 = input.int(1, title="Historical (If Source is PD Close, HL2, HLC3)", minval=1, group=gpPP, tooltip=ttHis)
i_custom = input.float(0, title="Enter Price (If Source is Custom)", minval=0, group=gpPP, tooltip=ttCus)

////////////////////////////////////////////////////// OHLC

day_open = request.security(syminfo.tickerid, i_timeframe, open[i_pd_ltp_o], lookahead=barmerge.lookahead_on)
pd_high = request.security(syminfo.tickerid, i_timeframe, high[i_pd_c_hl2_hlc3], lookahead=barmerge.lookahead_on)
pd_low = request.security(syminfo.tickerid, i_timeframe, low[i_pd_c_hl2_hlc3], lookahead=barmerge.lookahead_on)
pd_close = request.security(syminfo.tickerid, i_timeframe, close[i_pd_c_hl2_hlc3], lookahead=barmerge.lookahead_on)

get_high = request.security(syminfo.tickerid, "60", high)
get_low = request.security(syminfo.tickerid, "60", low)

////////////////////////////////////////////////////// Source

price_input = i_source == "LTP" ? close[i_pd_ltp_o] :
     i_source == "Day Open" ? day_open :
     i_source == "PD Close" ? pd_close :
     i_source == "PD HL2" ? math.avg(pd_high, pd_low) :
     i_source == "PD HLC3" ? math.avg(pd_high, pd_low, pd_close) : i_custom

price_option = i_source == "Custom" ? i_custom : price_input

////////////////////////////////////////////////////// Price Levels Settings

ttR5 = "This number is for R5 which can be adjusted for extended price pivots"
ttS5 = "This number is for S5 which can be adjusted for extended price pivots"

i_r_col = input.color(color.silver, title="", group=gpPP, inline="05")
show_r_1 = input.bool(true, title="R1", group=gpPP, inline="05")
show_r_2 = input.bool(true, title="R2", group=gpPP, inline="05")
show_r_3 = input.bool(false, title="R3", group=gpPP, inline="05")
show_r_4 = input.bool(false, title="R4", group=gpPP, inline="05")
show_r_5 = input.bool(false, title="R5", group=gpPP, inline="05")
i_r_5x_level = input.int(4, minval=4, title="", group=gpPP, inline="05", tooltip=ttR5)

i_s_col = input.color(color.silver, title="", group=gpPP, inline="06")
show_s_1 = input.bool(true, title="S1", group=gpPP, inline="06")
show_s_2 = input.bool(true, title="S2", group=gpPP, inline="06")
show_s_3 = input.bool(false, title="S3", group=gpPP, inline="06")
show_s_4 = input.bool(false, title="S4", group=gpPP, inline="06")
show_s_5 = input.bool(false, title="S5", group=gpPP, inline="06")
i_s_5x_level = input.int(4, minval=4, title="", group=gpPP, inline="06", tooltip=ttS5)

i_pp_style = input.string(line.style_solid, title = "", options = [line.style_solid, line.style_dashed, line.style_dotted], group=gpPP, inline="07")
i_pp_width = input.int(1, title = "", minval=1, group=gpPP, inline="07")

show_avg = input.bool(false, title="Average Levels", group=gpPP, inline="08")
i_pp_avg_style = input.string(line.style_dashed, title = "", options = [line.style_solid, line.style_dashed, line.style_dotted], group=gpPP, inline="08")
i_pp_avg_width = input.int(1, title = "", minval=1, group=gpPP, inline="08")

i_extend = input.string("None", title="Extend Lines", options=["None", "Left", "Right", "Both"], group=gpPP, inline="09")
ext_option = i_extend == "None" ? extend.none : i_extend == "Left" ? extend.left : i_extend == "Right" ? extend.right : i_extend == "Both" ? extend.both : na

////////////////////////////////////////////////////////// Strike Price Difference Formula

// Strike Price Difference 1
upper_val_spd_1 = math.round(price_input[i_pd_ltp_o] / spd_1, 0) * spd_1
lower_val_spd_1 = math.round(price_input[i_pd_ltp_o] / spd_1, 0) * spd_1
upper_spd_1 = upper_val_spd_1 < price_input[i_pd_ltp_o] ? upper_val_spd_1 + spd_1 : upper_val_spd_1
lower_spd_1 = lower_val_spd_1 > price_input[i_pd_ltp_o] ? lower_val_spd_1 - spd_1 : lower_val_spd_1

// Strike Price Difference 2.5
upper_val_spd_2_5 = math.round(price_input[i_pd_ltp_o] / spd_2_5, 0) * spd_2_5
lower_val_spd_2_5 = math.round(price_input[i_pd_ltp_o] / spd_2_5, 0) * spd_2_5
upper_spd_2_5 = upper_val_spd_2_5 < price_input[i_pd_ltp_o] ? upper_val_spd_2_5 + spd_2_5 : upper_val_spd_2_5
lower_spd_2_5 = lower_val_spd_2_5 > price_input[i_pd_ltp_o] ? lower_val_spd_2_5 - spd_2_5 : lower_val_spd_2_5

// Strike Price Difference 5
upper_val_spd_5 = math.round(price_input[i_pd_ltp_o] / spd_5, 0) * spd_5
lower_val_spd_5 = math.round(price_input[i_pd_ltp_o] / spd_5, 0) * spd_5
upper_spd_5 = upper_val_spd_5 < price_input[i_pd_ltp_o] ? upper_val_spd_5 + spd_5 : upper_val_spd_5
lower_spd_5 = lower_val_spd_5 > price_input[i_pd_ltp_o] ? lower_val_spd_5 - spd_5 : lower_val_spd_5

// Strike Price Difference 8.5
upper_val_spd_8_5 = math.round(price_input[i_pd_ltp_o] / spd_8_5, 0) * spd_8_5
lower_val_spd_8_5 = math.round(price_input[i_pd_ltp_o] / spd_8_5, 0) * spd_8_5
upper_spd_8_5 = upper_val_spd_8_5 < price_input[i_pd_ltp_o] ? upper_val_spd_8_5 + spd_8_5 : upper_val_spd_8_5
lower_spd_8_5 = lower_val_spd_8_5 > price_input[i_pd_ltp_o] ? lower_val_spd_8_5 - spd_8_5 : lower_val_spd_8_5

// Strike Price Difference 10
upper_val_spd_10 = math.round(price_input[i_pd_ltp_o] / spd_10, 0) * spd_10
lower_val_spd_10 = math.round(price_input[i_pd_ltp_o] / spd_10, 0) * spd_10
upper_spd_10 = upper_val_spd_10 < price_input[i_pd_ltp_o] ? upper_val_spd_10 + spd_10 : upper_val_spd_10
lower_spd_10 = lower_val_spd_10 > price_input[i_pd_ltp_o] ? lower_val_spd_10 - spd_10 : lower_val_spd_10

// Strike Price Difference 20
upper_val_spd_20 = math.round(price_input[i_pd_ltp_o] / spd_20, 0) * spd_20
lower_val_spd_20 = math.round(price_input[i_pd_ltp_o] / spd_20, 0) * spd_20
upper_spd_20 = upper_val_spd_20 < price_input[i_pd_ltp_o] ? upper_val_spd_20 + spd_20 : upper_val_spd_20
lower_spd_20 = lower_val_spd_20 > price_input[i_pd_ltp_o] ? lower_val_spd_20 - spd_20 : lower_val_spd_20

// Strike Price Difference 50 // NIFTY
upper_val_spd_50 = math.round(price_input[i_pd_ltp_o] / spd_50, 0) * spd_50
lower_val_spd_50 = math.round(price_input[i_pd_ltp_o] / spd_50, 0) * spd_50
upper_spd_50 = upper_val_spd_50 < price_input[i_pd_ltp_o] ? upper_val_spd_50 + spd_50 : upper_val_spd_50
lower_spd_50 = lower_val_spd_50 > price_input[i_pd_ltp_o] ? lower_val_spd_50 - spd_50 : lower_val_spd_50

// Strike Price Difference 100 // BANK NIFTY
upper_val_spd_100 = math.round(price_input[i_pd_ltp_o] / spd_100, 0) * spd_100
lower_val_spd_100 = math.round(price_input[i_pd_ltp_o] / spd_100, 0) * spd_100
upper_spd_100 = upper_val_spd_100 < price_input[i_pd_ltp_o] ? upper_val_spd_100 + spd_100 : upper_val_spd_100
lower_spd_100 = lower_val_spd_100 > price_input[i_pd_ltp_o] ? lower_val_spd_100 - spd_100 : lower_val_spd_100

// Strike Price Difference 200
upper_val_spd_200 = math.round(price_input[i_pd_ltp_o] / spd_200, 0) * spd_200
lower_val_spd_200 = math.round(price_input[i_pd_ltp_o] / spd_200, 0) * spd_200
upper_spd_200 = upper_val_spd_200 < price_input[i_pd_ltp_o] ? upper_val_spd_200 + spd_200 : upper_val_spd_200
lower_spd_200 = lower_val_spd_200 > price_input[i_pd_ltp_o] ? lower_val_spd_200 - spd_200 : lower_val_spd_200

// Strike Price Difference 250
upper_val_spd_250 = math.round(price_input[i_pd_ltp_o] / spd_250, 0) * spd_250
lower_val_spd_250 = math.round(price_input[i_pd_ltp_o] / spd_250, 0) * spd_250
upper_spd_250 = upper_val_spd_250 < price_input[i_pd_ltp_o] ? upper_val_spd_250 + spd_250 : upper_val_spd_250
lower_spd_250 = lower_val_spd_250 > price_input[i_pd_ltp_o] ? lower_val_spd_250 - spd_250 : lower_val_spd_250

// Strike Price Difference 500
upper_val_spd_500 = math.round(price_input[i_pd_ltp_o] / spd_500, 0) * spd_500
lower_val_spd_500 = math.round(price_input[i_pd_ltp_o] / spd_500, 0) * spd_500
upper_spd_500 = upper_val_spd_500 < price_input[i_pd_ltp_o] ? upper_val_spd_500 + spd_500 : upper_val_spd_500
lower_spd_500 = lower_val_spd_500 > price_input[i_pd_ltp_o] ? lower_val_spd_500 - spd_500 : lower_val_spd_500

////////////////////////////////////////////////////////// Upper & Lower Strikes

upper_strike = syminfo.root == sym_001_spd_1 ? upper_spd_1 : syminfo.root == sym_069_spd_10 ? upper_spd_10 : syminfo.root == sym_136_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_002_spd_1 ? upper_spd_1 : syminfo.root == sym_070_spd_10 ? upper_spd_10 : syminfo.root == sym_137_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_003_spd_1 ? upper_spd_1 : syminfo.root == sym_071_spd_10 ? upper_spd_10 : syminfo.root == sym_138_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_004_spd_1 ? upper_spd_1 : syminfo.root == sym_072_spd_10 ? upper_spd_10 : syminfo.root == sym_139_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_005_spd_1 ? upper_spd_1 : syminfo.root == sym_073_spd_10 ? upper_spd_10 : syminfo.root == sym_140_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_006_spd_1 ? upper_spd_1 : syminfo.root == sym_074_spd_10 ? upper_spd_10 : syminfo.root == sym_141_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_007_spd_1 ? upper_spd_1 : syminfo.root == sym_075_spd_10 ? upper_spd_10 : syminfo.root == sym_142_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_008_spd_1 ? upper_spd_1 : syminfo.root == sym_076_spd_10 ? upper_spd_10 : syminfo.root == sym_143_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_009_spd_1 ? upper_spd_1 : syminfo.root == sym_077_spd_10 ? upper_spd_10 : syminfo.root == sym_144_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_010_spd_1 ? upper_spd_1 : syminfo.root == sym_078_spd_10 ? upper_spd_10 : syminfo.root == sym_145_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_011_spd_1 ? upper_spd_1 : syminfo.root == sym_079_spd_10 ? upper_spd_10 : syminfo.root == sym_146_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_012_spd_1 ? upper_spd_1 : syminfo.root == sym_080_spd_10 ? upper_spd_10 : syminfo.root == sym_147_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_013_spd_1 ? upper_spd_1 : syminfo.root == sym_081_spd_10 ? upper_spd_10 : syminfo.root == sym_148_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_014_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_082_spd_10 ? upper_spd_10 : syminfo.root == sym_149_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_015_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_083_spd_10 ? upper_spd_10 : syminfo.root == sym_150_spd_50 ? upper_spd_50 : 
	 syminfo.root == sym_016_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_084_spd_10 ? upper_spd_10 : syminfo.root == sym_151_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_017_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_085_spd_10 ? upper_spd_10 : syminfo.root == sym_152_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_018_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_086_spd_10 ? upper_spd_10 : syminfo.root == sym_153_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_019_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_087_spd_10 ? upper_spd_10 : syminfo.root == sym_154_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_020_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_088_spd_10 ? upper_spd_10 : syminfo.root == sym_155_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_021_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_089_spd_10 ? upper_spd_10 : syminfo.root == sym_156_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_022_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_090_spd_10 ? upper_spd_10 : syminfo.root == sym_157_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_023_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_091_spd_10 ? upper_spd_10 : syminfo.root == sym_158_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_024_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_092_spd_10 ? upper_spd_10 : syminfo.root == sym_159_spd_20 ? upper_spd_20 : 
	 syminfo.root == sym_025_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_093_spd_10 ? upper_spd_10 : syminfo.root == sym_160_spd_50 ? upper_spd_50 : 
	 syminfo.root == sym_026_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_094_spd_10 ? upper_spd_10 : syminfo.root == sym_161_spd_50 ? upper_spd_50 : 
	 syminfo.root == sym_027_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_095_spd_10 ? upper_spd_10 : syminfo.root == sym_162_spd_50 ? upper_spd_50 : 
	 syminfo.root == sym_028_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_096_spd_10 ? upper_spd_10 : syminfo.root == sym_163_spd_50 ? upper_spd_50 : 
	 syminfo.root == sym_029_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_097_spd_10 ? upper_spd_10 : syminfo.root == sym_164_spd_50 ? upper_spd_50 : 
	 syminfo.root == sym_030_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_098_spd_100 ? upper_spd_100 : syminfo.root == sym_165_spd_50 ? upper_spd_50 : 
	 syminfo.root == sym_031_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_099_spd_10 ? upper_spd_10 : syminfo.root == sym_166_spd_50 ? upper_spd_50 : 
	 syminfo.root == sym_032_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_100_spd_10 ? upper_spd_10 : syminfo.root == sym_167_spd_50 ? upper_spd_50 : 
	 syminfo.root == sym_033_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_101_spd_10 ? upper_spd_10 : syminfo.root == sym_168_spd_50 ? upper_spd_50 : 
	 syminfo.root == sym_034_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_102_spd_10 ? upper_spd_10 : syminfo.root == sym_169_spd_50 ? upper_spd_50 : 
	 syminfo.root == sym_035_spd_2_5 ? upper_spd_2_5 : syminfo.root == sym_103_spd_10 ? upper_spd_10 : syminfo.root == sym_170_spd_50 ? upper_spd_50 : 
	 syminfo.root == sym_036_spd_5 ? upper_spd_5 : syminfo.root == sym_104_spd_10 ? upper_spd_10 : syminfo.root == sym_171_spd_50 ? upper_spd_50 : 
	 syminfo.root == sym_037_spd_5 ? upper_spd_5 : syminfo.root == sym_105_spd_10 ? upper_spd_10 : syminfo.root == sym_172_spd_50 ? upper_spd_50 : 
	 syminfo.root == sym_038_spd_5 ? upper_spd_5 : syminfo.root == sym_106_spd_10 ? upper_spd_10 : syminfo.root == sym_173_spd_50 ? upper_spd_50 : 
	 syminfo.root == sym_039_spd_5 ? upper_spd_5 : syminfo.root == sym_107_spd_10 ? upper_spd_10 : syminfo.root == sym_174_spd_50 ? upper_spd_50 : 
	 syminfo.root == sym_040_spd_5 ? upper_spd_5 : syminfo.root == sym_108_spd_10 ? upper_spd_10 : syminfo.root == sym_175_spd_50 ? upper_spd_50 : 
	 syminfo.root == sym_041_spd_5 ? upper_spd_5 : syminfo.root == sym_109_spd_10 ? upper_spd_10 : syminfo.root == sym_176_spd_50 ? upper_spd_50 : 
	 syminfo.root == sym_042_spd_5 ? upper_spd_5 : syminfo.root == sym_110_spd_10 ? upper_spd_10 : syminfo.root == sym_177_spd_100 ? upper_spd_100 : 
	 syminfo.root == sym_043_spd_5 ? upper_spd_5 : syminfo.root == sym_111_spd_10 ? upper_spd_10 : syminfo.root == sym_178_spd_100 ? upper_spd_100 : 
	 syminfo.root == sym_044_spd_5 ? upper_spd_5 : syminfo.root == sym_112_spd_20 ? upper_spd_20 : syminfo.root == sym_179_spd_100 ? upper_spd_100 : 
	 syminfo.root == sym_045_spd_5 ? upper_spd_5 : syminfo.root == sym_113_spd_20 ? upper_spd_20 : syminfo.root == sym_180_spd_100 ? upper_spd_100 : 
	 syminfo.root == sym_046_spd_5 ? upper_spd_5 : syminfo.root == sym_114_spd_20 ? upper_spd_20 : syminfo.root == sym_181_spd_100 ? upper_spd_100 : 
	 syminfo.root == sym_047_spd_5 ? upper_spd_5 : syminfo.root == sym_115_spd_20 ? upper_spd_20 : syminfo.root == sym_182_spd_100 ? upper_spd_100 : 
	 syminfo.root == sym_048_spd_5 ? upper_spd_5 : syminfo.root == sym_116_spd_20 ? upper_spd_20 : syminfo.root == sym_183_spd_100 ? upper_spd_100 : 
	 syminfo.root == sym_049_spd_5 ? upper_spd_5 : syminfo.root == sym_117_spd_20 ? upper_spd_20 : syminfo.root == sym_184_spd_100 ? upper_spd_100 : 
	 syminfo.root == sym_050_spd_5 ? upper_spd_5 : syminfo.root == sym_118_spd_20 ? upper_spd_20 : syminfo.root == sym_185_spd_100 ? upper_spd_100 : 
	 syminfo.root == sym_051_spd_5 ? upper_spd_5 : syminfo.root == sym_119_spd_20 ? upper_spd_20 : syminfo.root == sym_186_spd_100 ? upper_spd_100 : 
	 syminfo.root == sym_052_spd_5 ? upper_spd_5 : syminfo.root == sym_120_spd_20 ? upper_spd_20 : syminfo.root == sym_187_spd_100 ? upper_spd_100 : 
	 syminfo.root == sym_053_spd_5 ? upper_spd_5 : syminfo.root == sym_121_spd_20 ? upper_spd_20 : syminfo.root == sym_188_spd_100 ? upper_spd_100 : 
	 syminfo.root == sym_054_spd_5 ? upper_spd_5 : syminfo.root == sym_122_spd_20 ? upper_spd_20 : syminfo.root == sym_189_spd_100 ? upper_spd_100 : 
	 syminfo.root == sym_055_spd_5 ? upper_spd_5 : syminfo.root == sym_123_spd_100 ? upper_spd_100 : syminfo.root == sym_190_spd_100 ? upper_spd_100 : 
	 syminfo.root == sym_056_spd_5 ? upper_spd_5 : syminfo.root == sym_124_spd_20 ? upper_spd_20 : syminfo.root == sym_191_spd_100 ? upper_spd_100 : 
	 syminfo.root == sym_057_spd_5 ? upper_spd_5 : syminfo.root == sym_125_spd_20 ? upper_spd_20 : syminfo.root == sym_192_spd_100 ? upper_spd_100 : 
	 syminfo.root == sym_058_spd_5 ? upper_spd_5 : syminfo.root == sym_126_spd_20 ? upper_spd_20 : syminfo.root == sym_193_spd_100 ? upper_spd_100 : 
	 syminfo.root == sym_059_spd_5 ? upper_spd_5 : syminfo.root == sym_127_spd_20 ? upper_spd_20 : syminfo.root == sym_194_spd_200 ? upper_spd_200 : 
	 syminfo.root == sym_060_spd_5 ? upper_spd_5 : syminfo.root == sym_128_spd_20 ? upper_spd_20 : syminfo.root == sym_195_spd_250 ? upper_spd_250 : 
	 syminfo.root == sym_061_spd_5 ? upper_spd_5 : syminfo.root == sym_129_spd_20 ? upper_spd_20 : syminfo.root == sym_196_spd_50 ? upper_spd_50 : 
	 syminfo.root == sym_062_spd_5 ? upper_spd_5 : syminfo.root == sym_130_spd_20 ? upper_spd_20 : syminfo.root == sym_197_spd_250 ? upper_spd_250 : 
	 syminfo.root == sym_063_spd_5 ? upper_spd_5 : syminfo.root == sym_131_spd_20 ? upper_spd_20 : syminfo.root == sym_198_spd_250 ? upper_spd_250 : 
	 syminfo.root == sym_064_spd_5 ? upper_spd_5 : syminfo.root == sym_132_spd_20 ? upper_spd_20 : syminfo.root == sym_199_spd_250 ? upper_spd_250 : 
	 syminfo.root == sym_065_spd_5 ? upper_spd_5 : syminfo.root == sym_133_spd_20 ? upper_spd_20 : syminfo.root == sym_200_spd_500 ? upper_spd_500 : 
	 syminfo.root == sym_066_spd_5 ? upper_spd_5 : syminfo.root == sym_134_spd_20 ? upper_spd_20 : syminfo.root == sym_201_spd_500 ? upper_spd_500 : 
	 syminfo.root == sym_067_spd_5 ? upper_spd_5 : syminfo.root == sym_135_spd_20 ? upper_spd_20 : syminfo.root == sym_202_spd_500 ? upper_spd_500 : 
	 syminfo.root == sym_068_spd_8_5 ? upper_spd_8_5 : na

lower_strike = syminfo.root == sym_001_spd_1 ? lower_spd_1 : syminfo.root == sym_069_spd_10 ? lower_spd_10 : syminfo.root == sym_136_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_002_spd_1 ? lower_spd_1 : syminfo.root == sym_070_spd_10 ? lower_spd_10 : syminfo.root == sym_137_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_003_spd_1 ? lower_spd_1 : syminfo.root == sym_071_spd_10 ? lower_spd_10 : syminfo.root == sym_138_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_004_spd_1 ? lower_spd_1 : syminfo.root == sym_072_spd_10 ? lower_spd_10 : syminfo.root == sym_139_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_005_spd_1 ? lower_spd_1 : syminfo.root == sym_073_spd_10 ? lower_spd_10 : syminfo.root == sym_140_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_006_spd_1 ? lower_spd_1 : syminfo.root == sym_074_spd_10 ? lower_spd_10 : syminfo.root == sym_141_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_007_spd_1 ? lower_spd_1 : syminfo.root == sym_075_spd_10 ? lower_spd_10 : syminfo.root == sym_142_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_008_spd_1 ? lower_spd_1 : syminfo.root == sym_076_spd_10 ? lower_spd_10 : syminfo.root == sym_143_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_009_spd_1 ? lower_spd_1 : syminfo.root == sym_077_spd_10 ? lower_spd_10 : syminfo.root == sym_144_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_010_spd_1 ? lower_spd_1 : syminfo.root == sym_078_spd_10 ? lower_spd_10 : syminfo.root == sym_145_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_011_spd_1 ? lower_spd_1 : syminfo.root == sym_079_spd_10 ? lower_spd_10 : syminfo.root == sym_146_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_012_spd_1 ? lower_spd_1 : syminfo.root == sym_080_spd_10 ? lower_spd_10 : syminfo.root == sym_147_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_013_spd_1 ? lower_spd_1 : syminfo.root == sym_081_spd_10 ? lower_spd_10 : syminfo.root == sym_148_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_014_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_082_spd_10 ? lower_spd_10 : syminfo.root == sym_149_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_015_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_083_spd_10 ? lower_spd_10 : syminfo.root == sym_150_spd_50 ? lower_spd_50 : 
	 syminfo.root == sym_016_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_084_spd_10 ? lower_spd_10 : syminfo.root == sym_151_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_017_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_085_spd_10 ? lower_spd_10 : syminfo.root == sym_152_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_018_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_086_spd_10 ? lower_spd_10 : syminfo.root == sym_153_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_019_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_087_spd_10 ? lower_spd_10 : syminfo.root == sym_154_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_020_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_088_spd_10 ? lower_spd_10 : syminfo.root == sym_155_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_021_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_089_spd_10 ? lower_spd_10 : syminfo.root == sym_156_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_022_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_090_spd_10 ? lower_spd_10 : syminfo.root == sym_157_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_023_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_091_spd_10 ? lower_spd_10 : syminfo.root == sym_158_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_024_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_092_spd_10 ? lower_spd_10 : syminfo.root == sym_159_spd_20 ? lower_spd_20 : 
	 syminfo.root == sym_025_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_093_spd_10 ? lower_spd_10 : syminfo.root == sym_160_spd_50 ? lower_spd_50 : 
	 syminfo.root == sym_026_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_094_spd_10 ? lower_spd_10 : syminfo.root == sym_161_spd_50 ? lower_spd_50 : 
	 syminfo.root == sym_027_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_095_spd_10 ? lower_spd_10 : syminfo.root == sym_162_spd_50 ? lower_spd_50 : 
	 syminfo.root == sym_028_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_096_spd_10 ? lower_spd_10 : syminfo.root == sym_163_spd_50 ? lower_spd_50 : 
	 syminfo.root == sym_029_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_097_spd_10 ? lower_spd_10 : syminfo.root == sym_164_spd_50 ? lower_spd_50 : 
	 syminfo.root == sym_030_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_098_spd_100 ? lower_spd_100 : syminfo.root == sym_165_spd_50 ? lower_spd_50 : 
	 syminfo.root == sym_031_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_099_spd_10 ? lower_spd_10 : syminfo.root == sym_166_spd_50 ? lower_spd_50 : 
	 syminfo.root == sym_032_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_100_spd_10 ? lower_spd_10 : syminfo.root == sym_167_spd_50 ? lower_spd_50 : 
	 syminfo.root == sym_033_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_101_spd_10 ? lower_spd_10 : syminfo.root == sym_168_spd_50 ? lower_spd_50 : 
	 syminfo.root == sym_034_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_102_spd_10 ? lower_spd_10 : syminfo.root == sym_169_spd_50 ? lower_spd_50 : 
	 syminfo.root == sym_035_spd_2_5 ? lower_spd_2_5 : syminfo.root == sym_103_spd_10 ? lower_spd_10 : syminfo.root == sym_170_spd_50 ? lower_spd_50 : 
	 syminfo.root == sym_036_spd_5 ? lower_spd_5 : syminfo.root == sym_104_spd_10 ? lower_spd_10 : syminfo.root == sym_171_spd_50 ? lower_spd_50 : 
	 syminfo.root == sym_037_spd_5 ? lower_spd_5 : syminfo.root == sym_105_spd_10 ? lower_spd_10 : syminfo.root == sym_172_spd_50 ? lower_spd_50 : 
	 syminfo.root == sym_038_spd_5 ? lower_spd_5 : syminfo.root == sym_106_spd_10 ? lower_spd_10 : syminfo.root == sym_173_spd_50 ? lower_spd_50 : 
	 syminfo.root == sym_039_spd_5 ? lower_spd_5 : syminfo.root == sym_107_spd_10 ? lower_spd_10 : syminfo.root == sym_174_spd_50 ? lower_spd_50 : 
	 syminfo.root == sym_040_spd_5 ? lower_spd_5 : syminfo.root == sym_108_spd_10 ? lower_spd_10 : syminfo.root == sym_175_spd_50 ? lower_spd_50 : 
	 syminfo.root == sym_041_spd_5 ? lower_spd_5 : syminfo.root == sym_109_spd_10 ? lower_spd_10 : syminfo.root == sym_176_spd_50 ? lower_spd_50 : 
	 syminfo.root == sym_042_spd_5 ? lower_spd_5 : syminfo.root == sym_110_spd_10 ? lower_spd_10 : syminfo.root == sym_177_spd_100 ? lower_spd_100 : 
	 syminfo.root == sym_043_spd_5 ? lower_spd_5 : syminfo.root == sym_111_spd_10 ? lower_spd_10 : syminfo.root == sym_178_spd_100 ? lower_spd_100 : 
	 syminfo.root == sym_044_spd_5 ? lower_spd_5 : syminfo.root == sym_112_spd_20 ? lower_spd_20 : syminfo.root == sym_179_spd_100 ? lower_spd_100 : 
	 syminfo.root == sym_045_spd_5 ? lower_spd_5 : syminfo.root == sym_113_spd_20 ? lower_spd_20 : syminfo.root == sym_180_spd_100 ? lower_spd_100 : 
	 syminfo.root == sym_046_spd_5 ? lower_spd_5 : syminfo.root == sym_114_spd_20 ? lower_spd_20 : syminfo.root == sym_181_spd_100 ? lower_spd_100 : 
	 syminfo.root == sym_047_spd_5 ? lower_spd_5 : syminfo.root == sym_115_spd_20 ? lower_spd_20 : syminfo.root == sym_182_spd_100 ? lower_spd_100 : 
	 syminfo.root == sym_048_spd_5 ? lower_spd_5 : syminfo.root == sym_116_spd_20 ? lower_spd_20 : syminfo.root == sym_183_spd_100 ? lower_spd_100 : 
	 syminfo.root == sym_049_spd_5 ? lower_spd_5 : syminfo.root == sym_117_spd_20 ? lower_spd_20 : syminfo.root == sym_184_spd_100 ? lower_spd_100 : 
	 syminfo.root == sym_050_spd_5 ? lower_spd_5 : syminfo.root == sym_118_spd_20 ? lower_spd_20 : syminfo.root == sym_185_spd_100 ? lower_spd_100 : 
	 syminfo.root == sym_051_spd_5 ? lower_spd_5 : syminfo.root == sym_119_spd_20 ? lower_spd_20 : syminfo.root == sym_186_spd_100 ? lower_spd_100 : 
	 syminfo.root == sym_052_spd_5 ? lower_spd_5 : syminfo.root == sym_120_spd_20 ? lower_spd_20 : syminfo.root == sym_187_spd_100 ? lower_spd_100 : 
	 syminfo.root == sym_053_spd_5 ? lower_spd_5 : syminfo.root == sym_121_spd_20 ? lower_spd_20 : syminfo.root == sym_188_spd_100 ? lower_spd_100 : 
	 syminfo.root == sym_054_spd_5 ? lower_spd_5 : syminfo.root == sym_122_spd_20 ? lower_spd_20 : syminfo.root == sym_189_spd_100 ? lower_spd_100 : 
	 syminfo.root == sym_055_spd_5 ? lower_spd_5 : syminfo.root == sym_123_spd_100 ? lower_spd_100 : syminfo.root == sym_190_spd_100 ? lower_spd_100 : 
	 syminfo.root == sym_056_spd_5 ? lower_spd_5 : syminfo.root == sym_124_spd_20 ? lower_spd_20 : syminfo.root == sym_191_spd_100 ? lower_spd_100 : 
	 syminfo.root == sym_057_spd_5 ? lower_spd_5 : syminfo.root == sym_125_spd_20 ? lower_spd_20 : syminfo.root == sym_192_spd_100 ? lower_spd_100 : 
	 syminfo.root == sym_058_spd_5 ? lower_spd_5 : syminfo.root == sym_126_spd_20 ? lower_spd_20 : syminfo.root == sym_193_spd_100 ? lower_spd_100 : 
	 syminfo.root == sym_059_spd_5 ? lower_spd_5 : syminfo.root == sym_127_spd_20 ? lower_spd_20 : syminfo.root == sym_194_spd_200 ? lower_spd_200 : 
	 syminfo.root == sym_060_spd_5 ? lower_spd_5 : syminfo.root == sym_128_spd_20 ? lower_spd_20 : syminfo.root == sym_195_spd_250 ? lower_spd_250 : 
	 syminfo.root == sym_061_spd_5 ? lower_spd_5 : syminfo.root == sym_129_spd_20 ? lower_spd_20 : syminfo.root == sym_196_spd_50 ? lower_spd_50 : 
	 syminfo.root == sym_062_spd_5 ? lower_spd_5 : syminfo.root == sym_130_spd_20 ? lower_spd_20 : syminfo.root == sym_197_spd_250 ? lower_spd_250 : 
	 syminfo.root == sym_063_spd_5 ? lower_spd_5 : syminfo.root == sym_131_spd_20 ? lower_spd_20 : syminfo.root == sym_198_spd_250 ? lower_spd_250 : 
	 syminfo.root == sym_064_spd_5 ? lower_spd_5 : syminfo.root == sym_132_spd_20 ? lower_spd_20 : syminfo.root == sym_199_spd_250 ? lower_spd_250 : 
	 syminfo.root == sym_065_spd_5 ? lower_spd_5 : syminfo.root == sym_133_spd_20 ? lower_spd_20 : syminfo.root == sym_200_spd_500 ? lower_spd_500 : 
	 syminfo.root == sym_066_spd_5 ? lower_spd_5 : syminfo.root == sym_134_spd_20 ? lower_spd_20 : syminfo.root == sym_201_spd_500 ? lower_spd_500 : 
	 syminfo.root == sym_067_spd_5 ? lower_spd_5 : syminfo.root == sym_135_spd_20 ? lower_spd_20 : syminfo.root == sym_202_spd_500 ? lower_spd_500 : 
	 syminfo.root == sym_068_spd_8_5 ? lower_spd_8_5 : na	 

////////////////////////////////////////////////////////// Strike Price Difference

spd = upper_strike - lower_strike

////////////////////////////////////////////////////////// Higher Strikes

upper_strike_2 = upper_strike + spd
upper_strike_3 = upper_strike + (2 * spd)
upper_strike_4 = upper_strike + (3 * spd)
upper_strike_5 = upper_strike + (i_r_5x_level * spd)

lower_strike_2 = lower_strike - spd
lower_strike_3 = lower_strike - (2 * spd)
lower_strike_4 = lower_strike - (3 * spd)
lower_strike_5 = lower_strike - (i_s_5x_level * spd)

////////////////////////////////////////////////////////// Average Levels

up_lo_avg = math.avg(upper_strike, lower_strike)

up_avg_2 = math.avg(upper_strike, upper_strike_2)
up_avg_3 = math.avg(upper_strike_2, upper_strike_3)
up_avg_4 = math.avg(upper_strike_3, upper_strike_4)
up_avg_5 = math.avg(upper_strike_4, upper_strike_5)

lo_avg_2 = math.avg(lower_strike, lower_strike_2)
lo_avg_3 = math.avg(lower_strike_2, lower_strike_3)
lo_avg_4 = math.avg(lower_strike_3, lower_strike_4)
lo_avg_5 = math.avg(lower_strike_4, lower_strike_5)

////////////////////////////////////////////////////////// Percentage from Close

up_percent_1 = ((close - upper_strike)/close)*100
up_percent_2 = ((close - upper_strike_2)/close)*100
up_percent_3 = ((close - upper_strike_3)/close)*100
up_percent_4 = ((close - upper_strike_4)/close)*100
up_percent_5 = ((close - upper_strike_5)/close)*100

lo_percent_1 = ((close - lower_strike)/close)*100
lo_percent_2 = ((close - lower_strike_2)/close)*100
lo_percent_3 = ((close - lower_strike_3)/close)*100
lo_percent_4 = ((close - lower_strike_4)/close)*100
lo_percent_5 = ((close - lower_strike_5)/close)*100

//////////////////////////////////////////////////////////  Points from Close

up_points_1 = upper_strike - close
up_points_2 = upper_strike_2 - close
up_points_3 = upper_strike_3 - close
up_points_4 = upper_strike_4 - close
up_points_5 = upper_strike_5 - close

lo_points_1 = lower_strike - close
lo_points_2 = lower_strike_2 - close
lo_points_3 = lower_strike_3 - close
lo_points_4 = lower_strike_4 - close
lo_points_5 = lower_strike_5 - close

////////////////////////////////////////////////////////// Draw Lines & Labels

// Narest Strike Price

if show_pp
    var line upper_line_1 = na
    upper_line_1 := line.new(x1=bar_index - 225, y1=upper_strike, x2=bar_index + 10, y2=upper_strike, color=i_r_col, width=i_pp_width, style=i_pp_style, extend=ext_option)
    line.delete(upper_line_1[1])
    if show_pp_label
        var label upper_label_1 = na
        upper_label_1 := label.new(x=bar_index + 10, y=upper_strike, text=str.tostring(upper_strike, "#.## (") + str.tostring(up_percent_1, "#.##") + "%｜" + str.tostring(up_points_1, "#.##") + ")", style=label.style_label_left, color=color.new(color.white, 100), textcolor=i_r_col)
        label.delete(upper_label_1[1])

    var line lower_line_1 = na
    lower_line_1 := line.new(x1=bar_index - 225, y1=lower_strike, x2=bar_index + 10, y2=lower_strike, color=i_s_col, width=i_pp_width, style=i_pp_style, extend=ext_option)
    line.delete(lower_line_1[1])
    if show_pp_label
        var label lower_label_1 = na
        lower_label_1 := label.new(x=bar_index + 10, y=lower_strike, text=str.tostring(lower_strike, "#.## (") + str.tostring(lo_percent_1, "#.##") + "%｜" + str.tostring(lo_points_1, "#.##") + ")", style=label.style_label_left, color=color.new(color.white, 100), textcolor=i_s_col)
        label.delete(lower_label_1[1])

    linefill.new(upper_line_1, lower_line_1, color.new(color.silver, 95))

if show_avg and show_pp
    var line up_lo_line = na
    up_lo_line := line.new(x1=bar_index - 225, y1=up_lo_avg, x2=bar_index + 10, y2=up_lo_avg, color=color.silver, width=i_pp_avg_width, style=i_pp_avg_style, extend=ext_option)
    line.delete(up_lo_line[1])

// Upper Lines

if show_r_2 and show_pp
    var line upper_line_2 = na
    upper_line_2 := line.new(x1=bar_index - 225, y1=upper_strike_2, x2=bar_index + 10, y2=upper_strike_2, color=i_r_col, width=i_pp_width, style=i_pp_style, extend=ext_option)
    line.delete(upper_line_2[1])
    if show_pp_label
        var label upper_label_2 = na
        upper_label_2 := label.new(x=bar_index + 10, y=upper_strike_2, text=str.tostring(upper_strike_2, "#.## (") + str.tostring(up_percent_2, "#.##") + "%｜" + str.tostring(up_points_2, "#.##") + ")", style=label.style_label_left, color=color.new(color.white, 100), textcolor=i_r_col)
        label.delete(upper_label_2[1])
    if show_avg
        var line up_avg_2_line = na
        up_avg_2_line := line.new(x1=bar_index - 225, y1=up_avg_2, x2=bar_index + 10, y2=up_avg_2, color=i_r_col, width=i_pp_avg_width, style=i_pp_avg_style, extend=ext_option)
        line.delete(up_avg_2_line[1])

if show_r_3 and show_pp
    var line upper_line_3 = na
    upper_line_3 := line.new(x1=bar_index - 225, y1=upper_strike_3, x2=bar_index + 10, y2=upper_strike_3, color=i_r_col, width=i_pp_width, style=i_pp_style, extend=ext_option)
    line.delete(upper_line_3[1])
    if show_pp_label
        var label upper_label_3 = na
        upper_label_3 := label.new(x=bar_index + 10, y=upper_strike_3, text=str.tostring(upper_strike_3, "#.## (") + str.tostring(up_percent_3, "#.##") + "%｜" + str.tostring(up_points_3, "#.##") + ")", style=label.style_label_left, color=color.new(color.white, 100), textcolor=i_r_col)
        label.delete(upper_label_3[1])
    if show_avg
        var line up_avg_3_line = na
        up_avg_3_line := line.new(x1=bar_index - 225, y1=up_avg_3, x2=bar_index + 10, y2=up_avg_3, color=i_r_col, width=i_pp_avg_width, style=i_pp_avg_style, extend=ext_option)
        line.delete(up_avg_3_line[1])

if show_r_4 and show_pp
    var line upper_line_4 = na
    upper_line_4 := line.new(x1=bar_index - 225, y1=upper_strike_4, x2=bar_index + 10, y2=upper_strike_4, color=i_r_col, width=i_pp_width, style=i_pp_style, extend=ext_option)
    line.delete(upper_line_4[1])
    if show_pp_label
        var label upper_label_4 = na
        upper_label_4 := label.new(x=bar_index + 10, y=upper_strike_4, text=str.tostring(upper_strike_4, "#.## (") + str.tostring(up_percent_4, "#.##") + "%｜" + str.tostring(up_points_4, "#.##") + ")", style=label.style_label_left, color=color.new(color.white, 100), textcolor=i_r_col)
        label.delete(upper_label_4[1])
    if show_avg
        var line up_avg_4_line = na
        up_avg_4_line := line.new(x1=bar_index - 225, y1=up_avg_4, x2=bar_index + 10, y2=up_avg_4, color=i_r_col, width=i_pp_avg_width, style=i_pp_avg_style, extend=ext_option)
        line.delete(up_avg_4_line[1])

if show_r_5 and show_pp
    var line upper_line_5 = na
    upper_line_5 := line.new(x1=bar_index - 225, y1=upper_strike_5, x2=bar_index + 10, y2=upper_strike_5, color=i_r_col, width=i_pp_width, style=i_pp_style, extend=ext_option)
    line.delete(upper_line_5[1])
    if show_pp_label
        var label upper_label_5 = na
        upper_label_5 := label.new(x=bar_index + 10, y=upper_strike_5, text=str.tostring(upper_strike_5, "#.## (") + str.tostring(up_percent_5, "#.##") + "%｜" + str.tostring(up_points_5, "#.##") + ")", style=label.style_label_left, color=color.new(color.white, 100), textcolor=i_r_col)
        label.delete(upper_label_5[1])
    if show_avg
        var line up_avg_5_line = na
        up_avg_5_line := line.new(x1=bar_index - 225, y1=up_avg_5, x2=bar_index + 10, y2=up_avg_5, color=i_r_col, width=i_pp_avg_width, style=i_pp_avg_style, extend=ext_option)
        line.delete(up_avg_5_line[1])

// Lower Lines

if show_s_2 and show_pp
    var line lower_line_2 = na
    lower_line_2 := line.new(x1=bar_index - 225, y1=lower_strike_2, x2=bar_index + 10, y2=lower_strike_2, color=i_s_col, width=i_pp_width, style=i_pp_style, extend=ext_option)
    line.delete(lower_line_2[1])
    if show_pp_label
        var label lower_label_2 = na
        lower_label_2 := label.new(x=bar_index + 10, y=lower_strike_2, text=str.tostring(lower_strike_2, "#.## (") + str.tostring(lo_percent_2, "#.##") + "%｜" + str.tostring(lo_points_2, "#.##") + ")", style=label.style_label_left, color=color.new(color.white, 100), textcolor=i_s_col)
        label.delete(lower_label_2[1])
    if show_avg
        var line lo_avg_2_line = na
        lo_avg_2_line := line.new(x1=bar_index - 225, y1=lo_avg_2, x2=bar_index + 10, y2=lo_avg_2, color=i_s_col, width=i_pp_avg_width, style=i_pp_avg_style, extend=ext_option)
        line.delete(lo_avg_2_line[1])

if show_s_3 and show_pp
    var line lower_line_3 = na
    lower_line_3 := line.new(x1=bar_index - 225, y1=lower_strike_3, x2=bar_index + 10, y2=lower_strike_3, color=i_s_col, width=i_pp_width, style=i_pp_style, extend=ext_option)
    line.delete(lower_line_3[1])
    if show_pp_label
        var label lower_label_3 = na
        lower_label_3 := label.new(x=bar_index + 10, y=lower_strike_3, text=str.tostring(lower_strike_3, "#.## (") + str.tostring(lo_percent_3, "#.##") + "%｜" + str.tostring(lo_points_3, "#.##") + ")", style=label.style_label_left, color=color.new(color.white, 100), textcolor=i_s_col)
        label.delete(lower_label_3[1])
    if show_avg
        var line lo_avg_3_line = na
        lo_avg_3_line := line.new(x1=bar_index - 225, y1=lo_avg_3, x2=bar_index + 10, y2=lo_avg_3, color=i_s_col, width=i_pp_avg_width, style=i_pp_avg_style, extend=ext_option)
        line.delete(lo_avg_3_line[1])

if show_s_4 and show_pp
    var line lower_line_4 = na
    lower_line_4 := line.new(x1=bar_index - 225, y1=lower_strike_4, x2=bar_index + 10, y2=lower_strike_4, color=i_s_col, width=i_pp_width, style=i_pp_style, extend=ext_option)
    line.delete(lower_line_4[1])
    if show_pp_label
        var label lower_label_4 = na
        lower_label_4 := label.new(x=bar_index + 10, y=lower_strike_4, text=str.tostring(lower_strike_4, "#.## (") + str.tostring(lo_percent_4, "#.##") + "%｜" + str.tostring(lo_points_4, "#.##") + ")", style=label.style_label_left, color=color.new(color.white, 100), textcolor=i_s_col)
        label.delete(lower_label_4[1])
    if show_avg
        var line lo_avg_4_line = na
        lo_avg_4_line := line.new(x1=bar_index - 225, y1=lo_avg_4, x2=bar_index + 10, y2=lo_avg_4, color=i_s_col, width=i_pp_avg_width, style=i_pp_avg_style, extend=ext_option)
        line.delete(lo_avg_4_line[1])

if show_s_5 and show_pp
    var line lower_line_5 = na
    lower_line_5 := line.new(x1=bar_index - 225, y1=lower_strike_5, x2=bar_index + 10, y2=lower_strike_5, color=i_s_col, width=i_pp_width, style=i_pp_style, extend=ext_option)
    line.delete(lower_line_5[1])
    if show_pp_label
        var label lower_label_5 = na
        lower_label_5 := label.new(x=bar_index + 10, y=lower_strike_5, text=str.tostring(lower_strike_5, "#.## (") + str.tostring(lo_percent_5, "#.##") + "%｜" + str.tostring(lo_points_5, "#.##") + ")", style=label.style_label_left, color=color.new(color.white, 100), textcolor=i_s_col)
        label.delete(lower_label_5[1])
    if show_avg
        var line lo_avg_5_line = na
        lo_avg_5_line := line.new(x1=bar_index - 225, y1=lo_avg_5, x2=bar_index + 10, y2=lo_avg_5, color=i_s_col, width=i_pp_avg_width, style=i_pp_avg_style, extend=ext_option)
        line.delete(lo_avg_5_line[1])




////////////////////////////////////////////////////////// Important Pivots


high_low_time = time(timeframe.period, "1015-1016")
pivot_time = time(timeframe.period, "1015-1530")
no_trade_time = time(timeframe.period, "0915-1014")

high_1hr = ta.valuewhen(no_trade_time, get_high, 0)
low_1hr = ta.valuewhen(no_trade_time, get_low, 0)

////////////////////////////////////////////////////// Price Levels Settings

gpL = "Important Pivots"

//i_r_col = input.color(color.rgb(240, 83, 80), title="", group=gpL, inline="01")
show_rz_1 = input.bool(true, title="R1", group=gpL, inline="01")
show_rz_2 = input.bool(false, title="R2", group=gpL, inline="01")

//s_color = input.color(color.rgb(38, 166, 154), title="", group=gpL, inline="02")
show_sz_1 = input.bool(true, title="S1", group=gpL, inline="01")
show_sz_2 = input.bool(false, title="S2", group=gpL, inline="01")

//show_last = input.bool(true, title="Hide Historical", group=gpL, inline="02")
//islast = show_last ? request.security(syminfo.tickerid, i_timeframe, barstate.islast, lookahead=barmerge.lookahead_on) : true

////////////////////////////////////////////////////////// Strike Price Difference Formula

// Strike Price Difference 1
upper_val_spd_1_plot = math.round(high_1hr / spd_1, 0) * spd_1
lower_val_spd_1_plot = math.round(low_1hr / spd_1, 0) * spd_1
upper_spd_1_plot = upper_val_spd_1_plot < high_1hr ? upper_val_spd_1_plot + spd_1 : upper_val_spd_1_plot
lower_spd_1_plot = lower_val_spd_1_plot > low_1hr ? lower_val_spd_1_plot - spd_1 : lower_val_spd_1_plot

// Strike Price Difference 2.5
upper_val_spd_2_5_plot = math.round(high_1hr / spd_2_5, 0) * spd_2_5
lower_val_spd_2_5_plot = math.round(low_1hr / spd_2_5, 0) * spd_2_5
upper_spd_2_5_plot = upper_val_spd_2_5_plot < high_1hr ? upper_val_spd_2_5_plot + spd_2_5 : upper_val_spd_2_5_plot
lower_spd_2_5_plot = lower_val_spd_2_5_plot > low_1hr ? lower_val_spd_2_5_plot - spd_2_5 : lower_val_spd_2_5_plot

// Strike Price Difference 5
upper_val_spd_5_plot = math.round(high_1hr / spd_5, 0) * spd_5
lower_val_spd_5_plot = math.round(low_1hr / spd_5, 0) * spd_5
upper_spd_5_plot = upper_val_spd_5_plot < high_1hr ? upper_val_spd_5_plot + spd_5 : upper_val_spd_5_plot
lower_spd_5_plot = lower_val_spd_5_plot > low_1hr ? lower_val_spd_5_plot - spd_5 : lower_val_spd_5_plot

// Strike Price Difference 8.5
upper_val_spd_8_5_plot = math.round(high_1hr / spd_8_5, 0) * spd_8_5
lower_val_spd_8_5_plot = math.round(low_1hr / spd_8_5, 0) * spd_8_5
upper_spd_8_5_plot = upper_val_spd_8_5_plot < high_1hr ? upper_val_spd_8_5_plot + spd_8_5 : upper_val_spd_8_5_plot
lower_spd_8_5_plot = lower_val_spd_8_5_plot > low_1hr ? lower_val_spd_8_5_plot - spd_8_5 : lower_val_spd_8_5_plot

// Strike Price Difference 10
upper_val_spd_10_plot = math.round(high_1hr / spd_10, 0) * spd_10
lower_val_spd_10_plot = math.round(low_1hr / spd_10, 0) * spd_10
upper_spd_10_plot = upper_val_spd_10_plot < high_1hr ? upper_val_spd_10_plot + spd_10 : upper_val_spd_10_plot
lower_spd_10_plot = lower_val_spd_10_plot > low_1hr ? lower_val_spd_10_plot - spd_10 : lower_val_spd_10_plot

// Strike Price Difference 20
upper_val_spd_20_plot = math.round(high_1hr / spd_20, 0) * spd_20
lower_val_spd_20_plot = math.round(low_1hr / spd_20, 0) * spd_20
upper_spd_20_plot = upper_val_spd_20_plot < high_1hr ? upper_val_spd_20_plot + spd_20 : upper_val_spd_20_plot
lower_spd_20_plot = lower_val_spd_20_plot > low_1hr ? lower_val_spd_20_plot - spd_20 : lower_val_spd_20_plot

// Strike Price Difference 50 // NIFTY
upper_val_spd_50_plot = math.round(high_1hr / spd_50, 0) * spd_50
lower_val_spd_50_plot = math.round(low_1hr / spd_50, 0) * spd_50
upper_spd_50_plot = upper_val_spd_50_plot < high_1hr ? upper_val_spd_50_plot + spd_50 : upper_val_spd_50_plot
lower_spd_50_plot = lower_val_spd_50_plot > low_1hr ? lower_val_spd_50_plot - spd_50 : lower_val_spd_50_plot

// Strike Price Difference 100 // BANK NIFTY
upper_val_spd_100_plot = math.round(high_1hr / spd_100, 0) * spd_100
lower_val_spd_100_plot = math.round(low_1hr / spd_100, 0) * spd_100
upper_spd_100_plot = upper_val_spd_100_plot < high_1hr ? upper_val_spd_100_plot + spd_100 : upper_val_spd_100_plot
lower_spd_100_plot = lower_val_spd_100_plot > low_1hr ? lower_val_spd_100_plot - spd_100 : lower_val_spd_100_plot

// Strike Price Difference 200
upper_val_spd_200_plot = math.round(high_1hr / spd_200, 0) * spd_200
lower_val_spd_200_plot = math.round(low_1hr / spd_200, 0) * spd_200
upper_spd_200_plot = upper_val_spd_200_plot < high_1hr ? upper_val_spd_200_plot + spd_200 : upper_val_spd_200_plot
lower_spd_200_plot = lower_val_spd_200_plot > low_1hr ? lower_val_spd_200_plot - spd_200 : lower_val_spd_200_plot

// Strike Price Difference 250
upper_val_spd_250_plot = math.round(high_1hr / spd_250, 0) * spd_250
lower_val_spd_250_plot = math.round(low_1hr / spd_250, 0) * spd_250
upper_spd_250_plot = upper_val_spd_250_plot < high_1hr ? upper_val_spd_250_plot + spd_250 : upper_val_spd_250_plot
lower_spd_250_plot = lower_val_spd_250_plot > low_1hr ? lower_val_spd_250_plot - spd_250 : lower_val_spd_250_plot

// Strike Price Difference 500
upper_val_spd_500_plot = math.round(high_1hr / spd_500, 0) * spd_500
lower_val_spd_500_plot = math.round(low_1hr / spd_500, 0) * spd_500
upper_spd_500_plot = upper_val_spd_500_plot < high_1hr ? upper_val_spd_500_plot + spd_500 : upper_val_spd_500_plot
lower_spd_500_plot = lower_val_spd_500_plot > low_1hr ? lower_val_spd_500_plot - spd_500 : lower_val_spd_500_plot

////////////////////////////////////////////////////////// Upper & Lower Strikes

upper_strike_plot = syminfo.root == sym_001_spd_1 ? upper_spd_1_plot : syminfo.root == sym_069_spd_10 ? upper_spd_10_plot : syminfo.root == sym_136_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_002_spd_1 ? upper_spd_1_plot : syminfo.root == sym_070_spd_10 ? upper_spd_10_plot : syminfo.root == sym_137_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_003_spd_1 ? upper_spd_1_plot : syminfo.root == sym_071_spd_10 ? upper_spd_10_plot : syminfo.root == sym_138_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_004_spd_1 ? upper_spd_1_plot : syminfo.root == sym_072_spd_10 ? upper_spd_10_plot : syminfo.root == sym_139_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_005_spd_1 ? upper_spd_1_plot : syminfo.root == sym_073_spd_10 ? upper_spd_10_plot : syminfo.root == sym_140_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_006_spd_1 ? upper_spd_1_plot : syminfo.root == sym_074_spd_10 ? upper_spd_10_plot : syminfo.root == sym_141_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_007_spd_1 ? upper_spd_1_plot : syminfo.root == sym_075_spd_10 ? upper_spd_10_plot : syminfo.root == sym_142_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_008_spd_1 ? upper_spd_1_plot : syminfo.root == sym_076_spd_10 ? upper_spd_10_plot : syminfo.root == sym_143_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_009_spd_1 ? upper_spd_1_plot : syminfo.root == sym_077_spd_10 ? upper_spd_10_plot : syminfo.root == sym_144_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_010_spd_1 ? upper_spd_1_plot : syminfo.root == sym_078_spd_10 ? upper_spd_10_plot : syminfo.root == sym_145_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_011_spd_1 ? upper_spd_1_plot : syminfo.root == sym_079_spd_10 ? upper_spd_10_plot : syminfo.root == sym_146_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_012_spd_1 ? upper_spd_1_plot : syminfo.root == sym_080_spd_10 ? upper_spd_10_plot : syminfo.root == sym_147_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_013_spd_1 ? upper_spd_1_plot : syminfo.root == sym_081_spd_10 ? upper_spd_10_plot : syminfo.root == sym_148_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_014_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_082_spd_10 ? upper_spd_10_plot : syminfo.root == sym_149_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_015_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_083_spd_10 ? upper_spd_10_plot : syminfo.root == sym_150_spd_50 ? upper_spd_50_plot : 
	 syminfo.root == sym_016_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_084_spd_10 ? upper_spd_10_plot : syminfo.root == sym_151_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_017_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_085_spd_10 ? upper_spd_10_plot : syminfo.root == sym_152_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_018_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_086_spd_10 ? upper_spd_10_plot : syminfo.root == sym_153_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_019_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_087_spd_10 ? upper_spd_10_plot : syminfo.root == sym_154_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_020_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_088_spd_10 ? upper_spd_10_plot : syminfo.root == sym_155_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_021_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_089_spd_10 ? upper_spd_10_plot : syminfo.root == sym_156_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_022_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_090_spd_10 ? upper_spd_10_plot : syminfo.root == sym_157_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_023_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_091_spd_10 ? upper_spd_10_plot : syminfo.root == sym_158_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_024_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_092_spd_10 ? upper_spd_10_plot : syminfo.root == sym_159_spd_20 ? upper_spd_20_plot : 
	 syminfo.root == sym_025_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_093_spd_10 ? upper_spd_10_plot : syminfo.root == sym_160_spd_50 ? upper_spd_50_plot : 
	 syminfo.root == sym_026_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_094_spd_10 ? upper_spd_10_plot : syminfo.root == sym_161_spd_50 ? upper_spd_50_plot : 
	 syminfo.root == sym_027_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_095_spd_10 ? upper_spd_10_plot : syminfo.root == sym_162_spd_50 ? upper_spd_50_plot : 
	 syminfo.root == sym_028_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_096_spd_10 ? upper_spd_10_plot : syminfo.root == sym_163_spd_50 ? upper_spd_50_plot : 
	 syminfo.root == sym_029_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_097_spd_10 ? upper_spd_10_plot : syminfo.root == sym_164_spd_50 ? upper_spd_50_plot : 
	 syminfo.root == sym_030_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_098_spd_100 ? upper_spd_100_plot : syminfo.root == sym_165_spd_50 ? upper_spd_50_plot : 
	 syminfo.root == sym_031_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_099_spd_10 ? upper_spd_10_plot : syminfo.root == sym_166_spd_50 ? upper_spd_50_plot : 
	 syminfo.root == sym_032_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_100_spd_10 ? upper_spd_10_plot : syminfo.root == sym_167_spd_50 ? upper_spd_50_plot : 
	 syminfo.root == sym_033_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_101_spd_10 ? upper_spd_10_plot : syminfo.root == sym_168_spd_50 ? upper_spd_50_plot : 
	 syminfo.root == sym_034_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_102_spd_10 ? upper_spd_10_plot : syminfo.root == sym_169_spd_50 ? upper_spd_50_plot : 
	 syminfo.root == sym_035_spd_2_5 ? upper_spd_2_5_plot : syminfo.root == sym_103_spd_10 ? upper_spd_10_plot : syminfo.root == sym_170_spd_50 ? upper_spd_50_plot : 
	 syminfo.root == sym_036_spd_5 ? upper_spd_5_plot : syminfo.root == sym_104_spd_10 ? upper_spd_10_plot : syminfo.root == sym_171_spd_50 ? upper_spd_50_plot : 
	 syminfo.root == sym_037_spd_5 ? upper_spd_5_plot : syminfo.root == sym_105_spd_10 ? upper_spd_10_plot : syminfo.root == sym_172_spd_50 ? upper_spd_50_plot : 
	 syminfo.root == sym_038_spd_5 ? upper_spd_5_plot : syminfo.root == sym_106_spd_10 ? upper_spd_10_plot : syminfo.root == sym_173_spd_50 ? upper_spd_50_plot : 
	 syminfo.root == sym_039_spd_5 ? upper_spd_5_plot : syminfo.root == sym_107_spd_10 ? upper_spd_10_plot : syminfo.root == sym_174_spd_50 ? upper_spd_50_plot : 
	 syminfo.root == sym_040_spd_5 ? upper_spd_5_plot : syminfo.root == sym_108_spd_10 ? upper_spd_10_plot : syminfo.root == sym_175_spd_50 ? upper_spd_50_plot : 
	 syminfo.root == sym_041_spd_5 ? upper_spd_5_plot : syminfo.root == sym_109_spd_10 ? upper_spd_10_plot : syminfo.root == sym_176_spd_50 ? upper_spd_50_plot : 
	 syminfo.root == sym_042_spd_5 ? upper_spd_5_plot : syminfo.root == sym_110_spd_10 ? upper_spd_10_plot : syminfo.root == sym_177_spd_100 ? upper_spd_100_plot : 
	 syminfo.root == sym_043_spd_5 ? upper_spd_5_plot : syminfo.root == sym_111_spd_10 ? upper_spd_10_plot : syminfo.root == sym_178_spd_100 ? upper_spd_100_plot : 
	 syminfo.root == sym_044_spd_5 ? upper_spd_5_plot : syminfo.root == sym_112_spd_20 ? upper_spd_20_plot : syminfo.root == sym_179_spd_100 ? upper_spd_100_plot : 
	 syminfo.root == sym_045_spd_5 ? upper_spd_5_plot : syminfo.root == sym_113_spd_20 ? upper_spd_20_plot : syminfo.root == sym_180_spd_100 ? upper_spd_100_plot : 
	 syminfo.root == sym_046_spd_5 ? upper_spd_5_plot : syminfo.root == sym_114_spd_20 ? upper_spd_20_plot : syminfo.root == sym_181_spd_100 ? upper_spd_100_plot : 
	 syminfo.root == sym_047_spd_5 ? upper_spd_5_plot : syminfo.root == sym_115_spd_20 ? upper_spd_20_plot : syminfo.root == sym_182_spd_100 ? upper_spd_100_plot : 
	 syminfo.root == sym_048_spd_5 ? upper_spd_5_plot : syminfo.root == sym_116_spd_20 ? upper_spd_20_plot : syminfo.root == sym_183_spd_100 ? upper_spd_100_plot : 
	 syminfo.root == sym_049_spd_5 ? upper_spd_5_plot : syminfo.root == sym_117_spd_20 ? upper_spd_20_plot : syminfo.root == sym_184_spd_100 ? upper_spd_100_plot : 
	 syminfo.root == sym_050_spd_5 ? upper_spd_5_plot : syminfo.root == sym_118_spd_20 ? upper_spd_20_plot : syminfo.root == sym_185_spd_100 ? upper_spd_100_plot : 
	 syminfo.root == sym_051_spd_5 ? upper_spd_5_plot : syminfo.root == sym_119_spd_20 ? upper_spd_20_plot : syminfo.root == sym_186_spd_100 ? upper_spd_100_plot : 
	 syminfo.root == sym_052_spd_5 ? upper_spd_5_plot : syminfo.root == sym_120_spd_20 ? upper_spd_20_plot : syminfo.root == sym_187_spd_100 ? upper_spd_100_plot : 
	 syminfo.root == sym_053_spd_5 ? upper_spd_5_plot : syminfo.root == sym_121_spd_20 ? upper_spd_20_plot : syminfo.root == sym_188_spd_100 ? upper_spd_100_plot : 
	 syminfo.root == sym_054_spd_5 ? upper_spd_5_plot : syminfo.root == sym_122_spd_20 ? upper_spd_20_plot : syminfo.root == sym_189_spd_100 ? upper_spd_100_plot : 
	 syminfo.root == sym_055_spd_5 ? upper_spd_5_plot : syminfo.root == sym_123_spd_100 ? upper_spd_100_plot : syminfo.root == sym_190_spd_100 ? upper_spd_100_plot : 
	 syminfo.root == sym_056_spd_5 ? upper_spd_5_plot : syminfo.root == sym_124_spd_20 ? upper_spd_20_plot : syminfo.root == sym_191_spd_100 ? upper_spd_100_plot : 
	 syminfo.root == sym_057_spd_5 ? upper_spd_5_plot : syminfo.root == sym_125_spd_20 ? upper_spd_20_plot : syminfo.root == sym_192_spd_100 ? upper_spd_100_plot : 
	 syminfo.root == sym_058_spd_5 ? upper_spd_5_plot : syminfo.root == sym_126_spd_20 ? upper_spd_20_plot : syminfo.root == sym_193_spd_100 ? upper_spd_100_plot : 
	 syminfo.root == sym_059_spd_5 ? upper_spd_5_plot : syminfo.root == sym_127_spd_20 ? upper_spd_20_plot : syminfo.root == sym_194_spd_200 ? upper_spd_200_plot : 
	 syminfo.root == sym_060_spd_5 ? upper_spd_5_plot : syminfo.root == sym_128_spd_20 ? upper_spd_20_plot : syminfo.root == sym_195_spd_250 ? upper_spd_250_plot : 
	 syminfo.root == sym_061_spd_5 ? upper_spd_5_plot : syminfo.root == sym_129_spd_20 ? upper_spd_20_plot : syminfo.root == sym_196_spd_50 ? upper_spd_50_plot : 
	 syminfo.root == sym_062_spd_5 ? upper_spd_5_plot : syminfo.root == sym_130_spd_20 ? upper_spd_20_plot : syminfo.root == sym_197_spd_250 ? upper_spd_250_plot : 
	 syminfo.root == sym_063_spd_5 ? upper_spd_5_plot : syminfo.root == sym_131_spd_20 ? upper_spd_20_plot : syminfo.root == sym_198_spd_250 ? upper_spd_250_plot : 
	 syminfo.root == sym_064_spd_5 ? upper_spd_5_plot : syminfo.root == sym_132_spd_20 ? upper_spd_20_plot : syminfo.root == sym_199_spd_250 ? upper_spd_250_plot : 
	 syminfo.root == sym_065_spd_5 ? upper_spd_5_plot : syminfo.root == sym_133_spd_20 ? upper_spd_20_plot : syminfo.root == sym_200_spd_500 ? upper_spd_500_plot : 
	 syminfo.root == sym_066_spd_5 ? upper_spd_5_plot : syminfo.root == sym_134_spd_20 ? upper_spd_20_plot : syminfo.root == sym_201_spd_500 ? upper_spd_500_plot : 
	 syminfo.root == sym_067_spd_5 ? upper_spd_5_plot : syminfo.root == sym_135_spd_20 ? upper_spd_20_plot : syminfo.root == sym_202_spd_500 ? upper_spd_500_plot : 
	 syminfo.root == sym_068_spd_8_5 ? upper_spd_8_5_plot : na

lower_strike_plot = syminfo.root == sym_001_spd_1 ? lower_spd_1_plot : syminfo.root == sym_069_spd_10 ? lower_spd_10_plot : syminfo.root == sym_136_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_002_spd_1 ? lower_spd_1_plot : syminfo.root == sym_070_spd_10 ? lower_spd_10_plot : syminfo.root == sym_137_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_003_spd_1 ? lower_spd_1_plot : syminfo.root == sym_071_spd_10 ? lower_spd_10_plot : syminfo.root == sym_138_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_004_spd_1 ? lower_spd_1_plot : syminfo.root == sym_072_spd_10 ? lower_spd_10_plot : syminfo.root == sym_139_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_005_spd_1 ? lower_spd_1_plot : syminfo.root == sym_073_spd_10 ? lower_spd_10_plot : syminfo.root == sym_140_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_006_spd_1 ? lower_spd_1_plot : syminfo.root == sym_074_spd_10 ? lower_spd_10_plot : syminfo.root == sym_141_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_007_spd_1 ? lower_spd_1_plot : syminfo.root == sym_075_spd_10 ? lower_spd_10_plot : syminfo.root == sym_142_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_008_spd_1 ? lower_spd_1_plot : syminfo.root == sym_076_spd_10 ? lower_spd_10_plot : syminfo.root == sym_143_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_009_spd_1 ? lower_spd_1_plot : syminfo.root == sym_077_spd_10 ? lower_spd_10_plot : syminfo.root == sym_144_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_010_spd_1 ? lower_spd_1_plot : syminfo.root == sym_078_spd_10 ? lower_spd_10_plot : syminfo.root == sym_145_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_011_spd_1 ? lower_spd_1_plot : syminfo.root == sym_079_spd_10 ? lower_spd_10_plot : syminfo.root == sym_146_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_012_spd_1 ? lower_spd_1_plot : syminfo.root == sym_080_spd_10 ? lower_spd_10_plot : syminfo.root == sym_147_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_013_spd_1 ? lower_spd_1_plot : syminfo.root == sym_081_spd_10 ? lower_spd_10_plot : syminfo.root == sym_148_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_014_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_082_spd_10 ? lower_spd_10_plot : syminfo.root == sym_149_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_015_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_083_spd_10 ? lower_spd_10_plot : syminfo.root == sym_150_spd_50 ? lower_spd_50_plot : 
	 syminfo.root == sym_016_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_084_spd_10 ? lower_spd_10_plot : syminfo.root == sym_151_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_017_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_085_spd_10 ? lower_spd_10_plot : syminfo.root == sym_152_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_018_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_086_spd_10 ? lower_spd_10_plot : syminfo.root == sym_153_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_019_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_087_spd_10 ? lower_spd_10_plot : syminfo.root == sym_154_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_020_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_088_spd_10 ? lower_spd_10_plot : syminfo.root == sym_155_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_021_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_089_spd_10 ? lower_spd_10_plot : syminfo.root == sym_156_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_022_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_090_spd_10 ? lower_spd_10_plot : syminfo.root == sym_157_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_023_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_091_spd_10 ? lower_spd_10_plot : syminfo.root == sym_158_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_024_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_092_spd_10 ? lower_spd_10_plot : syminfo.root == sym_159_spd_20 ? lower_spd_20_plot : 
	 syminfo.root == sym_025_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_093_spd_10 ? lower_spd_10_plot : syminfo.root == sym_160_spd_50 ? lower_spd_50_plot : 
	 syminfo.root == sym_026_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_094_spd_10 ? lower_spd_10_plot : syminfo.root == sym_161_spd_50 ? lower_spd_50_plot : 
	 syminfo.root == sym_027_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_095_spd_10 ? lower_spd_10_plot : syminfo.root == sym_162_spd_50 ? lower_spd_50_plot : 
	 syminfo.root == sym_028_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_096_spd_10 ? lower_spd_10_plot : syminfo.root == sym_163_spd_50 ? lower_spd_50_plot : 
	 syminfo.root == sym_029_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_097_spd_10 ? lower_spd_10_plot : syminfo.root == sym_164_spd_50 ? lower_spd_50_plot : 
	 syminfo.root == sym_030_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_098_spd_100 ? lower_spd_100_plot : syminfo.root == sym_165_spd_50 ? lower_spd_50_plot : 
	 syminfo.root == sym_031_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_099_spd_10 ? lower_spd_10_plot : syminfo.root == sym_166_spd_50 ? lower_spd_50_plot : 
	 syminfo.root == sym_032_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_100_spd_10 ? lower_spd_10_plot : syminfo.root == sym_167_spd_50 ? lower_spd_50_plot : 
	 syminfo.root == sym_033_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_101_spd_10 ? lower_spd_10_plot : syminfo.root == sym_168_spd_50 ? lower_spd_50_plot : 
	 syminfo.root == sym_034_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_102_spd_10 ? lower_spd_10_plot : syminfo.root == sym_169_spd_50 ? lower_spd_50_plot : 
	 syminfo.root == sym_035_spd_2_5 ? lower_spd_2_5_plot : syminfo.root == sym_103_spd_10 ? lower_spd_10_plot : syminfo.root == sym_170_spd_50 ? lower_spd_50_plot : 
	 syminfo.root == sym_036_spd_5 ? lower_spd_5_plot : syminfo.root == sym_104_spd_10 ? lower_spd_10_plot : syminfo.root == sym_171_spd_50 ? lower_spd_50_plot : 
	 syminfo.root == sym_037_spd_5 ? lower_spd_5_plot : syminfo.root == sym_105_spd_10 ? lower_spd_10_plot : syminfo.root == sym_172_spd_50 ? lower_spd_50_plot : 
	 syminfo.root == sym_038_spd_5 ? lower_spd_5_plot : syminfo.root == sym_106_spd_10 ? lower_spd_10_plot : syminfo.root == sym_173_spd_50 ? lower_spd_50_plot : 
	 syminfo.root == sym_039_spd_5 ? lower_spd_5_plot : syminfo.root == sym_107_spd_10 ? lower_spd_10_plot : syminfo.root == sym_174_spd_50 ? lower_spd_50_plot : 
	 syminfo.root == sym_040_spd_5 ? lower_spd_5_plot : syminfo.root == sym_108_spd_10 ? lower_spd_10_plot : syminfo.root == sym_175_spd_50 ? lower_spd_50_plot : 
	 syminfo.root == sym_041_spd_5 ? lower_spd_5_plot : syminfo.root == sym_109_spd_10 ? lower_spd_10_plot : syminfo.root == sym_176_spd_50 ? lower_spd_50_plot : 
	 syminfo.root == sym_042_spd_5 ? lower_spd_5_plot : syminfo.root == sym_110_spd_10 ? lower_spd_10_plot : syminfo.root == sym_177_spd_100 ? lower_spd_100_plot : 
	 syminfo.root == sym_043_spd_5 ? lower_spd_5_plot : syminfo.root == sym_111_spd_10 ? lower_spd_10_plot : syminfo.root == sym_178_spd_100 ? lower_spd_100_plot : 
	 syminfo.root == sym_044_spd_5 ? lower_spd_5_plot : syminfo.root == sym_112_spd_20 ? lower_spd_20_plot : syminfo.root == sym_179_spd_100 ? lower_spd_100_plot : 
	 syminfo.root == sym_045_spd_5 ? lower_spd_5_plot : syminfo.root == sym_113_spd_20 ? lower_spd_20_plot : syminfo.root == sym_180_spd_100 ? lower_spd_100_plot : 
	 syminfo.root == sym_046_spd_5 ? lower_spd_5_plot : syminfo.root == sym_114_spd_20 ? lower_spd_20_plot : syminfo.root == sym_181_spd_100 ? lower_spd_100_plot : 
	 syminfo.root == sym_047_spd_5 ? lower_spd_5_plot : syminfo.root == sym_115_spd_20 ? lower_spd_20_plot : syminfo.root == sym_182_spd_100 ? lower_spd_100_plot : 
	 syminfo.root == sym_048_spd_5 ? lower_spd_5_plot : syminfo.root == sym_116_spd_20 ? lower_spd_20_plot : syminfo.root == sym_183_spd_100 ? lower_spd_100_plot : 
	 syminfo.root == sym_049_spd_5 ? lower_spd_5_plot : syminfo.root == sym_117_spd_20 ? lower_spd_20_plot : syminfo.root == sym_184_spd_100 ? lower_spd_100_plot : 
	 syminfo.root == sym_050_spd_5 ? lower_spd_5_plot : syminfo.root == sym_118_spd_20 ? lower_spd_20_plot : syminfo.root == sym_185_spd_100 ? lower_spd_100_plot : 
	 syminfo.root == sym_051_spd_5 ? lower_spd_5_plot : syminfo.root == sym_119_spd_20 ? lower_spd_20_plot : syminfo.root == sym_186_spd_100 ? lower_spd_100_plot : 
	 syminfo.root == sym_052_spd_5 ? lower_spd_5_plot : syminfo.root == sym_120_spd_20 ? lower_spd_20_plot : syminfo.root == sym_187_spd_100 ? lower_spd_100_plot : 
	 syminfo.root == sym_053_spd_5 ? lower_spd_5_plot : syminfo.root == sym_121_spd_20 ? lower_spd_20_plot : syminfo.root == sym_188_spd_100 ? lower_spd_100_plot : 
	 syminfo.root == sym_054_spd_5 ? lower_spd_5_plot : syminfo.root == sym_122_spd_20 ? lower_spd_20_plot : syminfo.root == sym_189_spd_100 ? lower_spd_100_plot : 
	 syminfo.root == sym_055_spd_5 ? lower_spd_5_plot : syminfo.root == sym_123_spd_100 ? lower_spd_100_plot : syminfo.root == sym_190_spd_100 ? lower_spd_100_plot : 
	 syminfo.root == sym_056_spd_5 ? lower_spd_5_plot : syminfo.root == sym_124_spd_20 ? lower_spd_20_plot : syminfo.root == sym_191_spd_100 ? lower_spd_100_plot : 
	 syminfo.root == sym_057_spd_5 ? lower_spd_5_plot : syminfo.root == sym_125_spd_20 ? lower_spd_20_plot : syminfo.root == sym_192_spd_100 ? lower_spd_100_plot : 
	 syminfo.root == sym_058_spd_5 ? lower_spd_5_plot : syminfo.root == sym_126_spd_20 ? lower_spd_20_plot : syminfo.root == sym_193_spd_100 ? lower_spd_100_plot : 
	 syminfo.root == sym_059_spd_5 ? lower_spd_5_plot : syminfo.root == sym_127_spd_20 ? lower_spd_20_plot : syminfo.root == sym_194_spd_200 ? lower_spd_200_plot : 
	 syminfo.root == sym_060_spd_5 ? lower_spd_5_plot : syminfo.root == sym_128_spd_20 ? lower_spd_20_plot : syminfo.root == sym_195_spd_250 ? lower_spd_250_plot : 
	 syminfo.root == sym_061_spd_5 ? lower_spd_5_plot : syminfo.root == sym_129_spd_20 ? lower_spd_20_plot : syminfo.root == sym_196_spd_50 ? lower_spd_50_plot : 
	 syminfo.root == sym_062_spd_5 ? lower_spd_5_plot : syminfo.root == sym_130_spd_20 ? lower_spd_20_plot : syminfo.root == sym_197_spd_250 ? lower_spd_250_plot : 
	 syminfo.root == sym_063_spd_5 ? lower_spd_5_plot : syminfo.root == sym_131_spd_20 ? lower_spd_20_plot : syminfo.root == sym_198_spd_250 ? lower_spd_250_plot : 
	 syminfo.root == sym_064_spd_5 ? lower_spd_5_plot : syminfo.root == sym_132_spd_20 ? lower_spd_20_plot : syminfo.root == sym_199_spd_250 ? lower_spd_250_plot : 
	 syminfo.root == sym_065_spd_5 ? lower_spd_5_plot : syminfo.root == sym_133_spd_20 ? lower_spd_20_plot : syminfo.root == sym_200_spd_500 ? lower_spd_500_plot : 
	 syminfo.root == sym_066_spd_5 ? lower_spd_5_plot : syminfo.root == sym_134_spd_20 ? lower_spd_20_plot : syminfo.root == sym_201_spd_500 ? lower_spd_500_plot : 
	 syminfo.root == sym_067_spd_5 ? lower_spd_5_plot : syminfo.root == sym_135_spd_20 ? lower_spd_20_plot : syminfo.root == sym_202_spd_500 ? lower_spd_500_plot : 
	 syminfo.root == sym_068_spd_8_5 ? lower_spd_8_5_plot : na	 

////////////////////////////////////////////////////////// Strike Price Difference

spd_plot = upper_strike_plot - lower_strike_plot

////////////////////////////////////////////////////////// Higher Strikes

upper_strike_2_plot = upper_strike_plot + spd_plot
upper_strike_3_plot = upper_strike_plot + (2 * spd_plot)

lower_strike_2_plot = lower_strike_plot - spd_plot
lower_strike_3_plot = lower_strike_plot - (2 * spd_plot)

////////////////////////////////////////////////////////// First One Hour Highlight

//bgcolor(no_trade_time ? color.new(color.silver, 95) : na)

////////////////////////////////////////////////////////// Plot Important Pivots

rz_1_2_line = plot(pivot_time and show_rz_1 ? upper_strike_plot : na, "R1", style=plot.style_linebr, color=color.new(#EF5350, 0), linewidth=4)
rz_2_2_line = plot(pivot_time and show_rz_2 ? upper_strike_2_plot : na, "R2", style=plot.style_linebr, color=color.new(#EF5350, 0), linewidth=4)

sz_1_2_line = plot(pivot_time and show_sz_1 ? lower_strike_plot : na, "S1", style=plot.style_linebr, color=color.new(#26A69A, 0), linewidth=4)
sz_2_2_line = plot(pivot_time and show_sz_2 ? lower_strike_2_plot : na, "S2", style=plot.style_linebr, color=color.new(#26A69A, 0), linewidth=4)




////////////////////////////////////////////////////////// Time Markers

gpT = "Time (IST) (Vertical)"

show_time_01 = input.bool(true, title="", group=gpT, inline="_01")
i_hour_01 = input.int(10, minval=0, title="", group=gpT, inline="_01")
i_minute_01 = input.int(15, minval=0, title=":", group=gpT, inline="_01")
i_t_col_01 = input.color(color.silver, title="", group=gpT, inline="_01")

show_time_02 = input.bool(true, title="", group=gpT, inline="_02")
i_hour_02 = input.int(11, minval=0, title="", group=gpT, inline="_02")
i_minute_02 = input.int(15, minval=0, title=":", group=gpT, inline="_02")
i_t_col_02 = input.color(color.silver, title="", group=gpT, inline="_02")

show_time_03 = input.bool(false, title="", group=gpT, inline="_03")
i_hour_03 = input.int(12, minval=0, title="", group=gpT, inline="_03")
i_minute_03 = input.int(15, minval=0, title=":", group=gpT, inline="_03")
i_t_col_03 = input.color(color.silver, title="", group=gpT, inline="_03")

show_time_04 = input.bool(false, title="", group=gpT, inline="_04")
i_hour_04 = input.int(13, minval=0, title="", group=gpT, inline="_04")
i_minute_04 = input.int(15, minval=0, title=":", group=gpT, inline="_04")
i_t_col_04 = input.color(color.silver, title="", group=gpT, inline="_04")

show_time_05 = input.bool(true, title="", group=gpT, inline="_05")
i_hour_05 = input.int(14, minval=0, title="", group=gpT, inline="_05")
i_minute_05 = input.int(15, minval=0, title=":", group=gpT, inline="_05")
i_t_col_05 = input.color(color.silver, title="", group=gpT, inline="_05")

show_time_06 = input.bool(false, title="", group=gpT, inline="_06")
i_hour_06 = input.int(15, minval=0, title="", group=gpT, inline="_06")
i_minute_06 = input.int(15, minval=0, title=":", group=gpT, inline="_06")
i_t_col_06 = input.color(color.silver, title="", group=gpT, inline="_06")

i_t_style = input.string(line.style_dotted, title = "", options = [line.style_solid, line.style_dashed, line.style_dotted], group=gpT, inline="_07")
i_t_width = input.int(1, title = "", minval=1, group=gpT, inline="_07")

show_time_label = input.bool(true, title="Time Label", group=gpT, inline="_08")

if show_time_01
    time_01 = timestamp("GMT+0530", year, month, dayofmonth, i_hour_01, i_minute_01, 00)
    time_01_line = line.new(x1=time_01, y1=open, x2=time_01, y2=close, xloc=xloc.bar_time, extend=extend.both, color=i_t_col_01, style=i_t_style, width=i_t_width)
    line.delete(time_01_line[1])
    if show_time_label
        var label time_01_label = na
        time_01_label := label.new(x=time_01, y=high, text=str.tostring(i_hour_01) + ":" + str.tostring(i_minute_01), textcolor=i_t_col_01, textalign=text.align_center, color=color.new(color.white, 100), style=label.style_label_down, size=size.normal, xloc=xloc.bar_time, yloc=yloc.abovebar)
        label.delete(time_01_label[1])
    
//    nd_time_01 = timestamp("GMT+0530", year, month , dayofmonth + 1, i_hour_01, i_minute_01, 00)
//    nd_time_01_line = line.new(x1=nd_time_01, y1=open, x2=nd_time_01, y2=close, xloc=xloc.bar_time, extend=extend.both, color=color.new(color.silver, 0), style=i_t_style, width=i_t_width)
//    line.delete(nd_time_01_line[1])

    pd_time_02 = timestamp("GMT+0530", year, month , dayofmonth - 1, i_hour_05, i_minute_05, 00)
    pd_time_02_line = line.new(x1=pd_time_02, y1=open, x2=pd_time_02, y2=close, xloc=xloc.bar_time, extend=extend.both, color=i_t_col_05, style=i_t_style, width=i_t_width)
    line.delete(pd_time_02_line[1])
    if show_time_label
        var label pd_time_02_label = na
        pd_time_02_label := label.new(x=pd_time_02, y=high, text=str.tostring(i_hour_05) + ":" + str.tostring(i_minute_05), textcolor=i_t_col_05, textalign=text.align_center, color=color.new(color.white, 100), style=label.style_label_down, size=size.normal, xloc=xloc.bar_time, yloc=yloc.abovebar)
        label.delete(pd_time_02_label[1])

if show_time_02
    time_02 = timestamp("GMT+0530", year, month , dayofmonth, i_hour_02, i_minute_02, 00)
    time_02_line = line.new(x1=time_02, y1=open, x2=time_02, y2=close, xloc=xloc.bar_time, extend=extend.both, color=i_t_col_02, style=i_t_style, width=i_t_width)
    line.delete(time_02_line[1])
    if show_time_label
        var label time_02_label = na
        time_02_label := label.new(x=time_02, y=high, text=str.tostring(i_hour_02) + ":" + str.tostring(i_minute_02), textcolor=i_t_col_02, textalign=text.align_center, color=color.new(color.white, 100), style=label.style_label_down, size=size.normal, xloc=xloc.bar_time, yloc=yloc.abovebar)
        label.delete(time_02_label[1])

if show_time_03
    time_03 = timestamp("GMT+0530", year, month , dayofmonth, i_hour_03, i_minute_03, 00)
    time_03_line = line.new(x1=time_03, y1=open, x2=time_03, y2=close, xloc=xloc.bar_time, extend=extend.both, color=i_t_col_03, style=i_t_style, width=i_t_width)
    line.delete(time_03_line[1])
    if show_time_label
        var label time_03_label = na
        time_03_label := label.new(x=time_03, y=high, text=str.tostring(i_hour_03) + ":" + str.tostring(i_minute_03), textcolor=i_t_col_03, textalign=text.align_center, color=color.new(color.white, 100), style=label.style_label_down, size=size.normal, xloc=xloc.bar_time, yloc=yloc.abovebar)
        label.delete(time_03_label[1])

if show_time_04
    time_04 = timestamp("GMT+0530", year, month , dayofmonth, i_hour_04, i_minute_04, 00)
    time_04_line = line.new(x1=time_04, y1=open, x2=time_04, y2=close, xloc=xloc.bar_time, extend=extend.both, color=i_t_col_04, style=i_t_style, width=i_t_width)
    line.delete(time_04_line[1])
    if show_time_label
        var label time_04_label = na
        time_04_label := label.new(x=time_04, y=high, text=str.tostring(i_hour_04) + ":" + str.tostring(i_minute_04), textcolor=i_t_col_04, textalign=text.align_center, color=color.new(color.white, 100), style=label.style_label_down, size=size.normal, xloc=xloc.bar_time, yloc=yloc.abovebar)
        label.delete(time_04_label[1])

if show_time_05
    time_05 = timestamp("GMT+0530", year, month , dayofmonth, i_hour_05, i_minute_05, 00)
    time_05_line = line.new(x1=time_05, y1=open, x2=time_05, y2=close, xloc=xloc.bar_time, extend=extend.both, color=i_t_col_05, style=i_t_style, width=i_t_width)
    line.delete(time_05_line[1])
    if show_time_label
        var label time_05_label = na
        time_05_label := label.new(x=time_05, y=high, text=str.tostring(i_hour_05) + ":" + str.tostring(i_minute_05), textcolor=i_t_col_05, textalign=text.align_center, color=color.new(color.white, 100), style=label.style_label_down, size=size.normal, xloc=xloc.bar_time, yloc=yloc.abovebar)
        label.delete(time_05_label[1])

if show_time_06
    time_06 = timestamp("GMT+0530", year, month , dayofmonth, i_hour_06, i_minute_06, 00)
    time_06_line = line.new(x1=time_06, y1=open, x2=time_06, y2=close, xloc=xloc.bar_time, extend=extend.both, color=i_t_col_06, style=i_t_style, width=i_t_width)
    line.delete(time_06_line[1])
    if show_time_label
        var label time_06_label = na
        time_06_label := label.new(x=time_06, y=high, text=str.tostring(i_hour_06) + ":" + str.tostring(i_minute_06), textcolor=i_t_col_06, textalign=text.align_center, color=color.new(color.white, 100), style=label.style_label_down, size=size.normal, xloc=xloc.bar_time, yloc=yloc.abovebar)
        label.delete(time_06_label[1])
        
        //linefill.new(pd_time_02_line, time_01_line, color.new(color.black, 95))




////////////////////////////////////////////////////////// Weekly Expiry Countdown Table


gpTb = "Table"

show_table = input.bool(true, title="Weekly Expiry Countdown", group=gpTb, inline="01")

count_down = dayofweek == dayofweek.friday ? "4" :
             dayofweek == dayofweek.monday ? "3" :
             dayofweek == dayofweek.tuesday ? "2" :
             dayofweek == dayofweek.wednesday ? "1" :
             dayofweek == dayofweek.thursday ? "0" : na

count_day = dayofweek == dayofweek.friday ? "Friday" :
             dayofweek == dayofweek.monday ? "Monday" :
             dayofweek == dayofweek.tuesday ? "Tuesday" :
             dayofweek == dayofweek.wednesday ? "Wednesday" :
             dayofweek == dayofweek.thursday ? "Thursday\nExpiry Day" : na

var table table_cell = table.new(position.top_right, 2, 1, border_width=1)

if barstate.islast and show_table
    table.cell(table_cell, 0, 0, count_down, text_color=color.white, text_size=size.large, bgcolor=#2962FF, height=6)
    table.cell(table_cell, 1, 0, count_day, text_color=#2962FF, text_size=size.small, bgcolor=color.white)


////////////////////////////////////////////////////////// END