What it is
Policy Pine is how you turn Tessera policies (entry filters and stop/target rules built from reports and simulation) into TradingView Pine Script you can use on your charts. You can merge rules into your existing strategy, append to an indicator, or generate a standalone overlay.
What you can do
- Merge into strategy - weave rules into your `strategy()` script
- Append to indicator - add a policy region to your `indicator()` script
- Separate indicator - download a standalone study; your original script stays unchanged
- Preview compose requirements before exporting
- Download composed or indicator-only Pine from a saved strategy
- Export a single policy version as its own indicator
How it works
Compose modes
| Mode | What you get | Best for |
|---|---|---|
| Merge into strategy | One strategy() script with Tessera entry gates and exit hooks | Running entries + managed exits in one backtestable script |
| Append to indicator | Your indicator plus Tessera rules at the bottom | Visual overlays on an existing study |
| Separate indicator | New overlay script only | Trying rules without editing your main script |
Compose uses the policy version (or combined bundle) you select and your saved master Pine when merging.
Master Pine script
Upload or save your TradingView source on the strategy. Tessera parses it to see whether merge into strategy is supported. If your script structure is not compatible, you can still use separate indicator or append (for `indicator()` scripts). You can also contact us to review your script and improve compatibility.
Policy timeframe
Rules are generated for the candle timeframe linked to your report (e.g. 15m). Match this on your TradingView chart for sensible behaviour.
After you edit your script
If you change your master Pine script after composing, you need to re-compose before downloading again - otherwise the export may be out of date with your latest source.
Standalone from one policy
Any saved policy version or combined bundle can be compiled to a standalone indicator without a master script.
Limitations
- Tessera does not replicate tick-by-tick TradingView execution (`calc_on_every_tick`, order-fill timing, pyramiding). Live and TV backtests will differ from Tessera’s candle-based simulator.
- Merged scripts depend on parse compatibility - complex or unusual Pine layouts may only support separate indicator export. In such case, you can contact us to review your script and improve compatibility.
- Exported Pine encodes rules you tested on past data - live results depend on future trades, not just replay. See Understanding when results change.
- Exit hooks in merged strategies cover stop and target distance style rules aligned with what Tessera simulates today.
