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?
    Drew O.NinjaTrader Customer Service

    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:

        Drew O.NinjaTrader Customer Service

        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 tsantospinto, 04-12-2024, 07:04 PM
          7 responses
          126 views
          0 likes
          Last Post aligator  
          Started by futtrader, 04-21-2024, 01:50 AM
          5 responses
          56 views
          0 likes
          Last Post NinjaTrader_Eduardo  
          Started by PeakTry, Today, 10:49 AM
          0 responses
          2 views
          0 likes
          Last Post PeakTry
          by PeakTry
           
          Started by llanqui, Today, 10:32 AM
          0 responses
          5 views
          0 likes
          Last Post llanqui
          by llanqui
           
          Started by StockTrader88, 03-06-2021, 08:58 AM
          45 responses
          3,994 views
          3 likes
          Last Post johntraderuser2  
          Working...
          X