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)
      {
      }
    }

    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)


    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.

    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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      54 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      72 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X