Issues with Time Functions in ProBackTest

Forums ProRealTime English forum ProOrder support Issues with Time Functions in ProBackTest

Viewing 5 posts - 1 through 5 (of 5 total)
  • #23326

    Dear all.

    im fairly new to this but im trying to code an opening range breakout strategy. I use the South Africa Top 40 and the opening range is during the 08h30 and 09h00.

    i use the following code to establish the opening range highs and lows:

    if time<=090000 and time>083000 then

    maxi= highest[6] (high)
    graph maxi as “maxi”
    mini= lowest [6] (low)
    graph mini as “mini” //i graph only to check if the code is accute when compared to the graphs
    ORANGE = Maxi-mini//opening range
    LTL = maxi+Orange*fudge1/100//Long trade line (LTL) with a margin of safety factor defined as fudge1 for long trades
    STL = mini-Orange*fudge2/100//Short trade line (STL) with a margin of safety factor defined as fudge2 for short trades

    ENDIF

    My problem is that when I look at the system indicators that i graph for LTL and STL it seems as if the code starts calculating these values from 08h15 as opposed to 08h30. I attach a screenshot indicating how the above code which is only supposed to start looking for highs and lows at the specified times starts to allocate high and low values at 08h15.

    Has anyone else encountered this. I have gone through my code so many times, inserted checks to see what could cause it but to no avail. Any ideas?

    regards,

    Wicus

     

     

    #23329

    sorry, one more thing. it also then stops assigning high and low values at 08h45 and not 09h00.  so my opening range per the system is the highs and lows between 08h15 and 08h45 and not the ones between 08h30 and 09h00 as it should be. any assistance or ideas would be appreciated.

    #23340

    To get accurate high/low price levels between 2 hours, you should use this kind of code instead:

    https://www.prorealcode.com/blog/video-tutorials/create-breakout-box-2-hours/

    #23444

    Thanks, Nicholas.

    it seems when i write the code as an indicator and overlay it on the pricechart it works fine. it is strange however that if i use the same code as part of the code for pre-order for automated trading and backtesting it still seems to start and end the allocation of the opening range 15mins early. i will see how i can incorporate the user created indicator in the code in proorder to see if it works.

    thanks again.

    #23461

    i have now managed to incorporate the indicator into the code in pro-order. i show a screenshot of the indicator on the price chart and then i graph the same indicator outputs from the pro-order code. See how they differ the minute they come out of proorder. like clockwork it moves all the calcs for the opening range earlier by 15 mins.

    the indicator on the price chart is correct and the variables plotted above it are the ones from the code. ORL is fine, but on this day the 08h25 high was higher than the other and this is the ORH value. it stopped at 08h45 and missed the real opening range high which was the high of the 08h55 candle.

    has anyone else encountered this and if so any thoughts on what could be causing this. i now know it is not the code but possibly a setting in PRT or similar. any thoughts

     

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

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