Builtins: the Big Trades markers
The markers the chart's own Big Trades indicator drew on this bar, with that indicator's current settings: each one's price, size, side and time. Use them to filter, count, colour or alert on what Big Trades already shows instead of re-detecting large prints from the tape.
| Signature | Returns |
|---|---|
| bigtrades.available() -> bool | Whether a visible Big Trades indicator is on this chart |
| bigtrades.count() -> int | How many markers it drew on this bar |
| bigtrades.price(index: int) -> float | The price the marker is drawn at |
| bigtrades.size(index: int) -> float | Its size in contracts |
| bigtrades.side(index: int) -> side | BUY or SELL |
| bigtrades.time(index: int) -> float | Its time, epoch milliseconds |
- The markers cover all loaded bars, not only the bars on screen, so a script gives the same answer at every zoom, on every screen size and on every device.
- Marker indexes run from 0 to bigtrades.count() minus 1, oldest first. An index of -1, or one past the last marker, answers nan or UNDEFINED.
- Absent is not empty: without a visible Big Trades indicator every bar answers available() false; with one, a bar it marked nothing on answers count() 0.
let marked: bool = bigtrades.available() && bigtrades.count() > 0
let first_size: float = bigtrades.size(0)
let first_side: side = bigtrades.side(0)
plot.dot(marked && first_size >= 200 && first_side == "BUY", bigtrades.price(0), "#22C55E", 10)
plot.dot(marked && first_size >= 200 && first_side == "SELL", bigtrades.price(0), "#EF4444", 10)