Indicator plotting in different time frames

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #246531 quote
    Jose Prx
    Participant
    New

    Hi,

    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?

    I do look forward to reading your replies.

    Thanks!

    #246551 quote
    robertogozzi
    Moderator
    Master

    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:

    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:

    1. the default timeframe (the one on the chart) must be the smallest timeframe among all those used in the indicator
    2. 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:

    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.

    Iván González thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Indicator plotting in different time frames


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Jose Prx @jose-prx Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
9 months, 1 week ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 04/29/2025
Status: Active
Attachments: No files
Logo Logo
Loading...