Integrations / TrendSpider
FirmTape levels in TrendSpider
A custom JS indicator for TrendSpider that draws the flip, the walls and, optionally, the top gamma strikes, refreshed every 10 to 20 seconds. These are measurements of dealer positioning, not trade signals: the plugin places no orders and raises no alerts.
The download is the script's own text: open it, select all and paste it into the Custom Scripts editor.
What you need
- A TrendSpider plan that includes custom JS indicators.
- A FirmTape account on the LIVE plan, and an integration token.
Get a token
- Hold the LIVE plan. The levels API and every integration are part of it.
- Open /account#integrations, section Integrations, and press Create integration token. Give it a name (for example the platform and the machine).
- Copy the token when it is shown: it starts
ftpl_and is shown once. It reads levels only; it cannot run LAB or spend credits.
Install
- Open the script's text below (the download is the script itself) and copy all of it.
- In TrendSpider open the Custom Scripts editor (Indicators menu, Custom Indicators, then create a new custom script).
- Paste the whole script into the editor, replacing the template.
- Click Save, then Apply to add it to the current chart.
- Open the indicator's settings (click its name in the chart key), paste your token into FirmTape API token, and leave FirmTape symbol on auto.
Token safety. The token input is hidden from the chart key and its screenshots, and the
script ships with it empty. TrendSpider's documentation does not say whether typed input values
travel with a shared chart or layout, so do not share a chart, layout or indicator copy with your token
filled in; share the script file instead. The token goes as an Authorization: Bearer header,
not in the URL.
Settings
| Setting | Default | What it does |
|---|---|---|
| FirmTape API token | empty | Your ftpl_ token. Hidden from the chart legend. |
| FirmTape symbol | auto | auto maps the chart: ES and MES (any contract or continuous) to ES, NQ and MNQ to NQ, SPX, SPXW and $SPX to SPX, a stock or ETF to itself. Type a symbol to override (SPX levels on an SPY chart would be wrong, so leave SPY on SPY). |
| Show open-interest levels | off | Adds the open-interest book's flip and walls. |
| Gamma strikes to draw | 0 | 1 to 5 extra lines at the strikes with the most gamma. Costs a second call per refresh. |
| Gamma strikes book | vol | vol or oi. |
| Show line labels | on | Price labels on the last bar. |
| Show status note | on | The corner note. Errors show even when it is off. |
| Refresh, seconds | 10 | TrendSpider's cache time for the calls; minimum 6. |
| Bars to span | 0 | 0 draws the lines across the whole chart; N draws them over the last N bars only. |
What is drawn
- The volume book's flip (amber), call resistance (green) and put support (red).
- Optionally the open-interest flip and walls (same colours, faded) and up to five gamma strikes (green positive, red negative).
- A note in the top-right corner: the symbol read, whether its session is open, the book's time and age, net gamma, the ES or NQ contract and basis, and any error.
- The lines are the current levels drawn flat; they do not show where the flip was an hour ago.
- Every level is FirmTape's volume book, the one the terminal draws; the open-interest book is the optional set.
- ES and NQ are the SPX and NDX books moved by the day's basis (the running median of the day's basis measurements from put-call parity, rounded to 0.25), exactly as the terminal draws them. MES and MNQ read the same levels as ES and NQ.
- Cadence: SPX and ES are rebuilt every second; NQ and the tickers carry a book rebuilt every five minutes and a price of the second.
- Gamma units are named by the API: millions of USD per index point for SPX and ES, USD per 1% move for NQ and the tickers. Compare bar lengths within one chart, not across charts.
Requests and limits
The levels API allows 120 requests a minute per token, counted across everything that uses it; an unchanged
reading answers 304 with no body and does not count. TrendSpider re-runs a script on every real-time update and answers each call from its own server cache until the refresh time passes, so with the default of 10 s the lines are 10 to 20 s behind FirmTape at worst; the note's age says exactly how old the book is. One chart costs about 6 calls a minute (12 with gamma strikes), and two charts of the same symbol share one call. The indicator is kept off scanners, alerts and the Strategy Tester, where a scan over thousands of symbols would spend your token's limit at once.
Troubleshooting
| Status says | Meaning and fix |
|---|---|
401 bad_key | The token is mistyped, revoked or unknown. Create a new one on /account#integrations. |
403 live_required | The account holds no active LIVE plan; every call answers that until it does. |
429 rate_limited | Over 120 requests a minute on this token: many charts or a short refresh. Raise Refresh, seconds or use a second token. |
A timeout in the note | Each call has a hard 3 s limit in TrendSpider. The next refresh retries. |
Lines off the candles on ES or NQ | A back-adjusted continuous chart or a different contract month. Use the front contract the note names, or an unadjusted continuous series. |
Nothing on a closed market | A chart with no ticks does not re-run; the levels are the last session's and the note says Closed. |
More
- Tokens and the TradingView and thinkorswim levels string: /account#integrations.
- The levels API reference: /api/v1 (OpenAPI).
- Every platform: /integrations.
Beta software, provided as is, not yet verified inside every version of TrendSpider. TrendSpider is a trademark of its owner; no affiliation with, or endorsement by, it is implied. Not investment advice.