Chart TIMEFRAME detection in an indicator?

Forums ProRealTime English forum ProBuilder support Chart TIMEFRAME detection in an indicator?

Viewing 9 posts - 1 through 9 (of 9 total)
  • #63645

    Hi

    I have two questions related to timeframes.

    Thanks again.

    Rob

    #63651

    TIMEFRAME statement is only available for ProScreener program. It should be used also for ProOrder, but in a future update.

    About code to detect which timeframe is the current chart, you can use this one:

     

    1 user thanked author for this post.
    #63670

    Hi Nicolas,

    Thanks for this but I’m experiencing a problem with it. Is there a workaround you can think of? I have tried calling it using CALL but I still get the error when trying to create the Donchain channel.

    Thanks again, Rob

     

    #63672

    Sorry but I don’t understand what you are trying to do with this code?

    Example: in an 1 hour timeframe, the code I gave you will return “60”. “240” in a 4 hours timeframe, etc.

    #63677

    I agree it’s a bit odd so I’ll try and explain.

    If I add this indicator to a twenty minute chart, I was hoping it would detect that it’s a twenty minute chart and simply create a 20 period Donchian channel rather than having to set the period manually.

    Try adding it and you’ll see the problem.

    #63681

    This code should work ok:

    Still don’t have understood the relationship between how much minutes in a single bar and the period of the donchian channel ❓

    1 user thanked author for this post.
    #63685

    Works perfectly, thanks again.

    #131521

    Hi Nicolas (I write in English since this topic belongs to the englishspeaking forum)

    Wondering how I could detect the timeframe to change automatically some parameters in an indicator, I began to test the code you posted on this page (I just made a copy/paste of the above code, without changing anything).

    But I get some very strange results, rather regularly(see the attached file) :for example, for the CAC40 index in 1 hr, I get 60 min (normally), but with a very regular periodicity, on the same graph, the result becomes 960, or 3840, or even 6720 and 37920 (see the attached file). There must be some bug by there !…

    Could you give a look ? Thanks in advance.

    Patrick

    #131538

    Hi Patrick

    I came across an issue with this code and managed to mess it about to get it to be constant. However, I can’t see your code so I don’t know if it will help you.

    Cheers

    Rob

    PS my changes make little sense but it worked for me, I was getting blips.

     

Viewing 9 posts - 1 through 9 (of 9 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login