Tutorial 2: Targets
Targets are mathematical operations that utilize future information to assign a number or label to a candle. Based on their outputs, targets can be categorized into two main types:
Numerical Targets: Targets that return numerical values are called numerical targets.
Categorical Targets: Targets that return labels are categorical targets.
Targets are designed to quantify the future behavior of the market for each candle. Since targets require future information, they cannot directly be used for trading. However, they are valuable for statistical analysis in strategy development. Beyond serving as performance metrics, targets can also be utilized to create trading strategies using machine learning techniques.
While numerical targets return numerical values, categorical targets typically return two or three labels to represent the future performance of candles. Note that categorical targets are derived from numeric targets.
In this tutorial, we will focus exclusively on the targets available on our platform and their specifications.
To use targets, you first need to add them to your market data.
Open the Market Data menu and click on My Market Data.
In the market data table, go to Actions and select the Edit option to open the editing page.
Click on Add Target to add new targets to your market data.
In the following sections, we briefly introduce the available targets on our platform. To learn more about these targets, please refer to the Target Documentation.
Categorical Targets
Categorical targets assign buy, sell, and no-action labels to a candle based on future prices. Our platform offers five categorical targets:
Rally Based Classifying
Stop Loss-Take Profit Based Classifying
Reward/Risk Based Classifying
Positive Momentum Classifying
Rally Based Classifying
Rally-based classifying uses pivots to find rallies. In each rally, candles closest to the low pivot are labeled as buy, candles closest to the high pivot are labeled as sell, and the remaining candles are labeled as no-action.
To use this target:
Select Rally Based Classifying from the targets menu
Select a window size to find pivots. This target uses Pivot function to find pivots. To read more about this function, read the documentation.
Define threshold values-For example:
If the buy threshold is set to 0.2, then 20% of the candles closest to the low pivot are labeled as buy.
If the sell threshold is set to 0.3, then 30% of the candles closest to the high pivot are labeled as sell.
Remaining candles – Any candles that do not fall within these thresholds are labeled as no-action.
StopLoss-TakeProfit Based Classifying
This target analyzes future price movement for a specified number of candles to determine whether a stop loss or take profit order is triggered within a specified time window.
If the price hits stop loss before the take profit, the candle is labeled as SL.
If the price hits the take profit before the stop loss, the candle is labeled as TP.
If neither order is triggered within the given time window, the candle is labeled as NA.
To use This target:
Select Stop Loss-Take Profit Based Classifying from the target menu.
Set the Look Ahead Window Length-Define the number of future candles the target will analyze to determine whether the price hits the stop loss or take profit.
Configure Stop Loss and Take Profit Percentage:
Take Profit Percentage: Defines the required price increase to trigger take profit.
Example: If set to 3%, the price must rise by at least 3% from the candle's price to hit the take profit.
Stop Loss Percentage: Defines the required price drop to trigger stop loss.
Example: If set to 5%, the price must decrease by at least 5% from the candle's price to hit the stop loss.
Reward/Risk Classifying
Thr Reward/risk target classifies candles based on the ratio of maximum gain to maximum loss. For a given window size of 1000, if the maximum price draw-up is 5 percent and the maximum price draw-down is 1 percent, then the reward-to-risk ratio is 5/1 which equals 5. Similarly, the risk-to-reward ratio is 1/5.
To use this target:
Select Reward/Risk Classifying from the target menu.
Set the window size using Look Ahead Window Length.
Define the threshold for sell candles using Risk/Reward Ratio For Sell Label. If risk-to-reward ratio exceeds this threshold, the candle is labeled as sell.
Define the threshold for buy candles using Reward/Risk Ratio For Buy Label. If reward-to-risk ratio exceeds this threshold, the candle is labeled as Buy.
Positive Momentum Classifying
Positive momentum is calculated as the ratio of the area under the curve of positive candles to the total area under the curve of both positive and negative candles.
Positive candles are those with higher closing prices than the reference candle for which positive momentum is being calculated.
Negative candles are those with a lower closing price than the reference candle.
Positive momentum ranges from 0 to 1:
Higher values (closer to 1) indicate stronger bullish behavior within the window.
A value of 0 indicates fully bearish behavior.
A value close to 0.5 suggests a sideways market trend.
To use this target:
Select Positive Momentum Classifying from the target menu.
Set the window size using Look Ahead Window Length.
Define the classification thresholds:
If positive momentum is lower than Sell Threshold, the candle is labeled as sell.
If positive momentum is higher than Buy Threshold, the candle is labeled as buy.
If positive momentum falls between these thresholds, the candles are labeled as no-action.