Change Colour depending on price.

Forums ProRealTime English forum ProBuilder support Change Colour depending on price.

Viewing 10 posts - 1 through 10 (of 10 total)
  • #81298

    Hello everyone! Im quite new in this with programing so I would be really thankful for some help. 🙂

    I’ve done one indicator that draw red lines if two bars Open and Close are in the same level. And now to the problem. I only want the lines to be red if price since line was drawn haven’t been under the line. If the price been under. I want them to be grey.

    Thanks and also a big thumb up for the great videos about programming!

    #81401

    Well, that’s not so easy. It is not possible to change the color of an object already plotted. But we could try to plot new lines over it with a new color and it should overlap the previous ones. Another problem is the lack of data array, so it is not possible to store dynamically how many lines had been drawn and at what levels.

    How many lines from the past would have their colors changed? Could you post your code in its actual state?

    1 user thanked author for this post.
    #81453

    Thank you so much for your reply Nicolas!

    Ok, i see… I think 5 lines should be enough. Plot a new line over the old one sound like a good option!

    Here is the code, I forgot to put in in last time. 😊

    Maybe it’s a better idea to only plot the ones that´s never been over the price and do another indicator for the ones that’s been?

     

     

    #81460

    Lind3berg – please use the ‘Insert PRT Code’ button when posting code in your future replies as it makes it far more readable for others. I have tidied up your post for you. 🙂

    1 user thanked author for this post.
    #81464

    Oh sorry. I missed that one. I will do it next time. 🙂 Thank you!

    #81851

    Is there someone of you smart guys who have an idea to solve this? Or just a way to only show the spots that are over todays Close.?

    #81899

    Could you try the below code? I’m struggling to find examples to test it works correctly..

     

    1 user thanked author for this post.
    #81943

    It works amazing @Nicolas! 😀 Exactly what i wanted! Thank you so much, I dont know how many hours ive been trying to solve his on my own.

    Is there a way to only show the ones the price not been to? I can Think it will be a problem for all history. But if its like the 3 lines that was made closest to today?

     

    #81944

    Is there a way to only show the ones the price not been to? I can Think it will be a problem for all history. But if its like the 3 lines that was made closest to today?

    That’s possible. BTW, you can already adapt the history it looks at with the “lookback” variable in the code, I made it as 1000 bars by default.

    #81964

    That sounds good, now i will start scratch my own head again. 😉

    Yes, i changed it to 100 and also changed the lines to segments to make it easier to see where they appered.

    Thanks a lot for your help, it means a lot! With this programming I Think ive  found a new interest in my Life. 🙂

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

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