# AI training

> Train a model on your own saved trades, test it on untouched data and save it.

Source: https://quantraider.com/docs/ai-training

AI training builds a model from the trades you saved for a strategy. The model learns which setups worked and can later choose the stop loss, take profit and risk for a new setup. You test it on data it was not trained on before you rely on it.

> Not financial advice. Trading involves risk of loss. A model trained on past trades may fail on new data. A good test result does not guarantee future performance.

Open it from a strategy's **AI training** tab. It needs a plan that includes **AI model training**. Plans also limit the number of training runs per month. See [Plans and billing](/docs/plans-and-billing).

## Before you start

You need:

- trades saved for the strategy, from an [auto backtest](/docs/auto-backtest) or by hand,
- at least one saved configuration from [Analysis](/docs/analysis). Without one the page says **Save an analysis configuration before training an AI.**
- a graph that generated the trades. Training checks that every historical trade was made with the graph you select. If the history is old or made with different graphs, delete it and regenerate it with the selected graph.

## Set up a training run

The page is a form in sections.

### Training data

- **Saved configuration**: the configuration whose trades the model learns from.
- **Training graph**: the graph that generated the history.
- **Load saved AI settings** (optional): copies the settings of a saved AI into the form. Retraining creates a new draft. The saved AI stays unchanged.

### Chronological split

The history is divided from oldest to newest into three parts: **Train (%)**, **Validation (%)** and **Test (%)**. Training learns from the first part, validation decides when to stop and the **test** part stays untouched until the final evaluation. A bar shows the split. If the numbers do not add up, an error appears under it.

### Input features

Tick what the model may see about each setup before the order is placed. Hour and weekday use the UTC time of the setup, which is known before entry.

### Targets and risk

- **Stop losses** and **Named take profits**: the exits the model chooses between.
- **Additional target-RR ranges**: add ranges with **Min RR**, **Max RR** and **Step**, using **Add RR range**. The page shows how many stop loss and take profit combinations this gives per setup, and the maximum allowed.
- **Risk sizing**: **Max expected drawdown (%)**, **Risk cap per trade (%)**, **Drawdown trade horizon** and **Confidence (%)**. The horizon is prefilled from the configuration's expected trades per year. You can edit it. Orders that would exceed the cap are skipped, not resized.

Each section has a **How this works** note with more detail.

## Train and evaluate

Choose **Train and evaluate AI**. A progress bar and status line show the stage. The progress is stage progress, not a time estimate. Model settings such as tree limits and learning rate are managed by the backend. There is nothing to configure.

## Read the results

Under **Results**, choose an **Evaluated AI** to see how it did on the untouched test data.

- **AI vs configuration** compares the model with the configuration's best fixed stop loss and take profit, using the same test opportunities. Skipped trades stay flat. Turn on **Show R instead of compounded %** to see results in R.
- Further charts show the decision distribution and feature importance.
- Metric cards compare the AI and the configuration side by side.
- **Held-out model quality** shows test log loss and Brier score, and how many trades were in each split.

Notices on the page flag older models. For example, a model that used an earlier training recipe or legacy calendar features should be retrained.

## Save the AI

Choose **Save AI** and give it a name. A saved AI is immutable. To change it, retrain and save a new one. If you edit the graph or configuration, you need a new AI. Legacy saved AIs remain readable but cannot be used live.

Saved AIs can be used when you set up an automation with the **Use saved AI** execution policy. See [Live chart, orders and automations](/docs/live-trading-and-automations).

## Messages

| Message | Meaning |
|---|---|
| Your Free plan does not include AI model training. (the plan name varies) | Upgrade to a plan that includes it. |
| Your plan has reached its limit of AI training runs per month. | Wait for the next month or upgrade. |
| Sign in to train an AI. | Log in again. |
