New guide for saving, versioning, backtesting and sharing Pine scripts.
Detected by PropBench's daily crawl of this page.
The Scripts page is where you keep your own Pine scripts. You can write or import a script, check it for errors, preview it on a chart, backtest strategies, save versions, and switch scripts on so they run on every trade chart. You can also share a script and add copies of scripts other traders shared. How the engine runs a script, what it can draw, and why values can differ from TradingView is covered in Pine Scripts.
On the trade page, select Scripts in the chart toolbar, beside Alerts. The Scripts window opens over the trade page with three tabs:
Tab
What it shows
My Scripts
Your saved scripts and the editor.
Public Library
Scripts other traders listed. See Public Library.
Top Indicators
Listed scripts ranked by how many traders added them. See Top Indicators.
The window also has a share code field and Open Full Page, which opens My Scripts and the editor as a full page at myfundedperpetuals.com/scripts. The Public Library, Top Indicators, and the share code field are only in the window over the trade page.
My Scripts lists your saved scripts with their Type (Indicator or Strategy), Status (Compiles or Has Errors), and whether they show On Trade. Use Columns to show Latest Version, Version On Trade, Last Edited, and Created, and Filters to narrow the list by type, status, or On Trade. The header shows how many On /trade slots are in use. To add a script:
A script’s name is the title in its \indicator()\ or \strategy()\ declaration, so a script needs a title to be saved. Each script’s actions menu has Open, Share, and Duplicate. Select scripts with their checkboxes to delete several at once. Deleting a script deletes all its versions, removes it from your trade charts, and stops its share links and codes. It can’t be undone. Libraries opens your saved Pine libraries. See Libraries.
The editor shows the code beside a preview chart. Choose the preview’s Market and Timeframe above the chart. The preview runs your unsaved draft as you type; while the draft has errors, it shows the last draft that compiled. The panels under the code are:
Panel
What it shows
Problems
Compile errors, warnings, lint hints, runtime errors with the bar they happened on, and the script’s \log.info\, \log.warning\, and \log.error\ lines (the newest 200). Select one to go to its line.
Inputs
The script’s inputs, with the same fields as the chart’s settings.
Inspector
Every variable’s value on a bar you click on the preview chart, plus up to 5 watch expressions.
Trades
A strategy’s simulated trades on the preview, up to 500 rows, with Export CSV.
References
Where a name is declared and used, after Find All References.
The editor also has a Command Palette, formatting (with Format On Save), Quick Fix, and Keyboard Shortcuts, all in the Script Actions menu. You can keep up to 8 scripts and libraries open as tabs. Unsaved changes are kept as a draft in this browser, not on your account. If the script was saved somewhere else since your draft started, the editor offers Keep Draft or loading the newer version. Other actions:
Save Version saves the editor’s code as the script’s next version. A script with compile errors can’t be saved from the editor: fix the errors first. Saving code that hasn’t changed doesn’t add a version. Each script keeps its newest 20 saved versions. Saving past that deletes the oldest. Versions in the Script Actions menu compares a saved version with the editor, and Restore Into Editor loads it as an unsaved draft; save it to make it current. While the draft differs from the saved version, the strategy results above the preview show each figure’s change against the saved version, run on the same bars. Input values you set in the Inputs panel are saved to the script when the preview runs the saved version, and show Preview only until you save while it runs a draft. They belong to one version: if a new version’s inputs don’t match the previous version’s, saved input values go back to the script’s defaults and a message says so.
Turn on Show On /trade in the editor, or the On Trade switch in My Scripts, to run a script on every trade chart, in every market. Up to 4 scripts can be on at once, and only a saved script that compiles can be turned on. The chart runs the script’s current saved version: saving a new version updates your trade charts. On the trade chart, a script that’s on:
Right-click the script’s name in the chart legend for Open In Script Editor, Remove From All Trade Charts, and Report a Problem. Removing the script from the chart also turns it off on all trade charts.
The preview runs a strategy as a simulated backtest on the preview’s market and timeframe. Strategy Results above the preview show Net P&L, Win Rate, Max Drawdown, Profit Factor, and Trades, and Show Strategy Report under the preview opens the full report. Results fill at bar prices, with fees as the script sets them, and no funding or slippage, so real fills differ. Backtest in the Script Actions menu runs the draft beyond the preview, one run at a time in your browser:
Backtests and sweeps are simulations on past data. They never place orders, don’t use your account balance, and don’t affect your challenge, rules, or statistics. A combination tuned on past data can fit noise, so check other markets and periods before relying on it.
Select Share in the editor or in a script’s actions menu, then Create Share Code. Sharing creates a share code, such as \MFP-7K2Q-9XWD\, and a share link for the script’s current saved version. Unsaved changes aren’t included.
How it’s shared
Who can use it
Share link
Anyone with the link can view the source, even without signing in. Signed-in traders can select Copy To My Scripts.
Share code
Signed-in traders paste it into the share code field in the Scripts window and select Add.
Public Library listing
Turn on Also List It in the Public Library in the share dialog. Every trader with Scripts can find it and add a copy.
Each share is a frozen copy of that version. Saving new versions doesn’t change it; share the new version to share those changes. Traders who add it get their own copy in My Scripts, starting from the script’s default inputs and switched off for trade charts, and they can’t change your original. Turn Code Off stops the link and code and removes the listing. Copies traders already added stay theirs. Other Shared Versions lists older versions you still share, each with Stop Sharing. You can keep up to 50 share links at once.
A share shows the script’s name, version, source code, and when it was shared, credited to your public username and generated avatar. Your uploaded profile photo and a link to your public profile appear only while your public profile is on. Your email, account, and trading are never shown. Shared pages are hidden from search engines, but anyone you give the link to can open it.
The Public Library tab lists scripts other traders chose to list. Search by name, filter to Indicators or Strategies, and sort by Most Used or Newest. Each card shows the script’s author and how many traders added it; counts update every hour. Add saves a copy to My Scripts. View Source opens the script’s shared page. Report Listing tells staff what’s wrong with a listing, such as copied work or a misleading name; staff can remove it from the Public Library, and a removed version can’t be listed again. Your own listings show Your Listing.
The Top Indicators tab ranks Public Library scripts by how many different traders added each one in the last 7 Days, 30 Days, or All Time, up to the top 50. Adds through a share link or code count too; adding your own script doesn’t. Each row shows how its place changed against the window before. Rankings update every hour.
Use Report a Problem when something on the Scripts pages or the chart doesn’t work, a script compiles on TradingView but not here, or a script plots or behaves differently from TradingView. It’s in the Script Actions menu in the editor, the More Actions menu on My Scripts, and a saved script’s legend menu on the trade chart. Describe what you expected and what happened instead, in up to 4,000 characters. What’s Attached lists what’s sent with the report: the script’s name and version, the source of your draft or saved version, the problems the editor showed, the chart’s market and timeframe, and your browser, window size, and language. You can send up to 10 reports an hour and 30 a day.
Limit
Value
Saved scripts
100
Saved versions per script
20 (the oldest are deleted)
Scripts on your trade charts at once
4
Open editor tabs
8
Share links you keep at once
50
Markets in one backtest
10
Inputs in one sweep
2
Combinations in one sweep
100
Watch expressions per script
5
Report description
4,000 characters
At 100 saved scripts, delete one to add another. Script length, run time, and drawing limits are in Pine Scripts.
Saved copies: after on the Wayback Machine.