Data availability by market
This page answers two different questions that are often confused. What can a script reach? And does this instrument have the data behind it?
The first is a question about the language, and it has a fixed answer. The second is a question about the data, and the language will not answer it for you. It does, however, let your script find out.
What a script can reach
Beyond the bar values, the chart’s interval and the instrument’s properties, the market-data surface is small and it is closed.
There are ten orderflow variables. There is one orderflow function, which accumulates delta. And there is open interest, a single value. Nothing else in the orderflow namespace is reachable from a script.
That is the whole of it. If a name is not in the reference, it is not there to be called.
What this manual does not tell you
Which markets, which exchanges and which plans carry orderflow data or open-interest data is not documented here.
That is not an oversight to be tidied up in prose. Which instruments carry that data is settled by data licensing, and it is not a property of the language. The gap is deliberate: a table here would be a guess, and a guess in a manual is worse than a gap.
How a script finds out
Availability is testable from inside the language, which is the better answer in any case.
Where an instrument has no footprint data behind it, every orderflow variable reads na. The values carry the answer, so a script can respond to what it actually has rather than assume what it ought to have. Write for both cases and the same script runs everywhere.
indicator("Delta where footprint data exists")
plot(orderflow.delta)On an instrument with footprint data, that plots the bar’s delta. On one without, the value is na on every bar.
Simple against series
There is a pattern running through this section, and it is worth naming.
The interval values and the instrument properties are simple. The bar values, the session values, the orderflow values and open interest are series.
That split is the type system’s qualifier ordering doing something useful. What the chart is holds still for the whole run: its interval, its instrument, that instrument’s tick and currency. What the market did moves on with every bar: its prices, its volume, its delta, its open interest. A simple value can stand where a series value is expected, but not the other way round, so the two never blur.
If you can decide which side of that line a value falls on, you can usually predict how it behaves before you look it up.