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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      581 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      336 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      554 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      552 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X