# FirmTape Levels for thinkorswim # # Draws FirmTape's dealer-gamma levels as horizontal lines: the zero-gamma flip, call # resistance, put support and, optionally, the open-interest flip and walls. # # These are MEASUREMENTS of dealer positioning, not trade signals. # # thinkScript cannot fetch data or split a pasted string, so the levels are typed into the # study's inputs. Take them from the FirmTape terminal (LIVE plan), Copy levels: the panel lists # the numbers in the order below. Or read them from the levels string of the right symbol: # flip= -> flip level cr= -> call wall ps= -> put wall # oflip= -> OI flip level ocr= -> OI call wall ops= -> OI put wall # the date in FT1;ES;ESZ26;2026-09-30T15:17;... -> levels date 20260930, levels time 1517 # Use the ES block on /ES and /MES, the NQ block on /NQ and /MNQ, the SPX block on $SPX. # A level left at 0 is not drawn. # # Format FT1: docs/levels-string.md in the integrations repository. declare upper; input flipLevel = 0.0; input callWall = 0.0; input putWall = 0.0; input showOI = no; input oiFlipLevel = 0.0; input oiCallWall = 0.0; input oiPutWall = 0.0; input levelsDate = 0; # yyyymmdd, ET, e.g. 20260930 input levelsTime = 0; # hhmm, ET, e.g. 1517 input showBubbles = yes; def lastBar = !IsNaN(close) and IsNaN(close[-1]); # ---------------------------------------------------------------- lines plot Flip = if flipLevel > 0 then flipLevel else Double.NaN; Flip.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); Flip.SetDefaultColor(CreateColor(224, 176, 0)); Flip.SetLineWeight(2); plot CallRes = if callWall > 0 then callWall else Double.NaN; CallRes.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); CallRes.SetDefaultColor(CreateColor(38, 166, 154)); CallRes.SetLineWeight(2); plot PutSup = if putWall > 0 then putWall else Double.NaN; PutSup.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); PutSup.SetDefaultColor(CreateColor(239, 83, 80)); PutSup.SetLineWeight(2); plot OIFlip = if showOI and oiFlipLevel > 0 then oiFlipLevel else Double.NaN; OIFlip.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); OIFlip.SetStyle(Curve.SHORT_DASH); OIFlip.SetDefaultColor(CreateColor(150, 120, 30)); plot OICall = if showOI and oiCallWall > 0 then oiCallWall else Double.NaN; OICall.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); OICall.SetStyle(Curve.SHORT_DASH); OICall.SetDefaultColor(CreateColor(30, 110, 100)); plot OIPut = if showOI and oiPutWall > 0 then oiPutWall else Double.NaN; OIPut.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); OIPut.SetStyle(Curve.SHORT_DASH); OIPut.SetDefaultColor(CreateColor(160, 55, 55)); # ---------------------------------------------------------------- names at the last bar AddChartBubble(showBubbles and lastBar and flipLevel > 0, flipLevel, "Flip", CreateColor(224, 176, 0), yes); AddChartBubble(showBubbles and lastBar and callWall > 0, callWall, "Call res", CreateColor(38, 166, 154), yes); AddChartBubble(showBubbles and lastBar and putWall > 0, putWall, "Put sup", CreateColor(239, 83, 80), no); AddChartBubble(showBubbles and showOI and lastBar and oiFlipLevel > 0, oiFlipLevel, "OI flip", CreateColor(150, 120, 30), yes); AddChartBubble(showBubbles and showOI and lastBar and oiCallWall > 0, oiCallWall, "OI call", CreateColor(30, 110, 100), yes); AddChartBubble(showBubbles and showOI and lastBar and oiPutWall > 0, oiPutWall, "OI put", CreateColor(160, 55, 55), no); # ---------------------------------------------------------------- labels def hasLevels = flipLevel > 0 or callWall > 0 or putWall > 0; def today = GetYYYYMMDD(); def isOld = levelsDate > 0 and levelsDate < today; def lastClose = close; def offScale = flipLevel > 0 and AbsValue(lastClose / flipLevel - 1) > 0.05; AddLabel(yes, "FirmTape", Color.GRAY); AddLabel(!hasLevels, "Type the levels from the FirmTape terminal (LIVE), Copy levels, into this study's inputs", Color.ORANGE); AddLabel(hasLevels and flipLevel > 0, "Flip " + AsText(flipLevel), CreateColor(224, 176, 0)); AddLabel(hasLevels and callWall > 0, "Call res " + AsText(callWall), CreateColor(38, 166, 154)); AddLabel(hasLevels and putWall > 0, "Put sup " + AsText(putWall), CreateColor(239, 83, 80)); AddLabel(hasLevels and levelsDate > 0, "As of " + AsPrice(levelsDate) + " " + AsPrice(levelsTime) + " ET", if isOld then Color.RED else Color.GRAY); AddLabel(hasLevels and isOld, "OLDER THAN TODAY: update the levels", Color.RED); AddLabel(hasLevels and levelsDate == 0, "Set the levels date to see their age", Color.GRAY); AddLabel(offScale, "Levels do not fit this chart's price: wrong symbol?", Color.ORANGE);