ProBacktest: strange behavior

Forums ProRealTime English forum ProOrder support ProBacktest: strange behavior

Viewing 13 posts - 1 through 13 (of 13 total)
  • #103032

    Hi guys.
    I have written here some lines of code that I believe generate abnormal behavior.
    This is the program.

    The attached figure shows the value of the variables I am monitoring at the first candle.

    The instrument is the bund (CFD) with time frame at one hour.

    My question is:
    why isn’t the division by zero error reported?
    If we look at the code, the variable M, initially, is zero.
    Thus, the PP variable should have the denominator at zero. However, the system does not report it.
    Why?

    Thank you.

    #103034

    On the first run through the code PP and VP are zero divided by zero. Perhaps zero divided by zero is an acceptable calculation whereas one divided by zero is not?

    #103036

    M is equal to Close at first run because of line 4.

    #103039

    M is equal to Close at first run because of line 4.

    Ooops. Missed that important bit. So the calculation is (close – close) / close and so there is no division by zero.

    The wine I’m drinking must be even cheaper than the wine Nicolas is drinking!

    #103040

    Dunno about the price but it’s untasteful. 😆

    #103050

    Sorry, you’re right: it’s not a division by zero just because of the line of code number 4.

    Obviously the wine I’m drinking is the worst! 🙂

    #103064
    About to see the value contained in a given variable, by means of the “graph” instruction, I was wondering:
    why the PP variable is not shown?
    Initially I thought it could be due to some limitation of the “graph” instruction.
    In the manual I have concerning ProBacktest and ProOrder (version 5.1.3 – 20170718) there is written in a note on page. 35, in fact, that up to 5 variables can be simultaneously displayed on the same graph.
    However, referring to the online documentation concerning the v. 10.2 of ProRealTime, traceable to this link:
    https://www.prorealcode.com/documentation/graph/

    no limitation is mentioned.

    And besides, in the image previously posted, the value of 6 variables is displayed.

    Investigating even more on this question, I also observed that the value of the PP variable is displayed starting from the candle at 13:00 on 16 September 2016 (I remember, for those wishing to replicate this situation, that the instrument is the Bund (CFD ) time frame 1 hour, 10,000 units) as illustrated by the image I attach here.

    I can’t understand the reason. Some idea?
    Thank you.

    #103067

    I realized, only now, that with the last question I have crossed the boundaries of the thread (defined by the title of the thread itself).
    Do I ask the moderators, therefore, that it is necessary to open another thread with a more appropriate title and relevant theme?
    Sorry, in all ways.

    #103071

    I don’t know what version you have.

    I have v10.3 and it allows unlimited variables with GRAPH e GRAPHONPRICE 0n Demo accounts, while only 5 are allowed on Real accounts.

    #103072

    Yes, I also have version 10.3. In this case the problem encountered remains (failure to display the PP variable)
    Thanks Roberto.

    #103073

    There are two other problems in the code. Or, at least, they seem so to me.

    1. Why – again at the first candle – the value of the variable M is equal to zero?
    If we follow the code we can see that in row 4 the variable M is given the value of the close of the candle (16504.7).
    The PP variable to which the zero value is assigned is then calculated. Then, to the logical variable NP, the value zero (false) is assigned: this because PP is not greater than or equal to p (0.01). Therefore the cycle reported on lines 10-13 cannot be executed and, therefore, the variable M must remain at the value it had previously taken (16504.7).
    From that line to the end of the program there is no longer any instruction that can cancel the value of M. But then, why is this null?
    2. Why does the variable L, always after the first candle, take the value of 16450.1?
    On line 15 there is an instruction that assigns to L the value of the close of the candle (16504.7). Then the cycle is executed (lines 16-18) which assigns to L the minimum value between L and the close. Therefore, the variable L should not change its value.
    Subsequently the variables VP and NV are calculated and, by reason of their values, the cycle on lines 23-26 is not executed.
    But then, why does L take on this value?

    #103110

    On the same day and hour I can see ALL variables, you need to use your mouse to shrink windows 1 & 2 and enlarge window 1 then reducing its scale as much as possible (you should almost see a flat line for variables).

    #104309

    I followed your suggestions and got the desired result. With a small difference, as can be seen from the attached image (the seventh variable, L, is not aligned with the others), but irrelevant.
    Thanks Roberto.

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

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