Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Template Will not Save Indicator

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

    Template Will not Save Indicator

    Dear Support,

    Any reason why a simple working indicator will not be saved on a any template when the template template is saved?
    The indicator simply colors the bars using simple price data conditions.

    Many thanks.

    #2
    aligator,

    Thanks for posting.


    Is this indicator something you created, or is it a third party vendor's product?

    Does this occur with any native indicators, such as an EMA in your installation of the platform?

    Do you receive an error on screen? Are there errors on the Log tab of the Control Center? If so, what do these errors report?

    Comment


      #3
      Originally posted by NinjaTrader_DrewO View Post
      aligator,

      Thanks for posting.


      Is this indicator something you created, or is it a third party vendor's product?

      Does this occur with any native indicators, such as an EMA in your installation of the platform?

      Do you receive an error on screen? Are there errors on the Log tab of the Control Center? If so, what do these errors report?
      Thans DrewO,

      Yes, I created this simple indicator that paints candles based on very simple price data(O,H,L,C). Nothing special, I have created many similar indicators and no issue.
      Somthing similar to this:

      Code:
              protected override void OnBarUpdate()
              {    
                  if (CurrentBar < 1)
                      return;
                  if (Close[0] > Close[1])
                  {
                      BarBrush = Brushes.Transparent;
                      CandleOutlineBrush = upColor;
                  }
      
                  if (Close[0] < Open[0] && Close[0] >= Close[1])
                  {
                      BarBrush = upColor;
                      CandleOutlineBrush = upColor;
                  }
              }
      
              #region Properties
              [NinjaScriptProperty]        
              [Display(Name = "Up Color", Description = "Up Color", GroupName = "PlotColors", Order = 1)]        
              public Brush UpColor
              {
                  get { return upColor; }
                  set { upColor = value; }
              }
      
              [Browsable(false)]
              public string UpColorSerialize
              {
                  get { return Serialize.BrushToString(upColor); }
                  set { upColor = Serialize.StringToBrush(value); }
              }
      No, this occurs on ant plain chart or charts with any indicators.
      No errors are generated anywhere.

      I have removed the _Workspace folder and re-start Ninja, no change. The indicator will not be saved on template.
      Last edited by aligator; 08-26-2019, 11:23 AM.

      Comment


        #4
        aligator,

        Thanks for replying.


        It looks like you may not be adding the necessary code to properly serialize the brush, which would be required to be saved as part of an xml such as a template. In this case, XmlIgnore() would be needed. You can read more at the below link:

        Comment


          #5
          Originally posted by NinjaTrader_DrewO View Post
          aligator,

          Thanks for replying.


          It looks like you may not be adding the necessary code to properly serialize the brush, which would be required to be saved as part of an xml such as a template. In this case, XmlIgnore() would be needed. You can read more at the below link:

          https://ninjatrader.com/support/help...lor_inputs.htm
          Thank you, Drew,

          Wonderful, that was it. Keep forgetting this pesky [XmlIgnore()] for many years of coding.

          Many thanks.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          88 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          48 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          30 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          34 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          68 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X