Wrong Percentage Calculation

Forums ProRealTime English forum ProBuilder support Wrong Percentage Calculation

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

    I wrote a simple indicator to show what percentage the body of a candle is compared to the total range but I’m getting some rogue percentages as the data for some candle is showing their range to be smaller than the candle body – which is impossible. Why is this?

    #50159

    Your code is fine. This is obviously an error in the data stream. Was this on an demo account?

    #50160

    Try replacing line 8 with:

    IF BodyPerc < 75 THEN

    Sorry for not being able to insert PRT code from My smartphone.

    #50162

    Despair – No this was a live account – I gave up on demo account data a long time ago!

    RobertoGozzi – Line 8 is just about colour choice and nothing to do with the calculation.

    The screenshot shows the fault in the high low close and open values that lead to the bad calculation. There are several of these over the years. Makes coding a strategy a little difficult if the data stream is rubbish!

     

    #50170
    AVT

    just a quick idea: abs(high-low)

    #50171

    Thanks for the suggestion AVT but a high will always be higher than a low so the result will always be a positive from (high-low). The fault is in the data supplied from IG/PRT as if you check the numbers in the cursor details panel shown in the image the range is smaller than the body of the candle, which is impossible.

    1 user thanked author for this post.
    avatar AVT
    #50172

    High-Low cannot be negative, so using ABS() would not affect the outcome.

    1 user thanked author for this post.
    avatar AVT
    #50174
    AVT

    Damned guys, you’re right !! – already too late in the evening

    #50175

    Are the wrong ones you found only sundays like the one in your attached graph? If yes, at least it would be contained to the usual sunday night data issue, rather than affecting normal week days… If no it might be worth graphing the day close in smaller timeframe and check for the instrument you look at where actual day close is relative to midnight, problem being with 24h dataflow that open and close might not be sctritly “on the same day” and generate weird stuff if high and low are on the same day…

    #50183

    No they are not all Sundays. Screenshot attached of a particularly bad period in 2003. Not sure how that data could be used for making decisions on when to trade if you can’t trust the basic data of high, low and open,close to be correct.

    #50194

    I think you should report this to PRT. If you write a ticket directly via the platform you can even select data-errors.

    #50210

    Report sent.

    1 user thanked author for this post.
    #50254

    I run it on DAX 1-hour TF and everything worked fine, but not as fine when I run it on a Daily and 4-hour TF, so I think the problem is the one Noobywan talked about, that is candles across the end of the day.

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