A plain-English guide to training models in AI Studio, deploying the files, and using those models on the Fusion Builder canvas with ONNX blocks.
This guide is written for a Fusion user who understands the basics of Fusion Builder but has not yet used the AI Studio workflow. It explains the full user path: prepare chart data, create a training dataset, choose the answer the model should learn, train or compare models, deploy the files, load the model into an ONNX block, wire the inputs, and use the model output safely inside a Fusion workflow.
AI Studio and ONNX blocks are modeling tools. They can help you study relationships in historical data and bring a trained model back into your Builder graph. They do not guarantee trading results, and a raw model output is not a trade instruction by itself.
Interactive companion: an interactive teaching tool (a visual target-family simulator, AI Studio workflow mockup, and ONNX block mapping walkthrough) is included with your product download for a visual target-family simulator, AI Studio workflow mockup, and ONNX block mapping walkthrough.
AI Studio works best when you treat it as part of the normal Fusion Builder workflow, not as a separate shortcut.
Before training a model, you should have:
If the installer or prerequisites asked you to restart Windows, restart before relying on training or ONNX runtime behavior. Some Windows runtime components do not fully finish registration until after a restart.
Use a simulated or test workflow first. Do not move a new model directly into live automated execution without reviewing the output on fresh data and testing it in a controlled environment.
AI Studio turns captured chart rows into a trained model file that Fusion can run later through an ONNX block.
The simple mental model is:
Fusion canvas blocks = evidence
AI Studio capture = frozen training dataset
AI Studio target settings = the answer column
AI Studio training = model files
Deploy = copy files to the Fusion model library
ONNX block = run the trained model on the canvas
AI Studio does not rewrite your strategy for you. It does not automatically decide how to trade. It trains a model that produces an output. You decide how to use that output with Builder blocks, conditions, gates, plots, entries, exits, and risk rules.
AI Studio can train from:
| Data Source | Plain-English Meaning |
|---|---|
| OHLCV | chart price and volume rows |
| Fusion block outputs | values produced by blocks on your canvas |
| transformed values | normalized, filtered, or combined values you built visually |
| order-flow-derived values | order-flow features when your chart and data support them |
| prepared answer columns | generated or manual target columns inside the prepared dataset |
The strongest use case is training on custom Fusion features that you built visually. A model trained only on raw OHLCV is usually less interesting than a model trained on the trend, volatility, structure, and order-flow features you deliberately designed.
AI Studio does not:
It creates model files and metadata. You still need to inspect, deploy, wire, test, and decide how the model output should be used.
The AI Studio workflow has four practical stages.
| Stage | What You Do | What It Produces |
|---|---|---|
| Build and Export | choose chart data and canvas outputs | raw evidence columns |
| Capture | freeze rows and generate answer columns | prepared dataset |
| Train | choose one answer, choose inputs, train or compare | trained model files |
| Deploy and Load | copy files, add ONNX block, wire inputs | live model output on canvas |
The most important distinction is this:
Generated targets may look forward in historical data to create training labels. The live ONNX block does not get future data. In live use, it only receives the input values you wire into the ONNX block.
AI Studio starts with the data you make available.
In Fusion Builder, build the blocks you want the model to learn from. Examples:
Then use the Export workflow to choose what raw rows and block outputs should be captured.
Export decides:
Plain-English rule:
Export chooses the evidence the model can use later.
For most generated target families, include OHLCV.
Why:
If you do not include the required price columns, AI Studio may not be able to create the generated answers you expect.
For a first model, do not export every block on the canvas. Use a clean set of meaningful features.
Good first set:
More inputs are not automatically better. Too many weak or duplicated inputs can make a model look better in-sample while behaving poorly later.
AI Studio Step 1 creates or opens the prepared dataset.
A prepared dataset is a frozen snapshot of:
Use Create New Capture when you want AI Studio to capture the current Export setup and prepare a fresh dataset.
When you create a new capture, Fusion:
Changing your canvas or Export settings does not automatically change an old prepared dataset. If you want those changes in training, create a new capture.
Use Open Saved Capture when you want to return to a prepared dataset you already created.
This is useful when:
Plain-English rule:
A saved capture is frozen. It trains from what was captured then, not from whatever the live canvas looks like now.
AI Studio can create several generated answer families. These are the columns the model can later learn.
| Target Family | What It Asks | Output Style |
|---|---|---|
| Future Return | What percent move happens over N bars? | numeric |
| ATR-Normalized Return | How many ATR units up or down over N bars? | numeric |
| Future Log Return | What log-return happens over N bars? | numeric |
| Future Volatility | How much movement happens over N bars? | numeric magnitude |
| Up / Down | Is the future close above the current close? | classification |
| Direction (3-Class) | Is the future move down, flat, or up? | classification |
| ATR Stop / Target Race | Which ATR barrier is hit first? | classification |
| Swing Reversal | Does this bar become a confirmed swing? | classification |
| Mean Reversion | Does price move back toward a reference? | numeric or score-like |
| Regime | What market state or volatility bucket is this row? | classification |
Not every target is meant for the same job. A future-return target is different from a volatility target. A volatility target predicts movement size, not direction.
A horizon is how far forward the generated target looks while building historical labels.
Example:
5 bars
means the target is asking about what happens from the current row to 5 bars later.
Shorter horizons usually react faster and are noisier. Longer horizons are usually smoother and slower.
Step 2 is where you choose what the model is trying to learn and which columns it is allowed to use.
Plain-English rule:
Step 2 chooses the answer and the evidence.
Prediction Style decides the general type of model.
| Prediction Style | Meaning | Example |
|---|---|---|
| Regression | model outputs a number | future ATR return, volatility estimate |
| Classification | model outputs a class or label | up/down, down/flat/up, regime |
Regression does not mean mean reversion. Classification does not mean better. They are just different output shapes.
Choose the style that matches the answer column.
Answer Column Source decides where the target comes from.
| Source | Meaning | Normal Use |
|---|---|---|
| Generated Answer Columns | AI Studio created target columns during capture | most users |
| Prepared Answer Column | use an existing column in the dataset as the answer | advanced/manual target workflows |
Generated targets are the safer normal path because AI Studio knows how they were created.
Prepared/manual answer columns are powerful, but they require more responsibility. If you select a same-row column such as Close as a manual answer, Fusion does not automatically shift it into the future for you.
Generated Question Family chooses the built-in target family.
Examples:
Be especially careful with volatility and regime targets:
Step 1 may create several horizon variants. Step 2 chooses the one target column this model should learn.
Example:
Target_ATRReturn10.AI Studio can train more than one candidate answer target in a comparison run.
Use comparison when you want to ask:
When additional answer columns are selected, the primary button changes from Start Training to a comparison action such as Train & Compare N Targets.
Comparison trains one model per candidate answer column, ranks the completed results, and marks the current best row as selected for deploy. The comparison result is not deployed until you press Deploy Model Files.
Feature columns are the inputs the model can see.
Good features should:
Do not select the target column as a feature. If the answer is also an input, the model can appear to learn something that will not be available live.
AI Studio checks whether selected columns have enough usable rows after filtering invalid values.
Pay attention to:
If the final training row count is too low, simplify the feature list, load more chart history, or remove sparse columns.
Step 3 chooses how the model is trained.
The algorithm is the model family. AI Studio may show different options depending on which optional Python libraries are installed.
Common model families include:
| Algorithm Family | Good For |
|---|---|
| Random Forest | stable first pass, noisy tabular data |
| Extra Trees | fast tree baseline |
| Hist Gradient Boosting | strong built-in boosted baseline |
| LightGBM | fast boosted tree training when available |
| XGBoost | strong boosted tree training when available |
| CatBoost | strong boosted tree training when available |
| Ridge / Elastic Net | fast linear regression baselines |
| Logistic Regression | fast classification baseline |
| MLP / Neural Network | nonlinear model, usually needs more care |
Good first choices:
Tuning searches across algorithm settings.
For a first run, leave tuning off. First confirm:
Then tune later if the basic workflow is stable.
More tuning trials can improve a model search, but they do not prove that the model will work live.
Standardizing features puts inputs on a more comparable scale.
This is especially useful for linear models and neural networks. Tree models are usually less sensitive to feature scale, but standardization normally does not hurt.
Choose a model name that you can recognize later.
Good names include:
NQ_ATRReturn10_RF_v1
ES_Direction5_LGBM_v2
CL_Volatility20_Filter_v1
Avoid vague names such as:
test
model1
goodone
The model name matters because it becomes part of the file identity you will later browse to from the ONNX block.
AI Studio shows the target source mode near the training button.
Use it as a quick check:
| Badge Meaning | How To Treat It |
|---|---|
| Generated target | normal AI Studio target path |
| Manual/prepared target | review carefully |
| Current-bar label | advanced/current-state workflow, not a future prediction |
If current-bar mode is selected, read the warning. Current-bar labels can be legitimate for state detection, but they are not the same as future prediction.
Use Start Training when you want to train one model on the selected answer column.
AI Studio sends the request to the trainer, waits for results, and shows:
Use comparison when you selected additional answer columns.
The comparison workflow:
The other completed comparison models are still saved in the session output folder. They are not lost just because one row is selected.
Training creates files in the training session output area. Deploy copies the selected model files into the Fusion model library where ONNX blocks can load them.
Deploy copies:
| File | Purpose |
|---|---|
.onnx | the model runtime file |
.fusion.json | Fusion metadata, feature order, target meaning, model card details |
The Fusion model library is:
Documents\NinjaTrader 8\templates\FusionModels
Deploy does not:
Deploy only copies the selected files into the model library.
After deploying, go back to the canvas, add or select an ONNX block, and browse to the deployed .onnx file.
An AI Studio model should keep the .onnx file and the .fusion.json metadata file together.
Do not copy only the .onnx file unless you intentionally want an advanced/manual mapping workflow. Without the .fusion.json, Fusion cannot show the full trained feature contract or model card.
The ONNX block is how a trained model returns to the Fusion Builder graph.
The model output can then be:
On the Builder canvas:
.onnx file from the Fusion model library.Selecting or re-selecting a model is the reload trigger. If you changed files, browse to the model again or re-select it so Fusion refreshes the metadata.
When the .fusion.json file is present, the ONNX block can show:
If the block says no .fusion.json was found, you can still use advanced manual mapping, but you lose the normal metadata-driven safety checks.
The ONNX block inputs are ordered. The first input port corresponds to the first trained feature. The second input port corresponds to the second trained feature, and so on.
This matters because an ONNX model does not understand your canvas visually. It receives a numeric vector in order.
Wrong order can produce wrong output even if every wire looks reasonable.
The ONNX block shows mapping rows that compare trained inputs against live canvas inputs.
Use the colors this way:
| Status | Meaning |
|---|---|
| Green | ready or exact match |
| Amber | review needed or waiting for wire |
| Red | missing source |
Do not trust the model output until red rows are fixed and amber rows have been reviewed.
Use Apply Metadata Mapping to restore the trained feature order from the .fusion.json metadata.
This is useful when:
Use Auto Wire Exact Matches when the trained source can be matched unambiguously to a live block on the canvas.
Auto-wire is helpful, but still review the mapping. It should not replace a quick visual check.
Manual mapping is for advanced cases.
You may need it when:
.fusion.jsonManual mapping requires the same discipline: the live inputs must match the trained meaning and order.
Before using the model output in trading logic, wire it to a Result block and inspect it.
Check:
If the output is surprising, fix the mapping or model choice before building downstream strategy logic.
An ONNX block outputs a value. What that value means depends on the model target.
Regression models output numbers.
Examples:
| Target | Output Meaning |
|---|---|
| Future Return | estimated future return-style value |
| ATR-Normalized Return | estimated future move in ATR units |
| Future Volatility | estimated future movement magnitude |
| Mean Reversion | estimated reversion-style score |
A positive number is not automatically a buy order. A negative number is not automatically a sell order. You still decide thresholds and downstream logic.
Common ways to use regression output:
Classification models output a class-style value.
Examples:
| Target | Typical Meaning |
|---|---|
| Up / Down | one of two direction labels |
| Direction (3-Class) | down, flat, or up |
| Swing Reversal | swing high, neutral, or swing low |
| ATR Stop / Target Race | upper barrier first, neutral, or lower barrier first |
| Regime | low, normal, or high state bucket |
The class value is still a model output, not a trade instruction. Use Builder logic to decide what a class means in your system.
Volatility and regime models are often best used as filters.
Examples:
Do not treat a high-volatility output as bullish or bearish by itself. Volatility is about movement size, not direction.
For your first complete AI Studio test, keep the problem simple.
Build or select a few feature blocks:
Include:
Use:
Horizon windows: 5,10,20
Leave specialized target families off unless you know you need them.
Use:
Prediction Style: Regression
Answer Column Source: Generated Answer Columns
Generated Question Family: ATR-Normalized Return
Selected Horizon: 10 bars
Select a small clean feature set.
Use:
Algorithm: LightGBM if available, otherwise Random Forest or Extra Trees
Tuning: Off
Standardize features: On
Train one model first. Once that works, compare target horizons or model families.
Deploy the model files, add an ONNX block, browse to the model, apply metadata mapping if needed, and plot the output with a Result block before using it anywhere else.
Goal:
Build a numeric model output that estimates whether the next several bars have upward or downward pressure.
Use:
Good downstream pattern:
ONNX output -> Result block for review
ONNX output -> Condition above threshold
Condition -> Strategy Condition or Strategy Gate as appropriate
Goal:
Classify the future move as down, flat, or up.
Use:
Good downstream pattern:
ONNX output -> Compare Equal to UP class
ONNX output -> Compare Equal to DOWN class
Class checks -> downstream strategy logic
Goal:
Decide whether the market is likely active enough for another setup.
Use:
Good downstream pattern:
ONNX volatility output -> Condition above threshold
Condition -> Gate for breakout or momentum logic
Goal:
Classify current market state and use it as context.
Use:
Important:
Regime is a current-state label. Treat it as context, not as a future direction target. V1.0 regime test metrics can be optimistic because the regime thresholds are fit on the full captured dataset.
After training, AI Studio and the ONNX block can show model card information.
The model card may include:
Metrics describe how the model behaved on held-out historical rows. They are not a guarantee of live behavior.
Common regression metrics include:
| Metric | Plain-English Meaning |
|---|---|
| R-squared | numeric fit quality; can be weak even when sign behavior is useful |
| MAE / RMSE | average size of numeric errors |
| Directional Accuracy | how often output direction matched outcome direction |
| Output Ratio | ratio-style summary of correctly signed vs incorrectly signed held-out output |
| Rank IC | whether larger outputs tended to rank with larger outcomes |
| Top/Bottom Quintile Spread | spread between high-output and low-output groups |
Do not judge every regression model only by R-squared. In trading-style targets, directional behavior and ranking can matter more than exact magnitude fit.
Common classification metrics include:
| Metric | Plain-English Meaning |
|---|---|
| Accuracy | percent of labels predicted correctly |
| F1 Macro | balanced class-quality score across labels |
| MCC | class separation quality, useful when classes are imbalanced |
| Per-class precision | how often a predicted class was correct |
| Per-class recall | how often actual class rows were found |
Watch for collapsed classifiers. If a model predicts one class almost all the time, the headline accuracy can look acceptable while the model is not useful.
Feature importance can help you understand what the model relied on.
Use it to ask:
Feature importance is not proof that a feature causes the outcome. It is a model diagnostic.
If the target column is also selected as a feature, the model can learn from the answer directly. That is not a valid live setup.
Generated targets look forward while creating historical labels. The live ONNX block does not receive future bars.
Manual/prepared targets are advanced. A same-row manual column is not automatically future-shifted.
If you use manual targets, know exactly how the target column was created.
Current-bar labels are for current-state detection. They are not future prediction.
Use current-bar mode only when you deliberately want a model to classify or reproduce current-state information.
The ONNX model expects inputs in the trained order. If the order is wrong, the model output can be wrong.
Always plot the ONNX output first. Review behavior before using it in Strategy logic.
A model that looks reasonable in AI Studio still needs runtime testing.
Test:
Check:
Check:
Try fewer features and more historical data.
Check:
This is normal. Deploy only copies files.
Next:
.onnx fileCheck that the .fusion.json file is next to the .onnx file.
If you moved or renamed files manually, move both files together.
Possible causes:
Start by plotting the ONNX output and reviewing the mapping status rows.
Check:
If the model was trained from a specific template, use the same template when loading the ONNX block unless you deliberately know how to remap the inputs.
Check:
.onnx file is not locked or missing.fusion.json file is valid and next to the modelIf the trainer service was recently installed or repaired, restart NinjaTrader. If Windows itself requested a restart after installing runtime prerequisites, restart Windows before treating the environment as stable.
No. AI Studio trains model files. The ONNX block runs a model and outputs a value. Your Fusion Builder graph decides what to do with that value.
No. Deploy copies .onnx and .fusion.json files into the Fusion model library. You still add or select an ONNX block and browse to the deployed model.
.fusion.json?Advanced users can manually map inputs, but the normal AI Studio workflow should keep .onnx and .fusion.json together. The metadata file is what lets Fusion rebuild ports, show the model card, and compare trained inputs against live inputs.
Usually no. Start with a smaller feature set you understand. Add more only when you can explain why they belong.
Usually no. Train a simple baseline first. Tune after the target, features, deployment, and ONNX mapping all make sense.
For a first regression model, ATR-Normalized Return is often easier to reason about than raw future return because the output is scaled by recent movement. For a first classification model, Direction (3-Class) is straightforward, but watch class balance.
No. Future Volatility predicts movement size, not direction. Use it as a filter or context score.
Regime is a current-state label. It can be useful as context, but do not treat it like a future direction target. V1.0 regime test metrics can look optimistic because the regime thresholds are fit on the full captured dataset.
Yes, but only after you build downstream logic in Fusion Builder and test it. The ONNX output is just one value in the graph. Convert it into conditions, gates, entries, exits, or filters deliberately.
At minimum:
This guide reflects Fusion AI Studio and ONNX block workflows for the V1.0 launch documentation set. Last updated 2026-06-11. Labels and button names may evolve in future versions.