I have multiple custom indicators that have plots with alternating colors based on certain market conditions. For example, I have a paint bar system that paints the candle bar 4 different colors based on core logic. I have these variables declared as follows:
private Brush _dwnColor;
private Brush _volSpikeUpColor;
private Brush _volSpikeDownColor;
_dwnColor = Brushes.Crimson;
_volSpikeUpColor = Brushes.Lime;
_volSpikeDownColor = Brushes.Magenta;
When a user decides to change the default colors by going to the settings (CONTROL+I) they are able to do so successfully and the indicator once again plots correctly with the newly selected color. HOWEVER, when the user closes NT8, even after saving the workspace, and reloads it, the old default colors are being used and not the ones the user changed it to. The settings for the colors are coded as follows:
public Brush UpColor
{
get { return _upColor; }
set { _upColor = value; }
}
[Browsable(false), XmlIgnore]
public string UpColorSerialize
{
get { return Serialize.BrushToString(_upColor); }
set { _upColor = Serialize.StringToBrush(value); }
}
[Display(ResourceType = typeof(Custom.Resource), Name = "Down Color", GroupName = "Settings Colors", Order = 0), XmlIgnore]
public Brush DownColor
{
get { return _dwnColor; }
set { _dwnColor = value; }
}
[Display(ResourceType = typeof(Custom.Resource), Name = "Up Volume Spike", GroupName = "Settings Volume", Order = 0), XmlIgnore]
public Brush volSpikeUpColor
{
get { return _volSpikeUpColor; }
set { _volSpikeUpColor = value; }
}
[Browsable(false), XmlIgnore]
public string volSpikeUpColorSerialize
{
get { return Serialize.BrushToString(_volSpikeUpColor); }
set { _volSpikeUpColor = Serialize.StringToBrush(value); }
}
[Display(ResourceType = typeof(Custom.Resource), Name = "Down Volume Spike", GroupName = "Settings Volume", Order = 1), XmlIgnore]
public Brush volSpikeDownColor
{
get { return _volSpikeDownColor; }
set { _volSpikeDownColor = value; }
}
[Browsable(false), XmlIgnore]
public string volSpikeDownColorSerialize
{
get { return Serialize.BrushToString(_volSpikeDownColor); }
set { _volSpikeDownColor = Serialize.StringToBrush(value); }
}
[Display(ResourceType = typeof(Custom.Resource), Name = "Alerts On", GroupName = "Settings Volume", Order = 3), XmlIgnore]
public bool volAlert
{
get { return _volAlert;}
set { _volAlert = value;}
}
[Display(ResourceType = typeof(Custom.Resource), Name = "Volume Threshold", GroupName = "Settings Volume", Order = 2), XmlIgnore]
public double volThreshold
{
get { return _volThreshold;}
set { _volThreshold = value;}
}
Thanks
Comment