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 -

    BertrandNinjaTrader Customer Service

    Comment


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

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by joselube001, 05-10-2024, 12:17 PM
      4 responses
      19 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by lorem, 04-25-2024, 09:18 AM
      17 responses
      75 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by DawnTreader, 05-08-2024, 05:58 PM
      21 responses
      81 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by doihaveto13, Today, 12:46 PM
      2 responses
      4 views
      0 likes
      Last Post doihaveto13  
      Started by Vitamite, Today, 12:48 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X