indicator width depending on code

Forums ProRealTime English forum ProBuilder support indicator width depending on code

Viewing 2 posts - 1 through 2 (of 2 total)
  • #211951

    I’m trying to code an indicator where the width depends on a condition. As a simply example use a pair of moving averages, e.g. MA20 and MA200.
    – if MA20 >MA200, I want the width of MA20 to be 2,
    – if MA20 < MA200, I want the width of MA20 to be 1.

    Problems:
    – RETURN MA20 COLOURED (255,0,0) style(line, 2) only accepts numbers, not code variables (e.g. style(line, x))

    I thought of a workaround of plotting an indicator 2x, once with width 1 and once with width 2 (if a condition is met with width 2, otherwise invisible),
    – but the transparency alpha in “colored by (r,g,b,alpha)” does not allow two different values.

    Any idea how this could be fixed?

    Thank you.

    #211975

    Hello,

     

     

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

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