Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawHorizontalLine affects auto mode price scale

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

    DrawHorizontalLine affects auto mode price scale

    DrawHorizontalLine("priceline",true,Close[0],Color.Gold,DashStyle.DashDotDot,1);

    the above line in my cs indicator causes the price scale to change from normal for the day, say 9900 to 9950 for the YM to 9900 to 20000...which compresses the chart of course

    changing bool back to false solves problem

    #2
    Originally posted by ATI user View Post
    DrawHorizontalLine("priceline",true,Close[0],Color.Gold,DashStyle.DashDotDot,1);

    the above line in my cs indicator causes the price scale to change from normal for the day, say 9900 to 9950 for the YM to 9900 to 20000...which compresses the chart of course

    changing bool back to false solves problem
    What value has been passed in for Close[0] and setting the bool to true will include this line value in the automatica scale generation...so that is expected. Just need to know the line value.
    RayNinjaTrader Customer Service

    Comment


      #3
      Per email from Josh I printed out all values of Close[0]....see pic

      during this time span, the scale when back and forth from normal up to 10,000

      however, no abnormal/out of range values were printed
      Attached Files
      Last edited by ATI user; 10-14-2009, 08:57 AM.

      Comment


        #4
        Do you have a demo script we could try on our end? Thank you.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          ran this code below and did not have a problem

          same code in my cs does have problem

          so must be some conflict within my code

          ......................

          public class MyCustomIndicator : Indicator
          {
          #region Variables
          // Wizard generated variables
          private int myInput0 = 1; // Default setting for MyInput0
          // User defined variables (add any user defined variables below)
          #endregion

          /// <summary>
          /// This method is used to configure the indicator and is called once before any bar data is loaded.
          /// </summary>
          protected override void Initialize()
          {
          Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
          CalculateOnBarClose = false;
          Overlay = 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.
          Plot0.Set(Close[0]);
          DrawHorizontalLine("priceline",true,Close[0],Color.Gold,DashStyle.DashDotDot,1);
          Print (Close[0]);

          Comment


            #6
            ATI user,

            Maybe look around for other objects that may be using the AutoScale as well.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            626 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            359 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            562 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            567 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X