full candle %

Viewing 8 posts - 1 through 8 (of 8 total)
  • #138656

    Created an indicator showing how much of a candle = the body of the candle, but im getting some weird results, 99% of the candles look correct, but im getting some that are above 100% which shouldnt happen. Would love some help as to why this is happening.

     

     

    #138658

    Nevermind i think i have solved it myself by adding this to the code:

     

    I think what went wrong is that when open = close then it got buggy..

    #138661

    Lines 2-6 can be written in just one line:

     

    #138665

    Lines 2-6 can be written in just one line:

    Could you explain how the abs piece of code replaces mine? 🙂

     

    While your at it Roberto, could you help me with how to write this piece of code more simple if its possible?

     

     

    #138672

    Because when CLOSE > OPEN you have, say, 100, while when CLOSE <  OPEN you have -100. ABS() is a function that converts negative numbers into positive numbers, so the result will always be positive (which is what you need).

    The answer to the second question is:

     

    #138673

    ABS just returns everything as a positive value so it does not matter if close is higher or lower than open.

    Answer to second question:

     

    #138674

    Too fast again Roberto!

    1 user thanked author for this post.
    #138677

    Thank you Vonasi and ROberto 🙂

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

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