Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

My indicator has a Color property and I need to be able to persist and recover it

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

    My indicator has a Color property and I need to be able to persist and recover it

    I have created a few custom indicators for NT6. Because of the way NT6 requires multiple plots for multiple colors per line when plotting, some of these indicators have 6 or more plots. Certain pairs of these plots share settings and so I made parameters to accept the settings for these including color. When I set up my charts the way I want them, I saved a template. When I close and re-open a chart and apply the template, the color settings are missing and set to "unknown" (or something to that effect).

    Can you look into this? Is it a bug or can NT6 templates not handle saving inputs of class type 'Color'?

    Thank you!

    #2
    imported post

    For clarification, you have a property that is a color and this property is not recovering? If yes, then take a look at the VolumeProfile indicator source code.

    You will need to handle your color properties like this:
    ///<summary>
    ///</summary>
    [XmlIgnore()]
    [Description(
    "Color of volume bars representing sell trades.")]
    [Category("Colors")]
    [Gui.Design.DisplayNameAttribute(
    "Sell color")]
    public Color VolumeColorDown
    {
    get { return volumeColorDown; }
    set { volumeColorDown = value; }
    }

    ///<summary>
    ///</summary>
    [Browsable(
    false)]
    publicstring VolumeColorDownSerialize
    {
    get { return NinjaTrader.Gui.Design.SerializableColor.ToString( volumeColorDown); }
    set { volumeColorDown = NinjaTrader.Gui.Design.SerializableColor.FromStrin g(value); }
    }


    RayNinjaTrader Customer Service

    Comment


      #3
      imported post

      Thank you Ray ... this resolved my issues.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by WHICKED, Today, 12:45 PM
      2 responses
      16 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by GussJ, 03-04-2020, 03:11 PM
      15 responses
      3,272 views
      0 likes
      Last Post xiinteractive  
      Started by Tim-c, Today, 02:10 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Taddypole, Today, 02:47 PM
      0 responses
      2 views
      0 likes
      Last Post Taddypole  
      Started by chbruno, 04-24-2024, 04:10 PM
      4 responses
      51 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Working...
      X