Moving average colour change

Forums ProRealTime English forum ProBuilder support Moving average colour change

Viewing 6 posts - 1 through 6 (of 6 total)
  • #182055

    Hi there,

    I would like to code a moving average(10 SMA) but change the colour when it points up or down. is there a way to do it in the code so I do not have to do it manually?I did search for it but didn’t find anything.

    thanks in advance, 🙂

    #182066

    A colour change is when the current candle is:

    • ascending and the previous one was descending;
    • descending and the previous one was ascending.

    Here is the code:

     

    1 user thanked author for this post.
    #182239

    Okay, just struggling to make it work in the code. What do I have to return in the code to make the average appear on chart and still have two separate colours? I know it might be a dumb question, just not too great at coding. Usually to make the average a standard colour we return the average and also the colour, but more than that I’m struggling with.

     

    #182245

    Just a way to do it (many other options to color based on conditions)

     

    2 users thanked author for this post.
    #182258

    Thank you.very simple and I just didn’t think of that. There isn’t maybe a way to do colourzones as well in a code?

    #182348

    You can use the indicator’s properties (settings) to add colour zones.

    This is the code that mimicks the properties, but is not as good:

     

    1 user thanked author for this post.
Viewing 6 posts - 1 through 6 (of 6 total)

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