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 CarlTrading, 03-31-2026, 09:41 PM
            1 response
            82 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            43 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            64 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            68 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            56 views
            0 likes
            Last Post CarlTrading  
            Working...
            X