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 to hide the line ?

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

    How to hide the line ?

    Can't solve the problem.
    1. Need not display Plot1 on schedule (to hide), but the calculations needed for the strategy.
    or
    2. Display Plot1 to another (new) panel or attach it to the left .
    or
    3. To make available (visible) in the strategy calculations in myDataSeries

    Help me solve any of these problems (better examples of all three). Thank you.
    Code:
    namespace NinjaTrader.Indicator
    {
        [Description("Enter the description of your new custom indicator here")]
        public class AAA : Indicator
        {
            private int myInput0 = 1; // Default setting for MyInput0
    	private DataSeries myDataSeries; // Define a DataSeries variable
        
    	protected override void Initialize()
            {
                Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
    	    Add(new Plot(Color.FromKnownColor(KnownColor.Aqua), PlotStyle.Line, "Plot1"));
                Overlay				= false;
    	    myDataSeries = new DataSeries(this, MaximumBarsLookBack.Infinite);
            }
            protected override void OnBarUpdate()
            {
                Plot0.Set(Close[0]);
    	    Plot1.Set(Close[0]*10000);
        	    myDataSeries.Set(Close[0]*10000);
            }
    
            #region Properties
            [Browsable(false)]	// this line prevents the data series from being displayed in the indicator properties dialog, do not remove
            [XmlIgnore()]		// this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
            public DataSeries Plot0
            {
                get { return Values[0]; }
            }
            [Browsable(false)]	// this line prevents the data series from being displayed in the indicator properties dialog, do not remove
            [XmlIgnore()]		// this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
            public DataSeries Plot1
            {
                get { return Values[1]; }
            }
    
    		[Description("")]
            [GridCategory("Parameters")]
            public int MyInput0
            {
                get { return myInput0; }
                set { myInput0 = Math.Max(1, value); }
            }
            #endregion
        }
    }

    #2
    Hello,

    Thank you for the question.

    I wanted to make sure I am clear on what you want,

    You need Plot1 to not be seen but used for calculations, is this correct?

    If so, you would need to create a DataSeries instead just like how you are using myDataSeries currently.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hello
      Thanks for your help and attention to beginner to learn programming and NT.
      Yes I need to see myDataSeries in the strategy, but do not understand how to do it. How can I transfer these data (myDataSeries) from the indicator to the strategy. I did not get.
      Sorry for English. Use the online translator.

      Comment


        #4
        Hello,

        I have attached a script that shows how to accomplish this task.

        There are two files, an indicator and a strategy.

        The indicator exposes a DataSeries so the strategy can see its values.

        The strategy shows how to call this series and get a value.

        The indicator does not display the dataseries but just uses it for calculations.

        I look forward to being of further assistance.
        Attached Files
        JesseNinjaTrader Customer Service

        Comment


          #5
          Thank you very much.
          I somehow didn't work out. Now it worked. The data come.
          Still have 1 question, how Plot0 and Plot1 displayed on different panels.

          Comment


            #6
            Hello,

            In a single indicator this is not possible, the Indicator its self determines where all of its plots reside. This means if an indicator has 3 plots, all 3 plots will end up in the same panel.

            Instead you could look at this example which shows how to specify a panel for each plot when using a Strategy: http://ninjatrader.com/support/forum...ead.php?t=6651

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by kaywai, 09-01-2023, 08:44 PM
            5 responses
            602 views
            0 likes
            Last Post NinjaTrader_Jason  
            Started by xiinteractive, 04-09-2024, 08:08 AM
            6 responses
            22 views
            0 likes
            Last Post xiinteractive  
            Started by Pattontje, Yesterday, 02:10 PM
            2 responses
            19 views
            0 likes
            Last Post Pattontje  
            Started by flybuzz, 04-21-2024, 04:07 PM
            17 responses
            230 views
            0 likes
            Last Post TradingLoss  
            Started by agclub, 04-21-2024, 08:57 PM
            3 responses
            17 views
            0 likes
            Last Post TradingLoss  
            Working...
            X