Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Colors disappear when restarting Ninja

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Colors disappear when restarting Ninja

    Hi,

    When I apply my custom indicator to a chart it all works fine. The input colors are setup correctly, as shown in attachment 1. But if I save the workspace, close Ninja, restart Ninja, and then reopen the workspace, the colors have all disappeared, as shown in attachment 2.

    The colors are defined as variables in the Variables section

    Code:
     
    #region Variables
    private System.Drawing.Color color1 = Color.White;
    private System.Drawing.Color color2 = Color.ForestGreen;
    private System.Drawing.Color color3 = Color.Lime;
    private System.Drawing.Color color4 = Color.LightSkyBlue;
    private System.Drawing.Color color5 = Color.Yellow;
    private System.Drawing.Color color6 = Color.DarkOrange;
    private System.Drawing.Color color7 = Color.Red;
    private System.Drawing.Color color8 = Color.White;
    and as inputs in the Properties section

    Code:
     
    #region Properties
     
    [Description("Color 1")]
    [GridCategory("Parameters")]
    public Color Color1
    {
    get { return color1; }
    set { color1 = value; }
    }
     
    [Description("Color 2")]
    [GridCategory("Parameters")]
    public Color Color2
    {
    get { return color2; }
    set { color2 = value; }
    }
     
    ...


    This is Ninja 7 beta 18. Is this a known bug or am I doing something wrong?

    Thanks
    Attached Files
    Last edited by bubblegum; 07-08-2010, 04:54 AM.

    #2
    bubblegum, you would need to serialize the color properties in your code properly, then those could be saved in the workspaces and thus persisted on restart -

    Comment


      #3
      Thank you very much for your quick reply. It worked.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      78 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X