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

lines not showing in indicator NT7 panel indicator

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

    lines not showing in indicator NT7 panel indicator

    I was wondering if there is a difference in drawing lines on an indicator on a panel VS a chart

    this is what I have. (I am testing my lines but nothing is being shown on the panel

    DrawLine("Buy",true,Time[5],0,Time[20],1000,Color.Green,DashStyle.Solid,3);
    DrawLine("Sell",true,Time[10],0,Time[30],-1000,Color.Red,DashStyle.Solid,3);

    DrawHorizontalLine("horizontal",0.0,Color.Black);

    what am I doing wrong that it will not show?

    #2
    Hello,

    If the indicator is applied to a secondary panel, by default the drawing objects will still be sent to the chart panel. You would need to remove the indicator from the chart and then reapply it after setting DrawOnPricePanel = false.



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

    Comment


      #3
      my logic

      there is nothiung to my logic right now I just want to make sure I can draw.

      protected override void Initialize()
      {
      Overlay = false;
      DrawOnPricePanel = false;
      }

      /// <summary>
      /// Called on each bar update event (incoming tick)
      /// </summary>
      protected override void OnBarUpdate()
      {
      // Use this method for calculating your indicator values. Assign a value to each
      // plot below by replacing 'Close[0]' with your own formula.
      DrawVerticalLine("my", Time[9],Color.Black,DashStyle.Solid,5);

      DrawLine("Buy",true,Time[5],0,Time[20],1000,Color.Green,DashStyle.Solid,3);
      DrawLine("Sell",true,Time[10],0,Time[30],-1000,Color.Red,DashStyle.Solid,3);

      DrawHorizontalLine("horizontal",0.0,Color.Black);
      }

      Comment


        #4
        figured it out it was an array issue

        Comment


          #5
          now I have the lines to show how do I get my zero line to be in the middle of the indicator it wants to be

          this is all I have

          if(CurrentBar > 12)
          {

          DrawLine("Buy",false,Time[5],0,Time[5],10,Color.Green,DashStyle.Solid,3);
          DrawLine("Sell",false,Time[10],-10,Time[10],-0,Color.Red,DashStyle.Solid,3);

          DrawHorizontalLine("horizontal",0,Color.Black);
          }
          Attached Files

          Comment


            #6
            Hello,

            Thank you for confirming the other item was resolved.

            Are you asking how to scale the line to the center of the panel? If so, please first ensure the panel is already scaled and there is no F in the upper right corner, if there is click the F and ensure the scale is not centered still.

            Placing a line at the max value and min value you want to be scaled, and setting them to autoscale true should allow the indicator to rescale to that range. You are currently using false for both lines.

            Alternatively, You can specify the scale the panel should have by using the following override:

            Code:
            public override void GetMinMaxValues(ChartControl chartControl, ref double min, ref double max)
            {   }
            This is not documented, so you would need to review the ZigZag indicator or the HeikenAshi to see a working example of its use.

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

            Comment


              #7
              Thankyou Also where can I get an understanding on autoscale I dont see differences on charts etc or how to use autoscale accordingly

              Comment


                #8
                Hello,

                Autoscale is simply the true or false value you provide to let the chart know if the scale should be adjusted to account for the item in question which could be an indicator, drawing object or price on the chart.

                I believe the only documented description of this property is at the following link: http://ninjatrader.com/support/helpG...tsub=autoscale

                Autoscale is the charts logic that determines what prices to display as the min and max of the chart scale. This is delegated by drawing objects and prices on the chart along with the settings used in the charts scale properties. So long as the chart scale properties are set to Automatic(the default) it will account for drawing objects if they are set to Autoscale = true.

                An example would be if you have drawing object at a price of 0 on the ES chart where the price is around 2500, the autoscale will start by scaling in the ES prices according to the chart settings which does not include a price of 0. If the drawing object is set to AutoScale == true, a scale of 0 ~ 2500 would be used. If set to false, the scale of the chart would remain unchanged.


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

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by rtwave, 04-12-2024, 09:30 AM
                2 responses
                20 views
                0 likes
                Last Post rtwave
                by rtwave
                 
                Started by tsantospinto, 04-12-2024, 07:04 PM
                5 responses
                67 views
                0 likes
                Last Post tsantospinto  
                Started by cre8able, Today, 03:20 PM
                0 responses
                6 views
                0 likes
                Last Post cre8able  
                Started by Fran888, 02-16-2024, 10:48 AM
                3 responses
                49 views
                0 likes
                Last Post Sam2515
                by Sam2515
                 
                Started by martin70, 03-24-2023, 04:58 AM
                15 responses
                115 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X