Problem with condition

Forums ProRealTime English forum ProOrder support Problem with condition

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

    I have a strange problem. I want my condition to be true if a moving average goes flat (sideways). So i have something like:

    When i run the code the condition obviously never comes true since i remains zero all the time. Anyway when i look at the graphed variables the backtest shows many periods when ema=ema[1]. How can this be? Is that maybe that PRT intern calculates the emas with more than 5 digits and then cuts off the last digits when graphing them? This way there is a tiny difference between ema and ema[1] though graph shows the same value for them?

    This takes me to the question, with how many digits behind the comma is PRT calculating?

    #40355

    Obviously there is a problem with hidden digits. PRT shows 5 digits but internally it must calculate with more digits. Does anybody know with how many?

    #40374

    Which TF did you use?

    I your assumption might be possible for very low TF’s, say 1 minute or lower, I think it would be extremely odd to have EMA’s matching the first 5 digits in a, say, 4-hour TF!

    #40381

    I was using 5 minute TF. And it is definitely th case with some hidden digits. When you graph the variables it comes back sometimes as “0” and sometimes as “-0.00” so obviously there is something going on one doesnt see (again!).

    #40392

    I had to modify your code as follows to be executed:

    I run it on DAX 5-min TF and it was executed regularly, I found a match on Friday July 7th at 09:35 (gmt +2), as from the picture.

    Variable i was set at 11, so there must have been 10 matches before.

    Prices seem regular with the full 5 digits + 5 decimal digits.

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