Skip to main content
Version: 2.0

Example with CA1

On this page, you can explore an example that utilizes the chart analyzer submodule CA1. 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.

Chart Analyzers, Example, Concept diagram.png

The table below lists all input parameters associated with the chart analyzer submodule CA1. 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 valueComment
> (CA1) CONF, Signal in use
(IN_enmCa1SignalInUse)
OFFThe configuration article explains the meaning and usage of each input parameter.
> (CA1) CONF, Signal visualization
(IN_enmCa1SignalVisualization)
OFF
> (CA1) CONF, Symbol
(IN_strCa1Symbol)
CURRENT
> (CA1) CONF, Exclusion (HH:MM:SS-HH:MM:SS)
(IN_strCa1Exclusion)
00:00:00-00:00:00
> (CA1) CONF, Timeframe
(IN_enmCa1Timeframe)
CURRENT
> (CA1) CONF, Shift
(IN_nCa1Shift)
0
> (CA1) CONF, Width
(IN_nCa1Width)
200
> (CA1) CONF, Prominence
(IN_dCa1Prominence)
0.1
> (CA1) CONF, Breakout factor
(IN_dCa1BreakoutFactor)
1.0
> (CA1) CONF, Mid vola min swings
(IN_nCa1MidVolaMinSwings)
6
> (CA1) CONF, Mid vola min ROC
(IN_dCa1MidVolaMinROC)
0.003
> (CA1) CONF, Mid vola min filled
(IN_dCa1MidVolaMinFilled)
7.0
> (CA1) CONF, High vola min swings
(IN_nCa1HighVolaMinSwings)
9
> (CA1) CONF, High vola min ROC
(IN_dCa1HighVolaMinROC)
0.0045
> (CA1) CONF, High vola min filled
(IN_dCa1HighVolaMinFilled)
9.0
> (CA1) CONF, Draw base
(IN_enmCa1DrawBase)
ON
> (CA1) CONF, Draw extrema
(IN_enmCa1DrawExtrema)
ON
> (CA1) CONF, Draw sup res
(IN_enmCa1DrawSupRes)
ON
> (CA1) CONF, Draw swing phase
(IN_enmCa1DrawSwingPhase)
ON
> (CA1) CONF, Sup res for limits (+A;-B;-C;+D, ALL, NONE)
(IN_strCa1SupResForLimits)
ALL
> (CA1) CONF, Stop loss multiplier
(IN_dCa1StopLossMultiplier)
1.0
> (CA1) CONF, Take profit multiplier
(IN_dCa1TakeProfitMultiplier)
1.0
> (CA1) COND, Regression angles min
(IN_dCa1RegressionAnglesMin)
-25000000.0
> (CA1) COND, Regression angles max
(IN_dCa1RegressionAnglesMax)
25000000.0
> (CA1) COND, Trade volatility low
(IN_enmCa1TradeVolatilityLow)
ON
> (CA1) COND, Trade volatility middle
(IN_enmCa1TradeVolatilityMiddle)
ON
> (CA1) COND, Trade volatility high
(IN_enmCa1TradeVolatilityHigh)
ON
> (CA1) COND, Trade swing phase overstatement
(IN_enmCa1TradeSwingPhaseOverstatement)
ON
> (CA1) COND, Trade swing phase understatement
(IN_enmCa1TradeSwingPhaseUnderstatement)
ON
> (CA1) COND, Trade swing phase over correction
(IN_enmCa1TradeSwingPhaseOverCorrection)
ON
> (CA1) COND, Trade swing phase under correction
(IN_enmCa1TradeSwingPhaseUnderCorrection)
ON
> (CA1) COND, Trade swing phase upswing
(IN_enmCa1TradeSwingPhaseUpswing)
ON
> (CA1) COND, Trade swing phase downswing
(IN_enmCa1TradeSwingPhaseDownswing)
ON
> (CA1) COND, Trade swing phase undefined
(IN_enmCa1TradeSwingPhaseUndefined)
ON
> (CA1) COND, Current swing angle min
(IN_dCa1CurrentSwingAngleMin)
-25000000.0
> (CA1) COND, Current swing angle max
(IN_dCa1CurrentSwingAngleMax)
25000000.0
> (CA1) COND, Current swing pos min
(IN_dCa1CurrentSwingPosMin)
0.0
> (CA1) COND, Current swing pos max
(IN_dCa1CurrentSwingPosMax)
1.0
> (CA1) COND, Swing A number (0 = OFF)
(IN_nCa1SwingANumber)
0
> (CA1) COND, Swing A height max
(IN_dCa1SwingAHeightMax)
10000.0
> (CA1) COND, Swing A height min
(IN_dCa1SwingAHeightMin)
-10000.0
> (CA1) COND, Swing A width max
(IN_dCa1SwingAWidthMax)
10000.0
> (CA1) COND, Swing A width min
(IN_dCa1SwingAWidthMin)
0.0
> (CA1) COND, Swing A range height max
(IN_dCa1SwingARangeHeightMax)
1.0
> (CA1) COND, Swing A range height min
(IN_dCa1SwingARangeHeightMin)
0.0
> (CA1) COND, Swing A range width max
(IN_dCa1SwingARangeWidthMax)
1.0
> (CA1) COND, Swing A range width min
(IN_dCa1SwingARangeWidthMin)
0.0
> (CA1) COND, Swing A range upper point max
(IN_dCa1SwingARangeUpperPointMax)
1.0
> (CA1) COND, Swing A range upper point min
(IN_dCa1SwingARangeUpperPointMin)
0.0
> (CA1) COND, Swing A range lower point max
(IN_dCa1SwingARangeLowerPointMax)
1.0
> (CA1) COND, Swing A range lower point min
(IN_dCa1SwingARangeLowerPointMin)
0.0
> (CA1) COND, Swing A range left point max
(IN_dCa1SwingARangeLeftPointMax)
1.0
> (CA1) COND, Swing A range left point min
(IN_dCa1SwingARangeLeftPointMin)
0.0
> (CA1) COND, Swing A range right point max
(IN_dCa1SwingARangeRightPointMax)
1.0
> (CA1) COND, Swing A range right point min
(IN_dCa1SwingARangeRightPointMin)
0.0
> (CA1) COND, Swing X number (0 = OFF)
(IN_nCa1SwingXNumber)
0
> (CA1) COND, Swing X height max
(IN_dCa1SwingXHeightMax)
10000.0
> (CA1) COND, Swing X height min
(IN_dCa1SwingXHeightMin)
-10000.0
> (CA1) COND, Swing X width max
(IN_dCa1SwingXWidthMax)
10000.0
> (CA1) COND, Swing X width min
(IN_dCa1SwingXWidthMin)
0.0
> (CA1) COND, Swing X range height max
(IN_dCa1SwingXRangeHeightMax)
1.0
> (CA1) COND, Swing X range height min
(IN_dCa1SwingXRangeHeightMin)
0.0
> (CA1) COND, Swing X range width max
(IN_dCa1SwingXRangeWidthMax)
1.0
> (CA1) COND, Swing X range width min
(IN_dCa1SwingXRangeWidthMin)
0.0
> (CA1) COND, Swing X range upper point max
(IN_dCa1SwingXRangeUpperPointMax)
1.0
> (CA1) COND, Swing X range upper point min
(IN_dCa1SwingXRangeUpperPointMin)
0.0
> (CA1) COND, Swing X range lower point max
(IN_dCa1SwingXRangeLowerPointMax)
1.0
> (CA1) COND, Swing X range lower point min
(IN_dCa1SwingXRangeLowerPointMin)
0.0
> (CA1) COND, Swing X range left point max
(IN_dCa1SwingXRangeLeftPointMax)
1.0
> (CA1) COND, Swing X range left point min
(IN_dCa1SwingXRangeLeftPointMin)
0.0
> (CA1) COND, Swing X range right point max
(IN_dCa1SwingXRangeRightPointMax)
1.0
> (CA1) COND, Swing X range right point min
(IN_dCa1SwingXRangeRightPointMin)
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.

Chart Analyzers, Example, Reset of inputs.png

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 CA1. No other chart analyzers are required. The utilized chart analyzer is highlighted in green in the subsequent illustration.

Chart Analyzers, Example, Concept diagram, Block details, CA1.png

Initially, activating the functional block by enabling the option > (CA1) 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 green lines. Since the chart analyzer hasn't evaluated any of its output parameters yet, a positive trading signal is visible every moment. 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.

Chart Analyzers, Example, Signal configuration, Example chart 1.png
tip

To reproduce the chart from above, you can download and use the SET file package um_eab_cca1_4_v_2_0.zip.

Next, the signal is restricted to phases when the current swing is not at the upper or lower chart analyzer boundary. This ensures the price when opening a trade is not near a support or resistance level. Often, the price moves relatively straight between consolidation levels. Since supports and resistances are often also consolidation phases, this configuration likely produces signals only between local lows and local highs. The resulting chart is displayed below.

Chart Analyzers, Example, Signal configuration, Example chart 2.png
tip

To reproduce the chart from above, you can download and use the SET file package um_eab_cca1_5_v_2_0.zip.

Currently, the chart analyzer produces an excessive number of signals. However, by further parameterizing some inputs, you can filter the signals. To do this, the swing phase conditions allow the production of a positive signal in phases when the market is in an upswing. Please refer to the chart example below. As you can see, the signals are now significantly less numerous.

Chart Analyzers, Example, Signal configuration, Example chart 3.png
tip

To reproduce the chart from above, you can download and use the SET file package um_eab_cca1_6_v_2_0.zip.

Congratulations, you have configured a chart analyzer submodule for the first time. As promised, the number of required input parameters to be configured is manageable.

Enabling of trading

As you can observe, the chart analyzer displays a wealth of analysis data directly on the chart. For a trading module that operates in conjunction with other modules, it's beneficial to use a stealth mode. In this mode, the visual output is minimized to only the most pertinent information. Let's deactivate all output objects except for the support and resistance levels drawn in this case. This results in a much cleaner chart, as shown in the image below.

Chart Analyzers, Example, Enabled trading, Example chart 1.png
tip

To reproduce the chart from above, you can download and use the SET file package um_eab_cca1_7_v_2_0.zip.

Currently, the trading module only visualizes the trading signals and does not initiate actual trades. This behavior is controlled by the input parameter > (ORM) Operation. By changing this parameter from LONG SIGNAL ONLY to LONG, you instruct the trading module to open long trades whenever a trading signal appears, and no other trade is already open. As shown below, long trades are executed. In addition to executing trades, the trading module displays the signals using the native signal visualization of the chart analyzer submodule CA1. This is why the vertical lines have changed their color to blue.

Chart Analyzers, Example, Enabled trading, Example chart 2.png
tip

To reproduce the chart from above, you can download and use the SET file package um_eab_cca1_8_v_2_0.zip.

As a final step, the remaining visual object for support and resistance and the vertical blue lines are disabled. Even though the chart analyzer is now entirely executed in stealth mode, the order manager still receives and uses the signals.

Chart Analyzers, Example, Enabled trading, Example chart 3.png
tip

To reproduce the chart from above, you can download and use the SET file package um_eab_cca1_9_v_2_0.zip.