Forums › ProRealTime English forum › ProBuilder support › Indicator plotting in different time frames › Reply To: Indicator plotting in different time frames
A generic custom indicator works on any timeframe, provided it doesn’t deal with bar timings. Example that you can use on any price chart and any timeframe:
1 2 |
Sma = average[20,0](close) RETURN Sma AS "Sma" |
An indicator using more than one timeframe has to abide by the rule for Multi Time Frame support (MTF), which states that:
- the default timeframe (the one on the chart) must be the smallest timeframe among all those used in the indicator
- the other timeframes (up to 5 different TFs) must all be a multiple of the default timeframe.
Rule 2 means that if your default timeframe (the one on the chart) is, say, 5 minutes, all the aother ones must be a multiple of 5, so you can use 10, 15, 20, 25, 30-minute, 1-hour etc…, but you cannot use a 7-minute timeframe as 7 is not a multiple of 5.
That said, you can use the 1-hour timeframe on your chart and have your indicator work also on the DAILY timeframe, NOT the other way round.
Example of a custom MTF indicator:
1 2 3 4 5 6 7 |
Timeframe(Daily,UpdateOnClose) Sma = average[20,0](close) // Timeframe(default) SmaDef = average[20,0](close) // RETURN Sma AS "higher TF Sma",SmaDef AS "default TF Sma" |
it will plot 2 SMAs on your default chart (be it Daily or smaller):
- the Dailly SMA
- the default SMA (which can be the same as the Daily one if use the indicator on a Daily TF)
As to the MONTHLY (and YEARLY, as well) timeframe, it doesn’t allow to use it on a WEEKLY default timeframe, maybe this is due to the first and last week of the month belonging partially to other months, but I’m just guessing.