STF - Symbol and Timeframe
Concept diagram
The concept diagram provided below depicts the function block associated with this page.
Symbol to trade
The Expert Advisor Builder provides several options for specifying the symbol to calculate internal values and managing features like stop loss trailing for open trades. The most functional blocks, such as signal generators and order management, have their symbol selector - for example, the input parameter > (INA1) CONF, Symbol for Indicator A1. By default, these input parameters are set to CURRENT, which refers to the input parameter > (STF) Symbol for 'CURRENT'. If this parameter is also set to CURRENT, it finally refers to the actual chart in which the trading module is executed, for example, EURUSD.
If you want to use a different symbol for the indicator calculation, you can either change > (INA1) CONF, Symbol to any symbol shown in your market watch or change the main selector > (STF) Symbol for 'CURRENT'. Modifying > (INA1) CONF, Symbol will cause only the INA1 indicator to use a different symbol, such as USDCAD, while all other functional blocks will still use CURRENT. Modifying > (STF) Symbol for 'CURRENT' will cause every functional block configured with CURRENT for a symbol parameter to use the new symbol.
Input variable within MetaTrader (Identifier in SET file) | Default value | Comment |
---|---|---|
> (STF) Symbol for 'CURRENT' (IN_strStfSymbol) | CURRENT | Any symbol from the market watch is selectable. The input value cannot be empty. |
Thus, the input parameter in the table above serves as the main switch to select the symbol source, but only when the individual symbol selectors have configured CURRENT as their symbol names. For example, you can create trading modules that operate on a EURUSD chart but use USDCAD as the source for calculating its indicator values. This cross-symbol behavior is demonstrated in the examples below.
To reproduce the chart from above, you can download and use the SET file package um_eab_cstf_2_v_2_0.zip.
Please note that only the MetaTrader 5 strategy tester can open and simulate trades across multiple symbols. If you intend to create a trading idea based on multiple symbols, use the MetaTrader 5 version of the Expert Advisor Builder.
Timeframe to trade
The process of selecting the timeframe is similar to the symbol selection process. Most functional input groups contain a timeframe selector. For instance, > (INA1) CONF, Timeframe can be used to determine the timeframe for calculating the Indicator A1 values.
If you want to use a different timeframe for the internal calculation, you can either change > (INA1) CONF, Timeframe, or change the main selector > (STF) Timeframe for 'CURRENT'. Modifying > (INA1) CONF, Timeframe will cause only the INA1 indicator to use a different timeframe, such as H1, while all other functional blocks will still use CURRENT, which could be M15. Modifying > (STF) Timeframe for 'CURRENT' will cause every functional block configured with CURRENT to use the selected main timeframe.
Input variable within MetaTrader (Identifier in SET file) | Default value | Comment |
---|---|---|
> (STF) Timeframe for 'CURRENT' (IN_enmStfTimeframe) | CURRENT | Numeric values usable in SET files: -2 - CURRENT 0 - M1 1 - M5 2 - M15 3 - M30 4 - H1 5 - H4 6 - D1 7 - W1 8 - MN |
Thus, the input parameter shown in the table above serves as the main switch to select the timeframe, but only when the individual timeframe selectors have configured CURRENT. For example, you can create trading modules that operate on an M15 chart but use H1 as the timeframe for calculating its indicator values. This multi-timeframe behavior is demonstrated in the examples below.
To reproduce the chart from above, you can download and use the SET file package um_eab_cstf_3_v_2_0.zip.