Does the TIMEFRAME keyword accept numeric constants only?

Forums ProRealTime English forum ProBuilder support Does the TIMEFRAME keyword accept numeric constants only?

Viewing 8 posts - 1 through 8 (of 8 total)
  • #201701

    How can I store a timeframe value in a variable?

    I have tried the following code, but it is not accepted:

    Thanks for your support.
    Walter

     

    #201702

    You should create a new topic for that really

    However I dont think you can.

    You can create a variable within a timeframe and use that, but timeframe code itself can’t be stored differently as far as I’m aware.

    Best thread is https://www.prorealcode.com/blog/learning/approach-multi-timeframe-trading-prorealtime/

     

    Generally you have to create your variables within the specified timeframes you want them in, but timeframes themselves are unable to be stored as variables… The logic of coding is to select the timeframe you want to get data from and use the variables within your code. The above thread will help to see how that can be used within the default timeframe being used.

    #206113

    Somehow I don’t think this is possible. I have written a probacktest and indicator (see attached) using 2hr, 1hr,30 minute and 15 minute timeframes. Each time I’m told to use a 5 minute timeframe because all timeframes are divisable by 5 minutes. I’ve also tried using the TIMEFRAME (default) command but alas, no joy.

    Is it possible guys?

    Many thanks in anticipation.

    #206134

    @geier777

    I created a new topic. Do not append different questions to existing topics, as suggested by Philstrading, as this would make it difficult to search the correct infos, when needed. Thanks 🙂

    As stated in the prior post, it’s not possible to use variables with the TIMEFRAME keyword.

     

    #206146

    My apologies Robert.

    While off sick today I’ve played with the probacktest and am getting entries on the 15 minute chart, however the issue I’m now having is exit of positions, for some reason the backtest is not recognising the exit conditions.

    Many thanks in anticipation.

     

    #206149
    JS

    Hi

    When I backtest your system “Bolly” on a time frame of 5 minutes then there are no problems…

    Both long and short trades…

    #206154

    good afternoon

    1st of all many thanks for your reply. The code doesn’t seem to have an issue entering trades, it is the exit criteria. trades should be exited when the hourly close hits 50 RSI?

    #206156

    It’s because of the missing UPDATEONCLOSE keyword (hence the DEFAULT keyword is assumed), as your chart will display a wrong RSI at closing time, while when the 1-hour bar is forming it happened to be in the correct range.

     

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

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