Example with CA2
On this page, you can explore an example that utilizes the chart analyzer submodule CA2. Please note that this example is intended solely for educational purposes and does not purport to be a ready-to-use trading strategy. A functional trading strategy always requires appropriate adjustments to the underlying symbol and timeframe. However, this example can be a foundation for building your trading strategy using the chart analyzer's signal generation. Each step in the example is accompanied by a chart displaying the resulting output and the necessary input parameters to replicate the example chart.
Concept diagram
The concept diagram provided below depicts the function block associated with this page.
Related input parameters
The table below lists all input parameters associated with the chart analyzer submodule CA2. While numerous parameters exist, only a few must be configured and understood for successful signal generation. Please refer to the relevant article in the user manual for a comprehensive guide on configuring a chart analyzer.
Input variable within MetaTrader (Identifier in SET file) | Default value | Comment |
---|---|---|
> (CA2) CONF, Signal in use (IN_enmCa2SignalInUse) | OFF | The configuration article explains the meaning and usage of each input parameter. |
> (CA2) CONF, Signal visualization (IN_enmCa2SignalVisualization) | OFF | |
> (CA2) CONF, Symbol (IN_strCa2Symbol) | CURRENT | |
> (CA2) CONF, Exclusion (HH:MM:SS-HH:MM:SS) (IN_strCa2Exclusion) | 00:00:00-00:00:00 | |
> (CA2) CONF, Timeframe (IN_enmCa2Timeframe) | CURRENT | |
> (CA2) CONF, Shift (IN_nCa2Shift) | 0 | |
> (CA2) CONF, Width (IN_nCa2Width) | 200 | |
> (CA2) CONF, Prominence (IN_dCa2Prominence) | 0.1 | |
> (CA2) CONF, Breakout factor (IN_dCa2BreakoutFactor) | 1.0 | |
> (CA2) CONF, Mid vola min swings (IN_nCa2MidVolaMinSwings) | 6 | |
> (CA2) CONF, Mid vola min ROC (IN_dCa2MidVolaMinROC) | 0.003 | |
> (CA2) CONF, Mid vola min filled (IN_dCa2MidVolaMinFilled) | 7.0 | |
> (CA2) CONF, High vola min swings (IN_nCa2HighVolaMinSwings) | 9 | |
> (CA2) CONF, High vola min ROC (IN_dCa2HighVolaMinROC) | 0.0045 | |
> (CA2) CONF, High vola min filled (IN_dCa2HighVolaMinFilled) | 9.0 | |
> (CA2) CONF, Draw base (IN_enmCa2DrawBase) | ON | |
> (CA2) CONF, Draw extrema (IN_enmCa2DrawExtrema) | ON | |
> (CA2) CONF, Draw sup res (IN_enmCa2DrawSupRes) | ON | |
> (CA2) CONF, Draw swing phase (IN_enmCa2DrawSwingPhase) | ON | |
> (CA2) CONF, Sup res for limits (+A;-B;-C;+D, ALL, NONE) (IN_strCa2SupResForLimits) | ALL | |
> (CA2) CONF, Stop loss multiplier (IN_dCa2StopLossMultiplier) | 1.0 | |
> (CA2) CONF, Take profit multiplier (IN_dCa2TakeProfitMultiplier) | 1.0 | |
> (CA2) COND, Regression angles min (IN_dCa2RegressionAnglesMin) | -25000000.0 | |
> (CA2) COND, Regression angles max (IN_dCa2RegressionAnglesMax) | 25000000.0 | |
> (CA2) COND, Trade volatility low (IN_enmCa2TradeVolatilityLow) | ON | |
> (CA2) COND, Trade volatility middle (IN_enmCa2TradeVolatilityMiddle) | ON | |
> (CA2) COND, Trade volatility high (IN_enmCa2TradeVolatilityHigh) | ON | |
> (CA2) COND, Trade swing phase overstatement (IN_enmCa2TradeSwingPhaseOverstatement) | ON | |
> (CA2) COND, Trade swing phase understatement (IN_enmCa2TradeSwingPhaseUnderstatement) | ON | |
> (CA2) COND, Trade swing phase over correction (IN_enmCa2TradeSwingPhaseOverCorrection) | ON | |
> (CA2) COND, Trade swing phase under correction (IN_enmCa2TradeSwingPhaseUnderCorrection) | ON | |
> (CA2) COND, Trade swing phase upswing (IN_enmCa2TradeSwingPhaseUpswing) | ON | |
> (CA2) COND, Trade swing phase downswing (IN_enmCa2TradeSwingPhaseDownswing) | ON | |
> (CA2) COND, Trade swing phase undefined (IN_enmCa2TradeSwingPhaseUndefined) | ON | |
> (CA2) COND, Current swing angle min (IN_dCa2CurrentSwingAngleMin) | -25000000.0 | |
> (CA2) COND, Current swing angle max (IN_dCa2CurrentSwingAngleMax) | 25000000.0 | |
> (CA2) COND, Current swing pos min (IN_dCa2CurrentSwingPosMin) | 0.0 | |
> (CA2) COND, Current swing pos max (IN_dCa2CurrentSwingPosMax) | 1.0 | |
> (CA2) COND, Swing A number (0 = OFF) (IN_nCa2SwingANumber) | 0 | |
> (CA2) COND, Swing A height max (IN_dCa2SwingAHeightMax) | 10000.0 | |
> (CA2) COND, Swing A height min (IN_dCa2SwingAHeightMin) | -10000.0 | |
> (CA2) COND, Swing A width max (IN_dCa2SwingAWidthMax) | 10000.0 | |
> (CA2) COND, Swing A width min (IN_dCa2SwingAWidthMin) | 0.0 | |
> (CA2) COND, Swing A range height max (IN_dCa2SwingARangeHeightMax) | 1.0 | |
> (CA2) COND, Swing A range height min (IN_dCa2SwingARangeHeightMin) | 0.0 | |
> (CA2) COND, Swing A range width max (IN_dCa2SwingARangeWidthMax) | 1.0 | |
> (CA2) COND, Swing A range width min (IN_dCa2SwingARangeWidthMin) | 0.0 | |
> (CA2) COND, Swing A range upper point max (IN_dCa2SwingARangeUpperPointMax) | 1.0 | |
> (CA2) COND, Swing A range upper point min (IN_dCa2SwingARangeUpperPointMin) | 0.0 | |
> (CA2) COND, Swing A range lower point max (IN_dCa2SwingARangeLowerPointMax) | 1.0 | |
> (CA2) COND, Swing A range lower point min (IN_dCa2SwingARangeLowerPointMin) | 0.0 | |
> (CA2) COND, Swing A range left point max (IN_dCa2SwingARangeLeftPointMax) | 1.0 | |
> (CA2) COND, Swing A range left point min (IN_dCa2SwingARangeLeftPointMin) | 0.0 | |
> (CA2) COND, Swing A range right point max (IN_dCa2SwingARangeRightPointMax) | 1.0 | |
> (CA2) COND, Swing A range right point min (IN_dCa2SwingARangeRightPointMin) | 0.0 | |
> (CA2) COND, Swing X number (0 = OFF) (IN_nCa2SwingXNumber) | 0 | |
> (CA2) COND, Swing X height max (IN_dCa2SwingXHeightMax) | 10000.0 | |
> (CA2) COND, Swing X height min (IN_dCa2SwingXHeightMin) | -10000.0 | |
> (CA2) COND, Swing X width max (IN_dCa2SwingXWidthMax) | 10000.0 | |
> (CA2) COND, Swing X width min (IN_dCa2SwingXWidthMin) | 0.0 | |
> (CA2) COND, Swing X range height max (IN_dCa2SwingXRangeHeightMax) | 1.0 | |
> (CA2) COND, Swing X range height min (IN_dCa2SwingXRangeHeightMin) | 0.0 | |
> (CA2) COND, Swing X range width max (IN_dCa2SwingXRangeWidthMax) | 1.0 | |
> (CA2) COND, Swing X range width min (IN_dCa2SwingXRangeWidthMin) | 0.0 | |
> (CA2) COND, Swing X range upper point max (IN_dCa2SwingXRangeUpperPointMax) | 1.0 | |
> (CA2) COND, Swing X range upper point min (IN_dCa2SwingXRangeUpperPointMin) | 0.0 | |
> (CA2) COND, Swing X range lower point max (IN_dCa2SwingXRangeLowerPointMax) | 1.0 | |
> (CA2) COND, Swing X range lower point min (IN_dCa2SwingXRangeLowerPointMin) | 0.0 | |
> (CA2) COND, Swing X range left point max (IN_dCa2SwingXRangeLeftPointMax) | 1.0 | |
> (CA2) COND, Swing X range left point min (IN_dCa2SwingXRangeLeftPointMin) | 0.0 | |
> (CA2) COND, Swing X range right point max (IN_dCa2SwingXRangeRightPointMax) | 1.0 | |
> (CA2) COND, Swing X range right point min (IN_dCa2SwingXRangeRightPointMin) | 0.0 |
For simplicity, the table does not list each input parameter related to swing analysis. In this context, Swing X can represent Swing B, Swing C, Swing D, or Swing E.
Reset of inputs
Locate the Expert Advisor Builder application in the dropdown menu of the strategy tester settings under FEA Trading\MT4\Expert Advisor Builder 2.0 if you're using a MetaTrader 4 instance or FEA Trading\MT5\Expert Advisor Builder 2.0 if you're using a MetaTrader 5 instance. You can replicate the entire example in minutes by following the steps outlined in this article. To begin, kindly reset the strategy tester input as indicated.
The default input parameters of the Expert Advisor Builder are designed to be highly functional. This implies that not every parameter needs to be adjusted when creating a new strategy. Instead, only the differences from the default parameters need to be considered. As a result, even with minimal reconfiguration, the output strategy can be significantly different.
Signal configuration
In this example, signals will be generated using the chart analyzer submodule CA2. No other chart analyzers are required. The utilized chart analyzer is highlighted in green in the subsequent illustration.
Initially, activating the functional block by enabling the option > (CA2) CONF, Signal in use is necessary. Additional input parameters allow the trading signals produced by the submodules to be directly highlighted on the chart with vertical red lines. Since the chart analyzer does not evaluate any of its output parameters yet, a positive trading signal is generated at every bar. The input parameters required to produce the example chart are also listed in the following illustration. Please configure your strategy tester input parameters accordingly and execute a test run in visual mode. You can choose any symbol or timeframe for this.
To reproduce the chart from above, you can download and use the SET file package um_eab_cca2_4_v_2_0.zip.
Next, the signal is limited to phases when the current swing (Swing 1) is at the upper boundary of the chart analyzer, and the market is in an overstatement phase. This trading module is designed to execute short trades, so it should only open trades when the price is near a local high. The resulting chart is shown below.
To reproduce the chart from above, you can download and use the SET file package um_eab_cca2_5_v_2_0.zip.
For now, the chart analyzer generates a large number of signals. However, by further adjusting some inputs, you can filter the signals. This is achieved by analyzing the length of the current swing to ensure that the short-term momentum is not too high. Overstatements with strong momentum often lead to further price increases, so these situations are filtered out. The final signal will appear as shown below.
To reproduce the chart from above, you can download and use the SET file package um_eab_cca2_6_v_2_0.zip.
Congratulations, you have configured a chart analyzer submodule for the first time. As promised, the number of input parameters that must be configured is manageable.
Enabling of trading
Currently, the trading module only visualizes the trading signals and does not execute actual trades. This behavior is governed by the input parameter > (ORM) Operation. By changing this parameter from SHORT SIGNAL ONLY to SHORT, you instruct the trading module to open short trades whenever a trading signal appears, and no other trade is already open. As depicted below, short trades are executed. In addition to executing trades, the trading module also displays the signals using the native signal visualization of the chart analyzer submodule CA2, which is why the vertical lines have changed their color to blue.
To reproduce the chart from above, you can download and use the SET file package um_eab_cca2_7_v_2_0.zip.
Next, the example involves modifying some order manager parameters to configure the stop loss trailing method and the waiting time between two trades. This results in the trades shown in the example chart below. As you can see, the take profit is disabled, and a market-based trailing system is active, which means the resulting trades have the potential to yield larger profits.
To reproduce the chart from above, you can download and use the SET file package um_eab_cca2_8_v_2_0.zip.
As a final step, the remaining visual objects and the vertical blue lines are disabled. Despite the chart analyzer now operating entirely in stealth mode, the signals continue to be generated and utilized by the order manager.
To reproduce the chart from above, you can download and use the SET file package um_eab_cca2_9_v_2_0.zip.