I have created an indicator myself to be plotted together with price. This indicator requires calibrating some parameters (i.e. moving averages, ATR, etc) and I have done that using a Monthly prices chart.
With the monthly chart calibration, Would it be possible to plot the indicator in a weekly or daily price chart, but calculated using the parameters derived from its calibration in a monthly time frame? I mean, if the number of periods for a given average is 4 months, I want PRT to take 4 months instead of 4 weeks although I am using a weekly chart. I assume this is going to give constant values for a given month, but I am curious about whether this would be feasible to be done in PRT.
If so, Is there any code I should add to the indicator’s script to make any adjustment?
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)
RETURNSmaAS"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.
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.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue