Multi timeframe – MTF indicators for ProRealTime

Viewing 15 posts - 76 through 90 (of 165 total)
  • Author
    Posts
  • #177689 quote
    robertogozzi
    Moderator
    Master

    This is the same one as above, that can be used in straategies:

    // Multiple TFs (example)
    //
    Timeframe(Daily,UpdateOnClose)
    sma1 = average[5,0](close)
    Timeframe(4h,UpdateOnClose)
    sma2 = average[5,0](close)
    Timeframe(1h,UpdateOnClose)
    sma3 = average[5,0](close)
    Timeframe(30 minute,UpdateOnClose)
    sma4 = average[5,0](close)
    Timeframe(15 minute,UpdateOnClose)
    sma5 = average[5,0](close)
    Timeframe(5 minute,UpdateOnClose)
    sma6 = average[5,0](close)
    Timeframe(8h,UpdateOnClose)
    sma7 = average[5,0](close)
    Timeframe(1 minute,UpdateOnClose)
    sma8 = average[5,0](close)
    Timeframe(default,UpdateOnClose)
    sma9 = average[5,0](close)
    Timeframe(Daily,default)
    sma10 = average[5,0](close)
    Timeframe(Daily,UpdateOnClose)
    sma11 = average[5,0](close)
    Timeframe(5 minute,default)
    sma12 = average[5,0](close)
    //return sma1 as "sma1",sma2 as "sma2",sma3 as "sma3",sma4 as "sma4",sma5 as "sma5",sma6 as "sma6",sma7 as "sma7",sma8 as "sma8",sma9 as "sma9",sma10 as "sma10",sma11 as "sma11",sma12 as "sma12"
    buy at  -close limit
    //
    graphonprice sma1
    graphonprice sma2
    graphonprice sma3
    graphonprice sma4
    graphonprice sma5
    graphonprice sma6
    graphonprice sma7
    graphonprice sma8
    graphonprice sma9
    graphonprice sma10
    graphonprice sma11
    graphonprice sma12
    #177692 quote
    IG_CFD_Trader
    Participant
    Average
    Tnx for that. So to understand TimeFrame keyword, why have you used the below 3 timeframes in the same code? How are they different from each other?
    Timeframe(default,UpdateOnClose)
    Timeframe(Daily,default)
    Timeframe(Daily,UpdateOnClose)
    The time frames I want to cover are:
    1 hr
    2 hr
    3 hr
    4 hr
    5 hr
    6 hr
    7 hr
    8 hr
    9 hr
    10 hr &
    11 hr
    So how do you suggest I set up the code including Default, UpdateonClose etc?
    #177694 quote
    robertogozzi
    Moderator
    Master

    Timefrane(default,UpdateOnClose) is mispelled. Actually it can be used, but UpdateOnClose is redundant with the DEAFAULT TF, as it can’t be any different, it is ALWAYS executed when a bar closes and cannot be update while that bar is forming. The difference between the two keywords is useful with its multiple TFs, which can be accessed while the bar is forming, UpdateOnClose updates variables when that bar closes, while Default updates variables when the DEFAULT bar closes (i.e. when the higher bar is forming).
    Those two with Timeframe(Daily,UpdateOnClose) are the same, I wrote them just to show that you can use that keyword multiple times in a scattered way, there’s no need for them to be in any order.
    Timeframe(Daily,UpdateOnClose) and Timeframe(Daily,Default) are different, as explained above.

    #180703 quote
    asfaxi
    Participant
    Average

    Hello

     

    Is there any way to detect the selected Timeframe, I want to display or not certain indicators according to the selected timeframe.

     

    Regards

    Ameur

    #180708 quote
    ginko
    Participant
    Average

    Amer,

    There is a function for that added in PRT v11 gettimeframe, returning the  time-frame on seconds.

    See

    GetTimeframe

    #180717 quote
    Vjper
    Participant
    Junior

    Hallo,

    vielen Dank für die Beiträge. Die neue Funktion erleichtert die taktische Vorgehensweise in der Systematik unheimlich.

    Wie würden Sie ein MACD(12,26,9)[D1] und MACD(12,26,9)[H4] und MACD(12,26,9)[H1] in einem Indikator codieren?

    Ausgabe ist ein Histogramm! 😉

    Grus Vjper

    Hi there, Thanks for the contributions. The new function makes the tactical approach in the system a lot easier. How would you code a MACD (12,26,9) [D1] and MACD (12,26,9) [H4] and MACD (12,26,9) [H1] in one indicator? Output is a histogram! 😉 Grus Vjper

    #180719 quote
    asfaxi
    Participant
    Average

    Thank you Ginko

    Very useful.

    Regards

    #180962 quote
    Nicolas
    Keymaster
    Master

    @Vjper

    See examples on how to code with MTF instructions on page 1.

    #180989 quote
    Vjper
    Participant
    Junior

    @Nicolas: Dankeschön

    #193248 quote
    druby
    Participant
    New

    Hi…

    Having a problem when backtesting with my indicator(s) which have ‘TimeFrame’ code in them.

    When using indicators as stand alone everything works fine with chart plotting what’s expected, but if I try to backtest I get error:-

    “Backtest can’t start because of a parsing error in the code:     line 1, column 0.”

    I’ve investigated the code and narrowed it down to the ‘TimeFrame’ command which ended up on line1 column 0

    Still get error with just basic code if ‘TimeFrame’ used,  which error’ed  on line1 column 0.

    All errors point to a line/column where the ‘timeFrame’ command is

     

    Can someone verify if you can backtest with indicator’s using the ‘TimeFrame’ command .

    #193251 quote
    Nicolas
    Keymaster
    Master

    You will not be able to do that. Create indicators for one single timeframe and use TIMEFRAME instructions directly into the ProBacktest code.

    druby thanked this post
    #194060 quote
    Jodal
    Participant
    New

    Hi everyone,

    How can I display the SMA of a given timeframe ON THE GRAPH of a lower timeframe?
    For instance, I want to display the SMA20 100 ticks on the 50 ticks chart.

    Please see attached a screenshot, I can only get in in a separate  panel.

    Here is the code I used (sorry I could not find how to add it in the specific PRT code window)

    TIMEFRAME(100 ticks, UPDATEONCLOSE)
    ind=Average[20](close)
    return ind

    Thank you!

    #194209 quote
    Jodal
    Participant
    New

    Hi everyone,

    How can I display the SMA of a given timeframe ON THE GRAPH of a lower timeframe?

    For instance, I want to display the SMA20 100 ticks on the 50 ticks chart.

    Please see attached a screenshot, I can only get in in a separate panel.

    Here is the code I used (sorry I could not find how to add it in the specific PRT code window)

    TIMEFRAME(100 ticks, UPDATEONCLOSE)

    ind=Average[20](close)

    return ind

    Thank you!


    @robertogozzi
    @Nicolas, do you guys know by any chance?

    #194212 quote
    Nicolas
    Keymaster
    Master

    Add the indicator on the price chart, see how: How to add an Indicator On Price

    Jodal thanked this post
    #194214 quote
    Jodal
    Participant
    New

    Hi Nicolas,

     

    Thanks a lot for your time!

Viewing 15 posts - 76 through 90 (of 165 total)
  • You must be logged in to reply to this topic.

Multi timeframe – MTF indicators for ProRealTime


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Nicolas @nicolas Keymaster
Summary

This topic contains 164 replies,
has 53 voices, and was last updated by PeterSt
9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/27/2020
Status: Active
Attachments: 49 files
Logo Logo
Loading...