change color of an output programatically
change color of an output programatically
22 Apr 2015, 23:13
Is there a way to set the color of an indicator Output programmatically.
For example, i have an output for the weekly close. i would like to set the color based on whether there was a gain or loss for the week. Any ideas?
[Output("WeeklyClose", Thickness = 0, PlotType = PlotType.Points, Color = Colors.Black)]
public IndicatorDataSeries WClose { get; set; }
I tried Wclose.Color but its not an exposed attribute
Replies
WhiteSage
25 Jun 2015, 13:31
More simply put, use an If statement as you iterate through the data and populate multiple IndicatorDataSeries. The PlotType Discontinuous will draw between populated points and leave a gap where they are NaN. If you are coloring a single line by indexes you can use <= or other methods to make sure it doubles up the fields at that point (eg The current value in both are populated) creating a continuous line that appears to change colour but has not gaps!
@WhiteSage
Spotware
24 Jun 2015, 15:22
Dear Trader,
Currently it is not possible to change the color of the indicator in the way you were trying to change it. However please take a look at the following indicator: /algos/indicators/show/265
He hope this helps you.
@Spotware