Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Color Gradient Plot

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Color Gradient Plot

    Hi Guys,

    I saw on the ecosystem page that one can change the plot color by a gradient color. I saw the RSI Color Gradient Indicator and I also understood the code but
    not how to change the colors of the gradient. Can someone help me with that ?

    Many thanks in advance !

    #2
    Hello muratb35,

    Thank you for your reply.

    The following lines of code control the gradient for the bars:

    int rgbGreen = 0;
    int rgbRed = 0;
    int rgbBlue = 0;

    rgbRed = (int) (255*(rsiValue)/100);
    rgbGreen = 255-rgbRed;
    //rgbBlue = 255-rgbRed;//To use blue values

    BarBrush = new SolidColorBrush(Color.FromArgb((byte)255, (byte)rgbRed,(byte)rgbGreen,(byte)rgbBlue));

    To change the gradient colors you'd have to modify what gets assigned to rgbRed, rgbGreen, and rgbBlue. These values need to be between 0 and 255. The indicator currently varies the rgbRed value based on the RSI value, and modifies the rgbGreen value based on what rgbRed is to create the gradient effect. You can experiment with using the green or blue one to be the one calculated from the RSI and the red to be calculated off that, I'd just play around with those until you create the effect you desire.

    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Hi Kate,

      thank you ! This was the exact solution that I was looking for !

      Have a nice day !

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      68 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      150 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      100 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      288 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X