> For the complete documentation index, see [llms.txt](https://docs.algopro.us/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.algopro.us/tradingview-chrome-extension/testing-a-strategy.md).

# Testing a Strategy

## Testing a Strategy

### What the Testing a Strategy Section Does

The **Testing a Strategy** section is where you run structured strategy tests.

Instead of manually changing settings one by one, AlgoPro can test parameter combinations and record the results.

This section is used to:

* Choose what metric to optimize for
* Choose an optimization method
* Select strategy parameters
* Run testing cycles
* Compare tested settings
* Apply stronger settings back to TradingView

### Optimize For

The **Optimize For** dropdown controls what AlgoPro tries to improve.

Examples may include:

```
AI Backtest Grade
Net Profit %
Profit Factor
Sharpe Ratio
Max Drawdown
Net Profit x Sharpe x Profit Factor
Net Profit x Sharpe⁵ x PF² x Low DD
Net Profit x Sharpe¹⁰ x PF⁵ x Low DD
```

Most metrics are better when higher.

Examples:

```
Net Profit % → Higher is better
Profit Factor → Higher is better
Sharpe Ratio → Higher is better
AI Backtest Grade → Higher is better
```

For drawdown:

```
Max Drawdown → Lower is better
```

### Optimization Methods

AlgoPro includes several testing methods.

#### Random

Randomly tests parameter combinations within your selected ranges.

Best for:

* Exploring broad possibilities
* Finding unexpected settings
* Early-stage testing

#### Partially Random

Changes some settings while keeping others closer to the current setup.

Best for:

* Testing around an existing setup
* Making moderate changes
* Refining a strategy without going too random

#### Random Improvement

Uses previous results to try improving from stronger settings.

Best for:

* Refining a promising setup
* Searching around better-performing results
* Improving gradually over time

#### Random Improvement Batch

Runs a repeating cycle:

```
5 Partially Random tests
5 Random Improvement tests
Repeat
```

Best for:

* Balancing exploration and improvement
* Avoiding getting stuck too early
* Continuing to search while refining results

#### AI Smart Improvement

Uses AI guidance during optimization.

AI guidance submits testing data and strategy data throughout a test and decides what metrics would help improve performance the most.

### Running a Test

Before starting:

1. Open TradingView.
2. Load your strategy.
3. Open Strategy Tester.
4. Open AlgoPro TV Assistant.
5. Choose your optimization metric.
6. Choose your method.
7. Select your strategy parameters.
8. Start testing.

While testing is running, avoid changing the chart, symbol, timeframe, or strategy settings manually.

### Strategy Tester Report Waiting

AlgoPro attempts to wait for TradingView’s Strategy Tester report before saving a result.

Long backtests may take more time.

Testing can be slower when:

* The strategy is complex
* The chart has many candles
* The backtest range is long
* TradingView is delayed
* The strategy report returns an error
