QuantiX Pro Help

Feature Analysis

What is Feature Analysis

A feature is any data point that provides information about a candle based on itself or previous candles. Common features include Open, High, Low, Close, and Volume. Indicators are also considered features.
When you use processing functions of QuantiX to generate labeled data columns, you are creating features. Targets are not features because they rely on data from future candles rather than the current or past candles.
There are two types of features:
1. Numeric Features: These are features that have numerical values, such as RSI, MACD, Bollinger Bands, etc.
2. Categorical Features: These features use labels instead of numerical values. Examples include rsi_strategy and k_d_cross.
Note that features are different from signals. Signals are derived from features and are used to trigger actions in backtests.

In this tutorial, we use the same dataset as the Signal Analysis tutorial, which is the first tutorial in the Advanced series. If you haven’t read the Signal Analysis tutorial yet, we recommend going through it first before proceeding with this one.
Additionally, the test range and assets under test remain the same as those used in the Signal Analysis tutorial.

How to use Feature Analysis

Feature analysis enables you to examine both numeric and categorical features in relation to numeric and categorical targets. To use this tool, you need to configure the following settings:

  1. Market Data: Select the market data where the features are defined.

  2. Pair(s): Choose the pair(s) to include in the analysis. Ensure that you have sufficient data for accurate results.

    • In this tutorial, we use the data of Apple and Microsoft.

  3. Timeframe: Select the timeframe for the analysis.

    • In this tutorial, we use a 15-minute timeframe.

  4. Start Date: Define the starting date for the analysis period.

  5. End Date: Define the ending date for the analysis period.

Just like features, targets are also classified into two types:
1. Numeric Targets: These targets have numerical values, calculated based on future candles.
2. categorical Targets: These targets assign labels to candles, typically Buy, Sell, or No-Action, based on future price movements.
Note that categorical targets are derived from numeric targets through processing.
In this tutorial, we use the following targets:

  • Rally-based rating

  • Rally-based classifying.

Both targets use a window size of 100, and for Rally-Based Classifying, the Buy and Sell thresholds are set to 0.25.

Feature Analysis for Numeric Targets

To perform feature analysis on numeric targets, we first need to define a numeric target.
In this tutorial, we use Rally-Based Rating as the numeric target, with a window size of 100.
When analyzing numeric targets, you can include a maximum of two features in the analysis at a time.

One Numeric Feature

When analyzing a single feature, the report is either a bar chart or a histogram.

  • For numeric features, the output is a histogram where:

    • The X-axis represents intervals of feature values.

    • The Y-axis represents the mean target values.

Below is an example of resulting histogram of Feature Analysis using Rally-Based Rating (window size: 100) with RSI as the selected feature.

drawing

As seen in the figure:

  • The X-axis represents different RSI ranges.

  • The Y-axis represents the mean values of the target.

The chart suggests that as RSI increases, the target values also increase. This is expected because:

  • Higher rally-based rating values typically occur near high pivots in price.

  • Rally-based rating is designed to be high near high pivots and low near low pivots.

Two Numeric Features

This time, select RSI and K values of the Stochastic.

drawing

As shown in the graph, both the X-axis and Y-axis are divided into intervals representing different ranges of RSI and K values, respectively. Each cell in the heatmap displays the mean target value for a specific combination of RSI and K ranges.
This analysis aligns with traders' market perceptions. When both RSI and K values are near their minimums, it indicates that prices are close to their low pivots, suggesting a potential buying opportunity. Conversely, when both values are high, it signifies the end of an upward rally.

One Categorical Feature

When analyzing one categorical feature, the report presents a bar chart displaying the mean target value for each label. The figure below illustrates the mean target values for different labels in the stoch_cross column.

drawing

Two Categorical Features

When two categorical features are analyzed, both chart axes represent different feature labels. As a result, a grid is created, where each sector represents a combination of feature labels. For each sector, the mean target value is displayed.
The figure below illustrates this analysis for rsi_strategy and stoch_cross.

drawing

From the visualization, we observe that the highest average target values occur when RSI is overbought and Stochastic is in a cross-over condition, aligning with traders' market perceptions. Conversely, the lowest mean target values are seen when RSI is oversold and Stochastic is in a cross-under condition, further reinforcing traders' market interpretations.

One Numeric One Categorical Feature

When a categorical and a numeric feature are analyzed together, the X-axis represents intervals of the numeric feature, while the Y-axis displays the labels of the categorical feature. The figure below illustrates this relationship using RSI (numeric) and stoch_cross (categorical) as features.

drawing

Feature Analysis for Categorical Targets

In this tutorial, we use Rally-Based Rating with a window size of 100 as the categorical target. The buy and sell thresholds are both set to 0.25.
For numeric targets, the analysis allows a maximum of two features to be included at a time.

One Numeric Feature

When a single numeric feature is analyzed, the Feature Analysis report displays the precision of different value ranges for each target label.
The figure below illustrates the precision of various RSI ranges for the buy, sell, and no-action classes.

drawing

Additionally, if you hover over the bars in the chart, you can also view the recall values for each range.

Two Numeric Features

When analyzing two numeric features, both axes represent ranges of the selected features. Each sector of the graph displays the precision of different classes.
For each target label, a separate graph is generated. Additionally, by hovering over the sectors of the graphs, you can also view the recall values.
The figures below illustrate these graphs for the target labels used in this analysis: buy, sell, and no-action.

drawing
drawing
drawing

One categorical Feature

When a categorical feature is analyzed, two graphs are generated.

  • The first graph displays the precision and number of occurrences for each label across the target classes.

drawing
  • The Second report is a bar graph where he X-axis represents the labels of the categorical feature and the Y-axis shows the precision of each class.

drawing

Categorical Features

When the target is categorical, there is no limit to the number of categorical features you can include—as long as no numeric feature is used.

  • You can select multiple categorical features and run the analysis.

  • The result will be an interactive chart, allowing you to explore different combinations of the selected features.

  • Use the select box in the top-left corner of the graph to choose the features you want to analyze. The graph will update automatically.

The output follows the same format as the first report in the One Categorical Feature analysis.

drawing

In this graph, each sector represents a specific combination of categorical feature labels.

  • The label for each sector is displayed in the top-left corner of that section.

  • For example:

    • The orange sector labeled "overbought" includes all candles where the stoch_condition column has the overbought label.

    • Another orange sector labeled "normal" represents candles where both the stoch_condition and RSI are in the overbought state.

One Numeric One Categorical Feature

The output of this report follows the same format as the Two Numeric Features analysis.

  • The X-axis represents intervals of the numeric feature.

  • The Y-axis displays the labels of the categorical feature.

  • A separate graph is generated for each target label.

The figures below illustrate the analysis using RSI (numeric feature) and stoch_condition (categorical feature).

drawing
drawing
drawing

Last modified: 10 March 2025