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

How do I make a public value NOT display?

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

    How do I make a public value NOT display?

    I have a DataSeries I am passing to another program to use there and for backtesting. I defined the series in Initialize() as follows:

    Add(new Plot(new Pen(Color.Transparent, 1), PlotStyle.Line, "AdxDirection"));

    In the properties section I added:

    [Browsable(false)]
    [XmlIgnore()]
    public DataSeries AdxDirection
    {
    get { return Values[6]; }
    }

    Everything works fine. I just don't want the value of AdxDirection to display in the Plots section of the indicator. I want it to be 'invisible' to everyone except the program. I tried just making AdxDirection a variable as follows:

    public DataSeries AdxDirection;

    ...and that worked fine except I get a sereailization error when I try to save the workspace. Any ideas?


    #2
    Hello,

    When you say the plots section of the indicator, do you mean the indicator settings? Or you want to hide the plot completely from the chart/display?

    If you're referring to the plots section of the indicator parameters, please add PlotsConfigurable = false; in the Initialize() section.

    This cannot be configured per plot - it will disable all of the plots from being configurable

    If you were speaking of the chart/display, setting the plot to transparent should hide it. Can you point me to where exactly this is displaying?
    MatthewNinjaTrader Product Management

    Comment


      #3
      Just kill (delete or comment out) the plot instruction and properties. I presume you will be storing double values. If integer, 1 = up, -1 = down?, use IntSeries or String Series if "U" and "D".

      Define your DataSeries in Vars

      private DataSeries adxDirectionSeries;

      create it in initialize

      adxDirectionSeries = new DataSeries(this);

      set the value in OnBarUpdate?

      adxDirectionSeries.Set(xyz);

      Expose it in Properties

      [Browsable(false)]
      [XmlIgnore()]
      [Description("ADX Whatever")]
      public DataSeries AdxDirection
      {
      get { Update();
      return adxDirectionSeries; }
      }

      This will create the public DataSeries w/o a plot.

      Comment


        #4
        Snap-
        GREAT answer!!! Thank you very much. You hit the nail dead on the head!!
        gb

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by FrancisMorro, Today, 03:24 AM
        0 responses
        1 view
        0 likes
        Last Post FrancisMorro  
        Started by Segwin, 05-07-2018, 02:15 PM
        10 responses
        1,769 views
        0 likes
        Last Post Leafcutter  
        Started by Rapine Heihei, 04-23-2024, 07:51 PM
        2 responses
        30 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by Shansen, 08-30-2019, 10:18 PM
        24 responses
        943 views
        0 likes
        Last Post spwizard  
        Started by Max238, Today, 01:28 AM
        0 responses
        10 views
        0 likes
        Last Post Max238
        by Max238
         
        Working...
        X