Ver 4.5.1 Bug Report, fails to load indicator color settings
Created at 24 Nov 2022, 17:59
Ver 4.5.1 Bug Report, fails to load indicator color settings
24 Nov 2022, 17:59
Hello Team,
I have the below code, which set each indicator to a different colour, it works well before ver 4.5.1.
Please advise
using System;
using cAlgo.API;
using cAlgo.API.Internals;
namespace cAlgo
{
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class CurrencyStrengthValue : Indicator
{
[Parameter("GROUP A", DefaultValue = "True", Group = "Ver. 2.08" )] public bool GroupA { get; set; }
[Parameter("GROUP B", DefaultValue = "True", Group = "Ver. 2.08" )] public bool GroupB { get; set; }
[Output("USD", LineColor = "DDFF0005", Thickness = 1, PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries USD { get; set; }
[Output("EUR", LineColor = "DD1256FF", Thickness = 1, PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries EUR { get; set; }
[Output("GBP", LineColor = "DDB600FF", Thickness = 1, PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries GBP { get; set; }
[Output("CHF", LineColor = "DDC4C425", Thickness = 1, PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries CHF { get; set; }
[Output("AUD", LineColor = "DDCFA005", Thickness = 1, PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries AUD { get; set; }
[Output("NZD", LineColor = "DD00BF00", Thickness = 1, PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries NZD { get; set; }
[Output("CAD", LineColor = "DDFF21BF", Thickness = 1, PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries CAD { get; set; }
[Output("JPY", LineColor = "DDB3B3B3", Thickness = 1, PlotType = PlotType.DiscontinuousLine)] public IndicatorDataSeries JPY { get; set; }
//Symbol Names
private readonly string s_EURUSD = "EURUSD", s_EURGBP = "EURGBP", s_EURAUD = "EURAUD", s_EURNZD = "EURNZD", s_EURCAD = "EURCAD", s_EURCHF = "EURCHF", s_EURJPY = "EURJPY";
private readonly string s_GBPUSD = "GBPUSD", s_GBPAUD = "GBPAUD", s_GBPNZD = "GBPNZD", s_GBPCAD = "GBPCAD", s_GBPCHF = "GBPCHF", s_GBPJPY = "GBPJPY";
private readonly string s_AUDUSD = "AUDUSD", s_AUDNZD = "AUDNZD", s_AUDCAD = "AUDCAD", s_AUDCHF = "AUDCHF", s_AUDJPY = "AUDJPY";
private readonly string s_NZDUSD = "NZDUSD", s_NZDCAD = "NZDCAD", s_NZDCHF = "NZDCHF", s_NZDJPY = "NZDJPY";
private readonly string s_USDCAD = "USDCAD", s_CADCHF = "CADCHF", s_CADJPY = "CADJPY";
private readonly string s_USDCHF = "USDCHF", s_CHFJPY = "CHFJPY";
private readonly string s_USDJPY = "USDJPY";
//Bars to load for Calculate : Defined at Initialize()
private Bars EURUSD, EURGBP, EURAUD, EURNZD, EURCAD, EURCHF, EURJPY;
private Bars GBPUSD, GBPAUD, GBPNZD, GBPCAD, GBPCHF, GBPJPY;
private Bars AUDUSD, AUDNZD, AUDCAD, AUDCHF, AUDJPY;
private Bars NZDUSD, NZDCAD, NZDCHF, NZDJPY;
private Bars USDCAD, CADCHF, CADJPY;
private Bars USDCHF, CHFJPY;
private Bars USDJPY;
private TextBox tx_Load = new TextBox { BorderThickness = 0, VerticalAlignment = VerticalAlignment.Bottom, HorizontalAlignment = HorizontalAlignment.Center };
protected override void Initialize()
{
//4.5.1 Can't load bars to variables 16 of 28 pairs got error 'Failed to get symbol 'AUDCHF': Symbol not found or has no quotes.'
GetBarsForEachSymbols(Bars.TimeFrame);
Chart.AddControl(tx_Load);
tx_Load.Text = "End if Initialize...\n";
}
public override void Calculate(int index) { }
//GetBars for EachSymbol
private void GetBarsForEachSymbols(TimeFrame timeFrame)
{
EURUSD = MarketData.GetBars(timeFrame, s_EURUSD); GBPUSD = MarketData.GetBars(timeFrame, s_GBPUSD); AUDUSD = MarketData.GetBars(timeFrame, s_AUDUSD); NZDUSD = MarketData.GetBars(timeFrame, s_NZDUSD);
EURGBP = MarketData.GetBars(timeFrame, s_EURGBP); GBPAUD = MarketData.GetBars(timeFrame, s_GBPAUD); AUDNZD = MarketData.GetBars(timeFrame, s_AUDNZD); NZDCAD = MarketData.GetBars(timeFrame, s_NZDCAD);
EURAUD = MarketData.GetBars(timeFrame, s_EURAUD); GBPNZD = MarketData.GetBars(timeFrame, s_GBPNZD); AUDCAD = MarketData.GetBars(timeFrame, s_AUDCAD); NZDCHF = MarketData.GetBars(timeFrame, s_NZDCHF);
EURNZD = MarketData.GetBars(timeFrame, s_EURNZD); GBPCAD = MarketData.GetBars(timeFrame, s_GBPCAD); AUDCHF = MarketData.GetBars(timeFrame, s_AUDCHF); NZDJPY = MarketData.GetBars(timeFrame, s_NZDJPY);
EURCAD = MarketData.GetBars(timeFrame, s_EURCAD); GBPCHF = MarketData.GetBars(timeFrame, s_GBPCHF); AUDJPY = MarketData.GetBars(timeFrame, s_AUDJPY);
EURCHF = MarketData.GetBars(timeFrame, s_EURCHF); GBPJPY = MarketData.GetBars(timeFrame, s_GBPJPY); USDCAD = MarketData.GetBars(timeFrame, s_USDCAD);
EURJPY = MarketData.GetBars(timeFrame, s_EURJPY); USDCHF = MarketData.GetBars(timeFrame, s_USDCHF); CADCHF = MarketData.GetBars(timeFrame, s_CADCHF);
USDJPY = MarketData.GetBars(timeFrame, s_USDJPY); CHFJPY = MarketData.GetBars(timeFrame, s_CHFJPY); CADJPY = MarketData.GetBars(timeFrame, s_CADJPY);
}
}
}
Replies
Capt.Z-Fort.Builder
24 Nov 2022, 18:36
RE:
The issue had been identified, Use hashtags and it works. Ie. "#DDFF0005" instead of "DDFF0005"
The code was made a long time ago, it seems that ver 4.5.1 is more rigorous in coding. Thanks.
@Capt.Z-Fort.Builder
vitofx
24 Nov 2022, 18:31
RE:
Using color codes with hashtags should fix it.
Eg. "#DDFF0005" instead of "DDFF0005"
@vitofx