• 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 can i set AutoScale property?

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

    How can i set AutoScale property?

    Hello,

    I have a strategy and using custom plots inside that strategy. Plots for plot higher time frame indicator's value because of that there is big gaps between instrument prices and indicator values, candles squeeze inside narrow area. How can i set auto scale to false for these custom plots?

    Thanks,
    Aytac

    #2
    Hello aytacasan,

    Thanks for writing in to our Support Forums!

    You can set the plots of your NinjaScript to draw with AutoScale disabled by setting IsAutoScale to false inside OnStateChange() when the State is State.SetDefaults.

    Please consider the sample code from the help documentation:

    Code:
    protected override void OnStateChange()
    {
      if (State == State.SetDefaults)
      {         
        Name                 = "Example Indicator";         
        // set this to true to call CalculateMinMix() to ensure drawing tool is fully rendered in chart scale
        IsAutoScale = true; 
      }
      else if (State == State.Configure)
      {
      }
    }
    https://ninjatrader.com/support/help...sautoscale.htm
    This code will set all of the plots to AutoScale. If we set IsAutoScale to false, the plots will not be set to draw with AutoScale.

    Drawing objects that you are adding from your indicator or strategy will have to use the isAutoScale argument of the Drawing Object's calling method. You may observe the function prototypes from Draw.Line() for reference.

    Code:
    Draw.Line(NinjaScriptBase owner, string tag, int startBarsAgo, double startY, int endBarsAgo, double endY, Brush brush)
    Draw.Line(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, Brush brush, DashStyleHelper dashStyle, int width)
    Draw.Line(NinjaScriptBase owner, string tag, bool isAutoScale, DateTime startTime, double startY, DateTime endTime, double endY, Brush brush, DashStyleHelper dashStyle, int width)
    Draw.Line(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, Brush brush, DashStyleHelper dashStyle, int width, bool drawOnPricePanel)
    Draw.Line(NinjaScriptBase owner, string tag, bool isAutoScale, DateTime startTime, double startY, DateTime endTime, double endY, Brush brush, DashStyleHelper dashStyle, int width, bool drawOnPricePanel)
    Draw.Line(NinjaScriptBase owner, string tag, bool isAutoScale, DateTime startTime, double startY, DateTime endTime, double endY, string templateName)
    Draw.Line(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, string templateName)
    Draw.Line(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, bool isGlobal, string templateName)
    Draw.Line(NinjaScriptBase owner, string tag, bool isAutoScale, DateTime startTime, double startY, DateTime endTime, double endY, bool isGlobal, string templateName)
    https://ninjatrader.com/support/help...?draw_line.htm

    You may also wish to set the properties of each indicator separately. We have a reference sample that may be of help: http://ninjatrader.com/support/forum...ead.php?t=6651

    Please let me know if you have any further questions.
    Last edited by NinjaTrader_Jim; 03-07-2017, 09:01 AM.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hello Jim,

      Thanks for your very detailed answer. I appreciate you.

      Thanks,
      Aytac

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Yandychang, Today, 02:16 PM
      0 responses
      2 views
      0 likes
      Last Post Yandychang  
      Started by priceisking, Today, 01:16 PM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by kashyapjdave, 03-23-2017, 12:12 AM
      11 responses
      1,956 views
      0 likes
      Last Post forextrader2003  
      Started by Gav_G, 07-26-2018, 04:29 PM
      5 responses
      422 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by spikeruk, Today, 01:49 PM
      0 responses
      5 views
      0 likes
      Last Post spikeruk  
      Working...
      X