Docs  /  Fusion AI Studio & ONNX User Guide

Fusion AI Studio and ONNX Block User Guide

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.


Table of Contents

  1. Before You Start
  2. What AI Studio Is
  3. The Whole Workflow
  4. Step 0 – Build The Canvas And Export Evidence
  5. Step 1 – Create Or Open A Prepared Dataset
  6. Step 2 – Choose The Answer And Features
  7. Step 3 – Train Or Compare Models
  8. Step 4 – Deploy Model Files
  9. Using The ONNX Block On The Canvas
  10. How To Interpret Model Outputs
  11. Recommended First AI Studio Session
  12. Example Workflows
  13. Metrics And Model Cards
  14. Safety Rules And Common Mistakes
  15. Troubleshooting
  16. Frequently Asked Questions

Before You Start

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.


What AI Studio Is

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.

What AI Studio Trains On

AI Studio can train from:

Data SourcePlain-English Meaning
OHLCVchart price and volume rows
Fusion block outputsvalues produced by blocks on your canvas
transformed valuesnormalized, filtered, or combined values you built visually
order-flow-derived valuesorder-flow features when your chart and data support them
prepared answer columnsgenerated 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.

What AI Studio Does Not Do

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 Whole Workflow

The AI Studio workflow has four practical stages.

StageWhat You DoWhat It Produces
Build and Exportchoose chart data and canvas outputsraw evidence columns
Capturefreeze rows and generate answer columnsprepared dataset
Trainchoose one answer, choose inputs, train or comparetrained model files
Deploy and Loadcopy files, add ONNX block, wire inputslive 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.


Step 0 – Build The Canvas And Export Evidence

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.

What Export Decides

Export decides:

Plain-English rule:

Export chooses the evidence the model can use later.

Include OHLCV For Generated Targets

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.

Keep The First Dataset Simple

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.


Step 1 – Create Or Open A Prepared Dataset

AI Studio Step 1 creates or opens the prepared dataset.

A prepared dataset is a frozen snapshot of:

Create New Capture

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:

  1. reads the current Export configuration
  2. exports the selected rows and columns
  3. creates generated answer columns based on the Step 1 target settings
  4. saves the prepared dataset
  5. loads it into AI Studio

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.

Open Saved 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.

Step 1 Target Settings

AI Studio can create several generated answer families. These are the columns the model can later learn.

Target FamilyWhat It AsksOutput Style
Future ReturnWhat percent move happens over N bars?numeric
ATR-Normalized ReturnHow many ATR units up or down over N bars?numeric
Future Log ReturnWhat log-return happens over N bars?numeric
Future VolatilityHow much movement happens over N bars?numeric magnitude
Up / DownIs the future close above the current close?classification
Direction (3-Class)Is the future move down, flat, or up?classification
ATR Stop / Target RaceWhich ATR barrier is hit first?classification
Swing ReversalDoes this bar become a confirmed swing?classification
Mean ReversionDoes price move back toward a reference?numeric or score-like
RegimeWhat 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.

Horizons

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 – Choose The Answer And Features

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

Prediction Style decides the general type of model.

Prediction StyleMeaningExample
Regressionmodel outputs a numberfuture ATR return, volatility estimate
Classificationmodel outputs a class or labelup/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

Answer Column Source decides where the target comes from.

SourceMeaningNormal Use
Generated Answer ColumnsAI Studio created target columns during capturemost users
Prepared Answer Columnuse an existing column in the dataset as the answeradvanced/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

Generated Question Family chooses the built-in target family.

Examples:

Be especially careful with volatility and regime targets:

Selected Horizon

Step 1 may create several horizon variants. Step 2 chooses the one target column this model should learn.

Example:

Compare Against Other Answer Columns

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

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.

Usable Rows

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 – Train Or Compare Models

Step 3 chooses how the model is trained.

Algorithm

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 FamilyGood For
Random Foreststable first pass, noisy tabular data
Extra Treesfast tree baseline
Hist Gradient Boostingstrong built-in boosted baseline
LightGBMfast boosted tree training when available
XGBooststrong boosted tree training when available
CatBooststrong boosted tree training when available
Ridge / Elastic Netfast linear regression baselines
Logistic Regressionfast classification baseline
MLP / Neural Networknonlinear model, usually needs more care

Good first choices:

Tuning

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.

Standardize Features

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.

Model Name

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.

Safety Badge

AI Studio shows the target source mode near the training button.

Use it as a quick check:

Badge MeaningHow To Treat It
Generated targetnormal AI Studio target path
Manual/prepared targetreview carefully
Current-bar labeladvanced/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.

Start Training

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:

Train And Compare

Use comparison when you selected additional answer columns.

The comparison workflow:

  1. builds the target candidate list
  2. trains one model per candidate target
  3. records success, failure, or warnings for each run
  4. ranks successful runs by the best available held-out metric
  5. marks one result as selected for deploy

The other completed comparison models are still saved in the session output folder. They are not lost just because one row is selected.


Step 4 – Deploy Model Files

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:

FilePurpose
.onnxthe model runtime file
.fusion.jsonFusion metadata, feature order, target meaning, model card details

The Fusion model library is:

Documents\NinjaTrader 8\templates\FusionModels

Deploy Does Not Add A Block

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.

Keep The Files Together

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.


Using The ONNX Block On The Canvas

The ONNX block is how a trained model returns to the Fusion Builder graph.

The model output can then be:

Add Or Select An ONNX Block

On the Builder canvas:

  1. Add an ONNX Model block, or select an existing one.
  2. Open the block properties.
  3. Click Browse ONNX Model….
  4. Choose the deployed .onnx file from the Fusion model library.
  5. Let Fusion load the metadata and rebuild the ordered input ports.

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.

Metadata Summary

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.

Ordered Input Ports

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.

Feature Mapping Status

The ONNX block shows mapping rows that compare trained inputs against live canvas inputs.

Use the colors this way:

StatusMeaning
Greenready or exact match
Amberreview needed or waiting for wire
Redmissing source

Do not trust the model output until red rows are fixed and amber rows have been reviewed.

Apply Metadata Mapping

Use Apply Metadata Mapping to restore the trained feature order from the .fusion.json metadata.

This is useful when:

Auto Wire Exact Matches

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

Manual mapping is for advanced cases.

You may need it when:

Manual mapping requires the same discipline: the live inputs must match the trained meaning and order.

Plot The Output First

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.


How To Interpret Model Outputs

An ONNX block outputs a value. What that value means depends on the model target.

Regression Outputs

Regression models output numbers.

Examples:

TargetOutput Meaning
Future Returnestimated future return-style value
ATR-Normalized Returnestimated future move in ATR units
Future Volatilityestimated future movement magnitude
Mean Reversionestimated 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 Outputs

Classification models output a class-style value.

Examples:

TargetTypical Meaning
Up / Downone of two direction labels
Direction (3-Class)down, flat, or up
Swing Reversalswing high, neutral, or swing low
ATR Stop / Target Raceupper barrier first, neutral, or lower barrier first
Regimelow, 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 Outputs

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.

Canvas

Build or select a few feature blocks:

Export

Include:

Step 1

Use:

Horizon windows: 5,10,20

Leave specialized target families off unless you know you need them.

Step 2

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.

Step 3

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.

Step 4

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.


Example Workflows

Example 1 – Future Return Score

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

Example 2 – Direction Classifier

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

Example 3 – Volatility Filter

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

Example 4 – Regime Context

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.


Metrics And Model Cards

After training, AI Studio and the ONNX block can show model card information.

The model card may include:

Metrics Are Held-Out Historical Scores

Metrics describe how the model behaved on held-out historical rows. They are not a guarantee of live behavior.

Regression Metrics

Common regression metrics include:

MetricPlain-English Meaning
R-squarednumeric fit quality; can be weak even when sign behavior is useful
MAE / RMSEaverage size of numeric errors
Directional Accuracyhow often output direction matched outcome direction
Output Ratioratio-style summary of correctly signed vs incorrectly signed held-out output
Rank ICwhether larger outputs tended to rank with larger outcomes
Top/Bottom Quintile Spreadspread 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.

Classification Metrics

Common classification metrics include:

MetricPlain-English Meaning
Accuracypercent of labels predicted correctly
F1 Macrobalanced class-quality score across labels
MCCclass separation quality, useful when classes are imbalanced
Per-class precisionhow often a predicted class was correct
Per-class recallhow 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

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.


Safety Rules And Common Mistakes

1. Do Not Train On The Answer As An Input

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.

2. Do Not Confuse Future Targets With Live Future Data

Generated targets look forward while creating historical labels. The live ONNX block does not receive future bars.

3. Be Careful With Manual Answer Columns

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.

4. Respect Current-Bar Mode

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.

5. Keep ONNX Feature Order Correct

The ONNX model expects inputs in the trained order. If the order is wrong, the model output can be wrong.

6. Plot Before Acting

Always plot the ONNX output first. Review behavior before using it in Strategy logic.

7. Test In Simulation

A model that looks reasonable in AI Studio still needs runtime testing.

Test:


Troubleshooting

AI Studio Cannot Create The Target I Expected

Check:

Training Is Blocked Or Has Too Few Rows

Check:

Try fewer features and more historical data.

Comparison Did Not Train What I Expected

Check:

Deploy Completed But I Do Not See A Block

This is normal. Deploy only copies files.

Next:

  1. go to the Builder canvas
  2. add or select an ONNX Model block
  3. browse to the deployed .onnx file
  4. review the metadata and input mapping

ONNX Block Shows Missing Metadata

Check that the .fusion.json file is next to the .onnx file.

If you moved or renamed files manually, move both files together.

ONNX Output Is Flat

Possible causes:

Start by plotting the ONNX output and reviewing the mapping status rows.

ONNX Output Looks Different Than Expected

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.

Trainer Or ONNX Runtime Errors

Check:

If 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.


Frequently Asked Questions

Does AI Studio trade for me?

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.

Does Deploy load the model onto the canvas?

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.

Can I use an ONNX model without .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.

Should I use every available feature?

Usually no. Start with a smaller feature set you understand. Add more only when you can explain why they belong.

Should I use tuning on the first run?

Usually no. Train a simple baseline first. Tune after the target, features, deployment, and ONNX mapping all make sense.

What is the safest first target?

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.

Is Future Volatility bullish or bearish?

No. Future Volatility predicts movement size, not direction. Use it as a filter or context score.

Is Regime a future prediction?

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.

Can I use the model output in Fusion Strategy?

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.

What should I do before using a model live?

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.

← All guides