Why does my indicator not work for currency?

Forums ProRealTime English forum ProBuilder support Why does my indicator not work for currency?

Viewing 4 posts - 1 through 4 (of 4 total)
  • #224135

    Hi,

    I tried to create an indicator to show a yellow rectangle around some hours of the new york session.

    i did some copy pasting from other codes, because i am new to coding. see the attatched code.

    My problem, the code works fine for ES/MES , indexes.

    But i want is also to work for currancypairs, like EURUSD, etc.

    Can anyone tell me why it is not working?

     

     

    #224139

    Hi,

    delete both lines with “round”: lines 21 and 22

    Using “round()” brings you to the closest integer. On an index quoting in thousands, rounding it doesn’t change its value a lot, but on a currency where pips are in decimals… for example EURUSD, an hh at 1.09613 when rounded would become = 1 and rounding ll = 1.09314 would make it = 1 too… so that’s a flat rectangle located at 1, which is why you couln’t see anything.

    Code will work without these 2 lines.

    1 user thanked author for this post.
    #224140

    Thanks a lot, you are my hero! 😉

    #224431

    Can someone help me with the following please: is it possible to see the rectancle during the session?

    Now you only see the rectangle in hindsight.

    I know it has to do with “if time > endtime then” but i tried different this, but no results….

    Thanks in advance!

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

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