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 judysamnt7, 03-13-2023, 09:11 AM
          4 responses
          59 views
          0 likes
          Last Post DynamicTest  
          Started by ScottWalsh, Today, 06:52 PM
          4 responses
          36 views
          0 likes
          Last Post ScottWalsh  
          Started by olisav57, Today, 07:39 PM
          0 responses
          7 views
          0 likes
          Last Post olisav57  
          Started by trilliantrader, Today, 03:01 PM
          2 responses
          22 views
          0 likes
          Last Post helpwanted  
          Started by cre8able, Today, 07:24 PM
          0 responses
          10 views
          0 likes
          Last Post cre8able  
          Working...
          X