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 TradeForge, 04-19-2024, 02:09 AM
        2 responses
        28 views
        0 likes
        Last Post TradeForge  
        Started by aprilfool, 12-03-2022, 03:01 PM
        3 responses
        327 views
        0 likes
        Last Post NinjaTrader_Adrian  
        Started by giulyko00, Today, 12:03 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by f.saeidi, Today, 12:14 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by AnnBarnes, Today, 12:17 PM
        1 response
        2 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Working...
        X