PYNE Agent
Write scripts from natural language (PYNE Agent) in AXIS using the optional pyne-agent-worker Cloudflare® plugin.
This page
What it does
Describe an indicator or strategy in plain language. The PYNE Agent (Cloudflare® Workers AI™) returns a full script you can insert into the AXIS editor, then run with your normal engine (local PYNE Pro API, edge worker, or Pyodide).
You do not need the full HOOX mesh. The agent worker is usable standalone.
Pine Script™ and TradingView® are trademarks of TradingView®, Inc. Cloudflare® is a registered trademark of Cloudflare®, Inc.
Prerequisites
- A deployed pyne-agent-worker origin (or local
wrangler dev). - AXIS open in the browser (dev or production PWA).
Optional: API key if the worker has API_KEY set.
Install the plugin
- Open Manager → Plugins → Install.
- Paste the same-origin module (avoids cross-origin module CORS):
/plugins/axis-pine-agent.js
Or the remote copy (needs CORS on the agent Worker):
https://pyne-agent-worker.cryptolinx.workers.dev/plugin/axis-pine-agent.js
- Set endpoint to the agent Worker origin (no trailing slash), e.g.
https://pyne-agent-worker.cryptolinx.workers.dev. Same-origin install still talks to this API host. Workers Manager → PYNE Agent also has an editable Agent endpoint (URL + API key). - Set API key if required.
- Prefer v6 / strategy or indicator when you know the target style.
- In Workers Manager → PYNE Agent, pick a Persona (
autodetects per message):pinewrites scripts,axisanswers anything about the app and can change it for you (theme, layout, runs),traderdoes market analysis and risk coaching. - Optionally set PYNE backend (
auto/pro/local/worker/container/none) for where parse/lint/eval run. Plugin 0.1.9 always orchestrates (full tool loop).
AXIS migrates a previously saved remote plugin URL to /plugins/axis-pine-agent.js on restore.
AXIS loads component plugins from URL (Manager → Install, or Workers Manager → install agent). You can also open the worker’s built-in chat UI:
https://<your-agent-worker>/
or open the Agent panel from the module-bar AI button (command palette “Toggle Agent”, the Extras menu, or Panels on a phone also work). The chat fills that panel.
Typical workflow
- Ask for a script (example: “v6 RSI strategy with ATR trailing stop and clear plots”).
- Review the fenced Pine block.
- Insert into editor (plugin action) or copy/paste.
- Select your engine and Run as usual.
- Iterate with follow-up messages (“use length input”, “overlay false”, …).
Tips
- Prefer specific version (
v5/v6) and script kind in the request. - The agent may use a private knowledge base (docs + open examples). Quality improves after the operator ingests docs — not required to start chatting.
- Validation against pyne-worker is optional on the agent side; AXIS evaluation is still your engine plugin.
Troubleshooting
| Issue | Fix |
|---|---|
| Load error | Check URL HTTPS, CORS, and that the module is reachable |
| Unauthorized | Match plugin apiKey to worker secret |
| Weak answers | Ingest KB on the worker; still usable without it |
| Cannot insert | Use copy; ensure plugin api.insertScript is provided by host |