//@version=6 indicator("Wheel Companion — CSP Strike Map", overlay = true) // These levels are entered by the user. The script does not select a strike // or calculate assignment probability. referencePrice = input.float(100.0, "Reference price", minval = 0.01, step = 0.01) putStrike = input.float(95.0, "Your cash-secured put strike", minval = 0.01, step = 0.01) distance = referencePrice - putStrike distancePercent = distance / referencePrice * 100.0 distanceSide = putStrike < referencePrice ? "below reference" : putStrike > referencePrice ? "above reference" : "at reference" collateral = putStrike * 100.0 plot(referencePrice, "Reference price", color = color.rgb(91, 153, 235), linewidth = 2) plot(putStrike, "Your put strike", color = color.rgb(235, 174, 77), linewidth = 2) var table summary = table.new(position.top_right, 2, 3, border_width = 1) if barstate.islast table.cell(summary, 0, 0, "STRIKE MAP", text_color = color.white, bgcolor = color.rgb(25, 45, 34)) table.cell(summary, 1, 0, "USER INPUTS", text_color = color.white, bgcolor = color.rgb(25, 45, 34)) table.cell(summary, 0, 1, "Distance", text_color = color.white) table.cell(summary, 1, 1, str.tostring(math.abs(distance), format.mintick) + " (" + str.tostring(math.abs(distancePercent), "#.##") + "%) " + distanceSide, text_color = color.white) table.cell(summary, 0, 2, "Collateral · 1 contract", text_color = color.white) table.cell(summary, 1, 2, str.tostring(collateral, "#.##") + " before premium/fees", text_color = color.white)