Builders
Pine Script generation and Edgoro Pine Check
Edgoro writes TradingView indicators and strategies in Pine Script version 6 only. Every script it writes is checked by Edgoro Pine Check, Edgoro's own static checker for Pine Script v6, which runs 27 rules in your browser: 18 that report errors and 9 that add notes. Pine Check is not TradingView's compiler, and Edgoro does not compile Pine Script: TradingView compiles the script when you add it in the Pine Editor, and you can paste any error it shows back into the chat for a fix.
On this page
What the indicator builder writes
- Version: Pine Script v6. The builder's instructions put
//@version=6on the first line, and Pine Check reports any lower version as an error. - Script types:
indicator()by default;strategy()when you ask for backtesting or a strategy, withinitial_capital,default_qty_type=strategy.percent_of_equity,commission_typeandcommission_valueset. - Inputs: every value you might tune is an
input.*()with a title and a group. - Higher timeframes:
request.security()withlookahead=barmerge.lookahead_off. - Alerts: one
alertcondition()per signal in indicators (alert()in strategies when useful), with messages that use TradingView's placeholders such as{{ticker}}and{{close}}. - Answer: a one-sentence summary, the complete script in one block, how it works, the install steps and three ideas to refine.
These are instructions given to the AI. Pine Check verifies the rules listed below; the rest you check on your chart. The indicator builder doesn't write MQL5 or Python: converting a Pine strategy to MetaTrader 5 happens in the MT5 bot builder.
How the check runs
When the answer is complete, Pine Check reads the code block in your browser (nothing is sent anywhere for this step). The result appears under the code:
- 0 errors: "Checked by Edgoro Pine Check: 0 errors", plus the number of notes if there are any. Notes come with an "Apply these improvements" button that sends them back to the AI.
- Errors: "Edgoro Pine Check found N problems. Fixing them now…": the errors, with their line numbers, go back to the AI as your next message, up to 2 automatic fix requests per conversation (the same counter covers MQL5 and Python). The corrected script is a new version and is checked again. After the automatic fixes, a "Fix them" button sends the errors on request.
The same checker is free on the site, without an account: the Pine Script checker.
The 18 error rules
An error means the script would not compile in TradingView or breaks a Pine Script v6 rule. Each rule links to the page that explains the message and its fix.
| Rule | Result | What it flags | Help |
|---|---|---|---|
version | Error | No //@version line, or a version below 6. | Explained |
declaration | Error | No indicator(), strategy() or library() declaration, or more than one. | Explained |
old-name | Error | Names removed in v5 and v6: study(), bare calls such as sma() or security() that are now ta.*, math.*, str.* or request.*, input.integer, input.resolution, and v4 variables such as tickerid or period. | Explained |
removed-argument | Error | The removed when= and transp= arguments. | Explained |
brackets | Error | Unbalanced or mismatched parentheses and square brackets. | Explained |
bad-character | Error | Typographic quotes and minus signs (“ ” ‘ ’ −) instead of straight quotes and -. | Explained |
bool-na | Error | A bool set to na, or a ternary that mixes true/false with na. | Explained |
bool-condition | Error | A number such as close, volume, bar_index or time used directly as a condition. | Explained |
na-no-type | Error | A variable declared as na without a type. | Explained |
string-plus-number | Error | A string added to a number without str.tostring(). | Explained |
na-on-bool | Error | na() or nz() called on a bool. | Explained |
wrap-indent | Error | A wrapped line outside parentheses indented by a multiple of 4 spaces. | Explained |
local-scope | Error | plot(), plotshape(), bgcolor(), hline(), alertcondition() or another top-level-only call inside an if, for, switch or function block. | Explained |
already-defined | Error | The same global variable declared twice. | Explained |
global-in-function | Error | A function that assigns to a global variable. | Explained |
empty-block | Error | A block (if, for, while, switch, a function) with no indented body. | Explained |
block-indent | Error | Block lines not indented by 4 spaces or a tab. | Explained |
undeclared | Error | A name of 4 or more characters that is one or two letters away from a name the script declares (a likely typo). | Explained |
The 9 notes
Notes are trading or quality checks a compiler doesn't make. They don't stop the script and don't trigger an automatic fix.
| Rule | Result | What it flags | Help |
|---|---|---|---|
ta-consistency | Note | A ta.* call inside an if or switch block, after and/or, or inside a ternary, where it may not run on every bar. | Explained |
inline-titles | Note | Several titled inputs on the same inline row, which may not align in the Settings tab. | Explained |
repaint | Note | request.security() with lookahead_on and no [1] offset: the backtest reads future values. | Explained |
timeframe | Note | timeframe.period compared with "D", "W" or "M" (v6 returns "1D", "1W", "1M"). | Explained |
costs | Note | A strategy() with no commission_value or no slippage. | Explained |
no-exit | Note | A strategy that enters trades but never calls strategy.exit(), strategy.close(), strategy.close_all() or strategy.order(). | Explained |
exit-both | Note | strategy.exit() given both limit and profit, or both stop and loss. | Explained |
draws-nothing | Note | An indicator that draws nothing: no plot, shape, background, label, line, box or table. | Explained |
alerts | Note | Your message mentions an alert, but the script has no alertcondition() or alert() call. | Explained |
What Pine Check can't check
Pine Check reads the code; it doesn't run it and it isn't TradingView's compiler (TradingView offers no public compile API). In particular, it doesn't:
- check argument types, function signatures or type qualifiers, such as series int used but simple int expected (unknown function calls are left alone);
- catch runtime errors, such as loop is too long, array index out of bounds, too many securities or memory limits exceeded;
- tell whether the logic does what you meant, or whether a strategy makes money.
So "0 errors" from Pine Check means none of its rules fired, not that the script compiles. The Pine Editor is where it gets compiled.
How to add the script to TradingView
- Copy the script from the answer, or download it as a .pine file.
- In TradingView, open the Pine Editor at the bottom of the chart.
- Paste the script, replacing the editor's content, and click Save.
- Click "Add to chart".
- Optional: create an alert on one of the script's alert conditions.
If the Pine Editor shows an error, paste the exact message into the same conversation and Edgoro returns a corrected version. The full guide covers the usual problems, and the Pine Script error library explains each TradingView message.
Related pages
- Pine Script generator
- Free Pine Script checker
- AI Pine Script error fixer
- Pine Script error library
- Pine Script examples
- Pine Script v6 for beginners
- Repainting explained
Trading involves substantial risk of loss and is not suitable for every investor. Edgoro is a software tool, not a broker or financial adviser: nothing it produces is investment advice, and past or backtested performance does not guarantee future results.
Something wrong or missing? Email contact@edgoro.com