Docs

Documentation

On this page

TradingView Strategy Optimizer grid-searches the inputs of a Pine strategy through TradingView's own Strategy Tester and ranks the results, all in your browser. Everything the tool does is below: what it needs, how a sweep is set up and run, what the explorer gives you, what each plan includes, and what to do when something looks wrong.

What it does

A run takes one combination of inputs at a time and applies it to the chart. It waits for the Strategy Tester to finish recomputing, reads the metrics, and stores the row locally. Then the next combination, until your configuration is exhausted. Sort and filter the table afterwards to find the configurations that hold up.

Two things follow from that, and they shape everything else:

  • Nothing is re-implemented. The numbers are TradingView's own, from the same Strategy Tester you would read by hand. There is no second backtest engine, so the results match the platform exactly, quirks included.
  • A run costs real time. Each combination waits for an actual recompute on the chart. A few hundred combinations is minutes; tens of thousands is hours. The panel shows a live estimate before you start.

What it is not: a signal generator, a portfolio backtester, or financial advice. It searches a parameter space you define and reports what TradingView says about each point in it.

Requirements

You needDetail
A browserChrome 114+ (also Edge, Brave, Opera) or Firefox 128+
A Strategy Optimizer accountFree to create, no card required. The extension stays locked until you sign in.
A TradingView accountSigned in, in the same browser. The extension drives the chart through your own TradingView session, so no separate credentials are involved.
A Pine strategy on the chartApplied to the chart and exposing inputs. Indicators without a strategy have no Strategy Tester report to read.
The Strategy Tester panel openIts report is what the run reads. If it is closed or collapsed, the run pauses instead of recording wrong numbers.
Free plan

A free account runs sweeps up to 300 combinations with 2 swept parameters and keeps 5 saved configurations. See plans and limits for what each plan unlocks.

Quickstart

  1. Create your account on the web

    Sign up with Google. No card required. This is also where plans, billing and usage live, on your account page.

  2. Install the extension

    Add it from the Chrome Web Store or Firefox Add-ons, then pin it so the side panel is one click away.

  3. Let the panel pick up your session

    Open the side panel on a TradingView tab. If it says "Sign in on the web", press it. Signing in happens on this site, in a normal tab, and the panel unlocks by itself once you are done. There is no token to copy anywhere.

  4. Attach to a chart

    Open a TradingView chart with a Pine strategy applied and the Strategy Tester panel open. The Strategy tab lists the strategies it found; pick one and its inputs appear, typed and grouped exactly as the Pine author declared them.

  5. Configure, run, explore

    Set which inputs vary in Configure, start the sweep in Run, then open the results explorer to rank what came back.

The side panel

Five tabs, in the order you normally use them:

TabWhat it is for
StrategyPick the strategy to work on, see the detected chart context (symbol, timeframe), and review every input the strategy exposes with its current value.
ConfigureDecide how each input varies, add symbol and timeframe axes, and watch the combination count. Save, import and export configurations here.
RunAccount state, pre-run preview, run controls, live progress with elapsed and estimated time remaining, and pause / resume / cancel.
AlertsThe TradingView alerts on your account, filterable by strategy and pair, plus creating an alert from a configuration.
ConfigsEvery saved configuration across strategies, for reloading and cleanup. Rows for the strategies currently on the chart can be loaded with a click.

Results open in their own full-page tab, the results explorer, because a table that wide has no business in a 400px panel.

Configuring a sweep

The panel reads every input the strategy exposes, typed and grouped as the author defined them. For each input you choose how it varies:

ModeApplies toWhat it produces
FixedAny inputOne value, held constant for the whole run. Contributes 1 to the combination count.
RangeNumbers, dates, session windowsStart, stop and step, expanded into every value in between. A date range steps in days and hours; a session range steps the window start in minutes and keeps the live window length.
Value setAny inputOnly the values you pick. This is how booleans, dropdowns and timeframe inputs are swept, and how you test a handful of specific numbers instead of a whole range.

Sweeping symbols and timeframes

Above the inputs sit two multi-select boxes, for axes that are not strategy inputs at all: the symbols to test, searched through TradingView's own symbol search and stored exchange-qualified, and the timeframes, taken from the resolutions your chart offers. Leave either empty and the run uses the current chart. 3 symbols and 2 timeframes multiply the sweep by 6, which is how one configuration answers "does this hold up away from the chart I built it on".

Reading the combination count

The footer keeps a live count: the product of every axis, so 2 swept inputs of 10 and 12 values across 3 symbols is 360 combinations. Two guards sit on top of it:

  • Your warning threshold, editable in Configure and defaulting to 1000. Above it, starting a run asks you to confirm.
  • A fixed large-run confirmation above 10 000 combinations, so an accidental extra zero cannot start a multi-day run.

Both are advisory. The hard stop is your plan's cap on combinations per run and on how many parameters can be swept at once, shown inline in the panel when you cross it.

Running a sweep

A run takes one combination at a time and applies it to the chart. It waits for the Strategy Tester to recompute, reads the metrics, and stores the row locally. The method decides which combinations to test and in what order; the budget decides when to stop. This section explains every method and every launch shape the panel supports.

Choosing a run

Every launch shape answers a different question. Start from the question you have:

Your questionReach for
What does this strategy do across its whole space?An exhaustive sweep, or a spread sample when the space is larger than your budget.
The space is huge and I know what "better" means.Guided search with an optimization objective set.
I judge results by two or three measures at once.Trade-off search over those measures.
I have one promising result and want to polish it.Refine from its row in the explorer.
A sampled run left gaps around a candidate I care about.Probe neighbours from that candidate's row.
Does this winner survive data it was not chosen on?Confirm on unseen data for one shortlist, or rolling windows to see the pattern repeat.
I want search, stability and confirmation in one unattended launch.A staged plan.

The shapes compose. The usual order is: sweep or sample the space, refine or probe around what looks good, then confirm on unseen data before trusting it. A staged plan automates exactly that order; doing it by hand gives you a decision point between steps.

Search methods

The method is a per-run choice. It is not stored in a saved configuration, so loading one leaves the method at the pre-selection that fits the space you just loaded. Pick the method before you press Run; the choice is recorded with the session so the results stay interpretable later.

MethodWhat it doesUse it when
Exhaustive sweepTests every combination in the configured space, in order or shuffled.The whole space fits your time budget. This is the only method that cannot miss a point.
Random sampleDraws a fixed number of combinations uniformly from the whole space.You want a quick, unbiased snapshot of a very large space.
Spread sampleDraws a fixed number of combinations so every parameter's value list is covered evenly, avoiding the clustering random draws can leave.You want a fairer picture of the whole space than random gives, for the same budget.
Guided searchSpreads the first trials, then concentrates later trials in regions whose results have been better. It needs an optimization objective or a weighting profile to steer by.The space is far larger than your budget and you know what "better" means.
RefinementStarts from one combination and walks its immediate neighbours, one parameter at a time. Every time a neighbour improves on the current centre, the run continues from that neighbour. It needs a starting combination, usually handed off from a result row.You already have a promising candidate and want to polish the values around it.
Trade-off searchSpreads and concentrates like guided search, but steers by two or three chosen measures at once instead of a single objective. It finds combinations that are not beaten on every chosen measure.You care about more than one figure, for example net profit and maximum drawdown.

Auto mode

Auto is the default method selector. It picks a concrete method from the space size, your trial budget, and whether you have set something to steer by. The reasoning is stated on screen before the run starts, and you can override it with any method you prefer.

Auto decides in this order:

  1. The configuration has one combination. There is nothing to search. Pick a wider sweep or run the single point manually.
  2. The whole space fits the budget. Auto chooses the exhaustive sweep, because there is no reason to sample when everything can be covered.
  3. The budget is below the exploration floor. Auto refuses and names the minimum budget. Below that threshold a guided search would spend every trial exploring and never concentrate.
  4. An objective or profile is set. Auto chooses guided search. A share of the budget spreads first; the rest concentrates on regions that have scored well.
  5. Otherwise. Auto chooses spread sample, because it covers every value list evenly when there is nothing to steer by.
Auto never chooses refinement or trade-off search

Refinement needs a starting combination only you can pick, and trade-off search needs the measures you care about. Auto only chooses among exhaustive, random, spread and guided search.

Launching from results

The results explorer can send a configuration back to the side panel, and some actions launch a specialised run instead of reloading the sweep. Each action pins the symbol and timeframe of the row you started from, because the question is about that specific context.

ActionWhat it launchesWhy use it
RefineA refinement pass centred on the selected row's combination. The budget is prefilled as a whole number of neighbour sweeps, and you can edit it before starting.Polish a promising result by exploring the values around it.
Probe neighboursA run of the untested neighbours of one or more candidates, bounded by the neighbourhood size. Results land in a new session in the same context.Fill the gaps a sampled run left, so stability analysis can judge the result.
Confirm on unseen dataA re-run of a shortlist over a later backtest period that took no part in choosing it. The search period and the confirmation period are chosen in the explorer and must not overlap.Check whether a top result survives data it was not optimized on.

These actions are steps of one pipeline rather than alternatives. A typical path through a large space: sample it, refine the best row, probe the neighbours of what survived so stability analysis has ground to judge, then confirm on unseen data before you trust the result. Each action lands its rows in a session in the pinned context, so the explorer can put the before and after side by side.

Backtest periods

By default a run uses the full history available on the chart. The Backtest periodcontrol lets you confine it to a date range. The run sets TradingView's own backtest date range, so it works on any strategy regardless of how the Pine script is written.

You can also slide the period forward in windows. Give a total range, a search length, a confirmation length and a step; the system generates a sequence of search-and-confirm windows that move forward together. Each window searches a fresh slice and confirms on the slice that follows it.

Rolling is for judging a pattern, not finding one winner. Choose a total range long enough to produce several windows, then read how the strategy behaves across all of them: a configuration that confirms in most windows is worth far more than one brilliant window surrounded by failures. The panel shows every window's outcome, so the comparison happens in one place.

Periods are whole days

The smallest unit is a whole day in the symbol's exchange time zone. Intraday timeframes still use whole-day boundaries. If the run cannot set the range, it stops and says so rather than running over the full history and labelling it as confined.

Staged plan

A staged plan chains three stages so expensive checks only run on the survivors of the cheap ones:

  1. Search. Run a budgeted search over the configured space.
  2. Stability check. Test the immediate neighbours of the top candidates and keep only the ones that sit on stable ground.
  3. Confirmation. Re-test the survivors on a later, unseen period.

Each stage feeds only the survivors into the next. The panel states the maximum possible cost before the run starts, and the actual cost is re-stated at each stage boundary. The staged plan covers exactly one symbol and one timeframe, and it needs a declared search period when the confirmation stage is enabled.

Prefer a staged plan when you already know you want all three checks and would rather not sit at each boundary deciding what to launch next. Doing the stages by hand costs more attention but lets you change course between them: widen the search, drop stability, or confirm a different shortlist than the one stability ranked first.

Each stage's survivor limit decides how many candidates may enter the next stage. Smaller limits keep the later stages cheap, but a candidate eliminated at a boundary is gone for good, so do not set them tighter than your confidence in the measure doing the ranking.

A staged plan survives interruptions. If the browser closes mid-plan, resume it from the run list on any chart with the same strategy applied; it picks up at the stage that was running and launches the following stages on its own when each completes.

Run controls

These controls sit below the method. Pause, resume and cancel are always available; skip, randomize and throttle need a plan that includes advanced run controls.

ControlWhat it does
Pause and resumePausing finishes the combination in flight, then stops. Resuming continues the same session at the same point, and a randomized run replays its original order.
CancelEnds the session for good, keeping everything already recorded. Available while running and while paused.
Skip already testedCompares the pending combinations against results you already recorded for this strategy, including earlier sessions, and skips the matches. The pre-run preview shows how many would be skipped, and the option pre-selects itself above 20 matches.
Randomize orderTests combinations in a shuffled but reproducible order (the seed is stored with the session), so a partial run samples the whole space instead of only its first corner.
ThrottleAdds a random pause of 1 to 3 seconds every 25 to 100 combinations, on top of the normal pacing, so a long sweep does not look like a machine gun to TradingView. All four bounds are editable, and it turns itself on above 1000 combinations unless you set the toggle yourself.
Single sessionKeeps a sweep that spans several symbols and timeframes in one session instead of one session per (symbol, timeframe) pair. The rows still record their own context, but the combined view treats them as one run.
Warm startSeeds an adaptive run with matching results you already recorded on the same strategy and space. Inherited results shorten the opening spread phase, but they still have to reach the exploration floor before the run starts concentrating.

When a run pauses itself

A session reads as Running, Paused, Completed,Cancelled or Failed. The engine pauses itself, with the reason on screen, rather than recording a number it does not trust:

  • The report is unreadable. Usually the Strategy Tester panel is closed, collapsed, or still loading. Open it and resume.
  • The chart drifted. Something changed the symbol, the timeframe or the strategy under the run. The reason names the field that moved. Put the chart back and resume, and the interrupted combination is retried rather than lost.

Nothing forces you to resume immediately. A paused or interrupted session keeps everything it recorded, and you can resume it later from the run list on any chart where the same strategy is applied; the run continues from the combination that was in flight. A staged plan resumes the same way and carries on through its remaining stages without further input.

Leave the tab alone

The run drives the chart in a real tab. Changing symbol, timeframe or strategy inputs by hand while it works will pause it. Background tabs are fine; a closed tab is not.

Exploring results

The explorer opens as a full page and lists your sessions on the left, with per-session progress and status. Pick one and its results fill a virtualized table built for tens of thousands of rows.

  • 17 metrics per row, exactly as TradingView reports them, grouped as profit and loss, risk-adjusted, drawdown, and trade behaviour: net profit and percent, gross profit and loss, commission paid, profit factor, Sharpe, Sortino, average win over average loss, max drawdown and percent, total, winning and losing trades, win rate, average trade, and average bars in trade.
  • Sort and filter by any of them. Sorting keeps rows with no value last, so an empty profit factor never wins a ranking. Filters take a min, a max, or both, and stack.
  • Choose your columns. The column picker hides what you are not reading; sort, filters and CSV follow the visible set.
  • Open a row to see the full configuration behind it, parameter by parameter, with the values that differ from the rest of the sweep called out. Equity curves and trade lists are not stored: re-run the combination from the row to see them on the chart.
  • Export to CSV: the whole filtered set by the visible columns, written in your browser with no network round trip. Chromium shows a native save dialog; Firefox downloads the file.
  • Combine sessions into one ranked table to compare a strategy across symbols, timeframes or reruns, with the shared identity columns pinned.
  • Send a configuration back to the panel from any row, to load it onto the live chart. The side panel has to be open to receive it, and a run in progress refuses the handoff.

The AI assistant

Ranking results means telling the tool what "best" means, and the What counts as best dialog assumes you already know the figure vocabulary. The assistant is the other way in: write a sentence like "steady returns, drawdown under 15 percent, at least 150 trades" and it proposes the conditions, the objective and the weighting for you to read, edit and confirm.

  • It proposes an input you confirm, never an answer you are asked to trust. It never starts a run, changes a search space, picks a method or produces a verdict.
  • It is off until you turn it on, and it defaults to a model running on your own machine, where nothing leaves your computer at all.
  • You can point it at a hosted provider instead, on your own API key. That is a second, separate decision with its own disclosure naming the company, and it is on every plan because we never pay for, meter or bill any of it.
Full guide

How the AI assistant works covers setting up Chrome's built-in model, Ollama and llama.cpp (including the origin setting Ollama needs), bringing your own key for a hosted provider, exactly what a request contains, and what each refusal means.

Saved configurations

Save a sweep as a named configuration, scoped to its strategy, and reload it later with every range, value set, disabled input and axis intact. The Configs tab lists them across strategies for reloading and cleanup.

Export copies a configuration to your clipboard as JSON, for a backup, another machine, or a colleague. Import pastes one back, shows you what it contains before applying, and selects the matching strategy first if you have several on the chart. The round trip preserves the sweep, not just the current values.

Alerts

Turn a result into a TradingView alert straight from the explorer row. The alert is built from that row's own recorded configuration, so it fires the combination you optimized even if the strategy on your chart has moved on since the run.

When you create one you set:

  • The message, which can carry Pine placeholders the same way TradingView's own dialog does.
  • An optional webhook URL.
  • Expiration: never, or a date and time you pick.
  • Notifications: mobile app, email, or neither.

Save the message and webhook as your default template once and every later alert starts prefilled. The Alerts tab then lists what exists on your TradingView account, filtered by strategy and pair and sorted by creation or last fire, and can apply an alert's configuration back onto the chart or save it as a configuration.

Testing communities

A parameter space that takes one browser a week takes a group an afternoon. A testing community is built around one strategy. An admin publishes a campaign over its inputs, members opt in to compute slices of it on their own TradingView account, and the rows come back into one ranked table with cross-checking and per-member access control.

  • Nothing is computed or transmitted until a member presses Contribute and accepts the exact list of what it sends.
  • Every row a member computes stays in their own explorer. It stays there after they leave the community, after the campaign closes, and after the community is deleted.
  • Joining and contributing work on the free plan, on the campaign's free variant. Creating a community and publishing campaigns need a plan that includes it.
Full guide

How testing communities work covers roles and invite codes, defining and publishing a campaign, eligibility, contributing, the pooled results table, confidence flags and access grants.

Plans and limits

The free plan is permanent, not a countdown: no card, no expiry, and it keeps working. What it caps is scale and the extras. Prices and the plan lineup live in the pricing table, straight from our billing system. The table below says what the caps mean in practice.

CapabilityFreePaid
Run, pause, cancel a sweepYesYes
Combinations per runUp to 300Unlimited
Parameters swept at onceUp to 2Unlimited
Saved configurationsUp to 5Unlimited
Results explorer, sort and viewYesYes
CSV exportNoYes
Combined multi-session view and advanced filtersNoYes
Create TradingView alertsNoYes
Skip already tested, randomize, throttleNoYes
Join a testing community and contributeYes, free variantYes, full variant
Create a community and publish campaignsYes, 1 community, free-sized campaignsYes, full size

Locked surfaces stay visible and say what unlocks them, so nothing disappears from the interface when a plan ends. Entitlements are checked on our server the moment an action runs, never cached in the extension. So buying a plan takes effect after a quick Recheck in the panel, and a network outage blocks a gated action rather than quietly allowing it.

One TradingView account

Your subscription locks to the first TradingView account it sees, and gated actions check against it before they run. That is what keeps account sharing out, and it comes with a few rules:

  • The panel needs you signed in to TradingView to verify anything.
  • Using a different TradingView account shows "locked to another TradingView account" with a reset button.
  • Resets are throttled: at least 24 hours between them, and at most 3 in any 30 day window. Plan a legitimate account change accordingly.

Where your data lives

The extension is local-first. Your strategies, the combinations it tests and every metric it reads are written to a database inside the extension itself, in your browser, and are never uploaded. Uninstalling or clearing the extension's data removes them.

What does reach our servers is the minimum needed to run accounts and enforce plans: your account identity from Google, the TradingView account your subscription is bound to, and counts of what you used (runs launched, combinations tested, alerts created) with their timestamps. No strategy names, input values, symbols or performance numbers are sent by a run of your own. Your usage totals are shown back to you on your account page, and the privacy policy lists every stored field.

There is exactly one exception, and it is opt-in. Contributing to a community campaign sends the results you computed for that campaign to the community, along with the strategy's identity, the work you were assigned and your progress. The panel lists every category before the first combination runs and waits for you to accept, every time you start. Your own copy of those results stays in your browser regardless.

Troubleshooting

What you seeWhat it means, and the fix
The panel asks you to sign in on the webSign-in cannot complete inside a side panel, so it happens on this site. Press the button, finish signing in on the tab that opens, and the panel unlocks on its own.
"No TradingView login detected"You are signed out of TradingView in this browser, or the tab is not a TradingView page. Sign in on TradingView, then press Recheck.
"This account is locked to another TradingView account"Your subscription is bound elsewhere. Use the bound account, or press the reset button (see the reset limits).
"Your plan does not include this"The action needs a capability your plan lacks. Compare plans in the pricing table; after buying, press Recheck.
"Could not verify your session"The entitlement check could not reach our API. Gated actions fail closed by design. Check your connection and press Recheck.
No strategies listed on a chart that has oneThe script is an indicator, not a strategy, or the chart is still loading. Reload the TradingView tab and reopen the panel.
The run pauses immediately, every timeThe Strategy Tester report is not readable. Open the Strategy Tester panel, make sure it shows a report for the selected strategy, then resume.
The run pauses naming a symbol, timeframe or strategyThe chart changed under the run. Restore what the reason names and resume; the interrupted combination is retried.
Rows arrive with empty metricsThat combination produced no trades, or TradingView reported nothing for it. Filter them out with a minimum on total trades.
The explorer cannot send a configuration to the panelThe side panel is closed, or a run is in progress. Open the panel, or wait for the run to finish, then send again.
A run is far slower than expectedEach combination waits for a real recompute, and the throttle adds deliberate pauses above 1000 combinations. Narrow the sweep, or turn the throttle down.

FAQ

Does it work on any Pine strategy?

Any strategy applied to the chart that exposes inputs and produces a Strategy Tester report, including invite-only and protected scripts, because it reads what is already running rather than the source.

Can I close the browser while a sweep runs?

No. The run drives a live chart, so the tab has to stay open. You can pause, close things, and resume the same session later from where it stopped.

Do results from different symbols or timeframes mix?

Each (symbol, timeframe) block is its own session by default, and the combined view unions sessions on purpose when you do want them side by side.

Are equity curves and trade lists stored?

No, only the 17 metrics per combination. Re-run a row from its detail view to see the curve and trades on the chart.

Is my strategy uploaded anywhere?

Your Pine source and strategy logic never leave your machine, and a run of your own sends no results at all. Contributing to a community campaign sends the results of that campaign, and only after you accept the list of what it sends. See where your data lives.

Which search method should I use?

Auto is the safest starting point. It picks an exhaustive sweep when the whole space fits your budget, a guided search when the space is larger and you have set an objective, and a spread sample otherwise. You can still override it with any method.

What is the difference between a sample and an adaptive search?

A sampled run tests a fixed number of combinations you choose. An adaptive run uses its first trials to learn where the good results are and spends the rest concentrating there. Both count against your plan the same way.

How is the trial budget counted?

The trial budget is a count of parameter combinations, not backtests. Each combination is tested in every symbol and timeframe you selected, so the total backtests are budget multiplied by contexts. The panel states both before the run starts.

What does out-of-sample confirmation mean?

Out-of-sample confirmation re-runs a shortlist over a later period that took no part in choosing it. A result that looks great on the search period but collapses on the confirmation period is probably over-fit to one stretch of history.

What happens to my results if I cancel my plan?

They stay in your browser, and the explorer stays readable. The paid surfaces lock, and runs go back to the free caps.

Is this endorsed by TradingView?

No. It is an independent tool that uses your own TradingView session, and it is not affiliated with or endorsed by TradingView.

Getting help

Stuck, or found a bug? Email support@stratopti.com and include your browser, what the panel says, and the strategy you were sweeping. Have an idea? Send a suggestion the same way. The terms and privacy policy cover the legal side.