Edgoro
Pine Script and Pine Check

Builders

Pine Script generation and Edgoro Pine Check

Short answer

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=6 on 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, with initial_capital, default_qty_type=strategy.percent_of_equity, commission_type and commission_value set.
  • Inputs: every value you might tune is an input.*() with a title and a group.
  • Higher timeframes: request.security() with lookahead=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.

RuleResultWhat it flagsHelp
versionErrorNo //@version line, or a version below 6.Explained
declarationErrorNo indicator(), strategy() or library() declaration, or more than one.Explained
old-nameErrorNames 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-argumentErrorThe removed when= and transp= arguments.Explained
bracketsErrorUnbalanced or mismatched parentheses and square brackets.Explained
bad-characterErrorTypographic quotes and minus signs (“ ” ‘ ’ −) instead of straight quotes and -.Explained
bool-naErrorA bool set to na, or a ternary that mixes true/false with na.Explained
bool-conditionErrorA number such as close, volume, bar_index or time used directly as a condition.Explained
na-no-typeErrorA variable declared as na without a type.Explained
string-plus-numberErrorA string added to a number without str.tostring().Explained
na-on-boolErrorna() or nz() called on a bool.Explained
wrap-indentErrorA wrapped line outside parentheses indented by a multiple of 4 spaces.Explained
local-scopeErrorplot(), plotshape(), bgcolor(), hline(), alertcondition() or another top-level-only call inside an if, for, switch or function block.Explained
already-definedErrorThe same global variable declared twice.Explained
global-in-functionErrorA function that assigns to a global variable.Explained
empty-blockErrorA block (if, for, while, switch, a function) with no indented body.Explained
block-indentErrorBlock lines not indented by 4 spaces or a tab.Explained
undeclaredErrorA 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.

RuleResultWhat it flagsHelp
ta-consistencyNoteA 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-titlesNoteSeveral titled inputs on the same inline row, which may not align in the Settings tab.Explained
repaintNoterequest.security() with lookahead_on and no [1] offset: the backtest reads future values.Explained
timeframeNotetimeframe.period compared with "D", "W" or "M" (v6 returns "1D", "1W", "1M").Explained
costsNoteA strategy() with no commission_value or no slippage.Explained
no-exitNoteA strategy that enters trades but never calls strategy.exit(), strategy.close(), strategy.close_all() or strategy.order().Explained
exit-bothNotestrategy.exit() given both limit and profit, or both stop and loss.Explained
draws-nothingNoteAn indicator that draws nothing: no plot, shape, background, label, line, box or table.Explained
alertsNoteYour 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:

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

  1. Copy the script from the answer, or download it as a .pine file.
  2. In TradingView, open the Pine Editor at the bottom of the chart.
  3. Paste the script, replacing the editor's content, and click Save.
  4. Click "Add to chart".
  5. 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.

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