• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 mittie3, Today, 03:33 AM
            0 responses
            5 views
            0 likes
            Last Post mittie3
            by mittie3
             
            Started by Againmain1, Today, 03:04 AM
            0 responses
            7 views
            0 likes
            Last Post Againmain1  
            Started by tonytimpa, Today, 01:33 AM
            0 responses
            5 views
            0 likes
            Last Post tonytimpa  
            Started by kiwidtrader, Yesterday, 11:49 PM
            0 responses
            5 views
            0 likes
            Last Post kiwidtrader  
            Started by jmahon, Yesterday, 11:44 PM
            0 responses
            7 views
            0 likes
            Last Post jmahon
            by jmahon
             
            Working...
            X