cTrader corrupts data in a preset when saving White (#FFFFFFFF) colour in the Output

Created at 10 Apr 2025, 22:01
AL

algostic

Joined 01.04.2025

cTrader corrupts data in a preset when saving White (#FFFFFFFF) colour in the Output
10 Apr 2025, 22:01


Hi team,

Looks like cTrader corrupts data in a preset when saving White (#FFFFFFFF) colour in the Output, unless I am missing something.

When loading saved preset, it sets colour for Output to #00000000. Colour #FFFFFFFE and the rest save in a preset correctly.

It is not a big problem but might cause some confusion. 

Test code is below for you to try. Save these settings in a preset and try to load it back to see the colour for Output change to #00000000.

using System;
using cAlgo.API;
namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class TestColors : Indicator
    {       
        // Saves White colour in a preset correctly  
        [Parameter("Color", Group = "Color", DefaultValue = "FFFFFFFF")]
        public Color Color {get; set;} 
                
        // When loading saved preset it sets colour for Output to #00000000
        // Colour #FFFFFFFE and the rest save in a preset correctly        
        [Output("Color", LineColor = "FFFFFFFF")] 
        public IndicatorDataSeries Result { get; set; }
        
        protected override void Initialize()
        {                                                                                
        }                
        public override void Calculate(int index)
        {                                                                
        }
    }
}

After loading preset

 

 

 

 

 

 


cTrader
@algostic