Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Chart AutoScale from Plot()

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

    Chart AutoScale from Plot()

    I know there is no official support for Plot but hopefully the community can help.

    Is there a way to include stuff drawn in Plot() to be part of the chart's AutoScale? I can vaguely remember seeing something while perusing the Intellisense withing the scope of Plot that I thought might be usefully for chart scaling but now I can't find it. I may have dreamed it ( ) or I might have been coding in another environment.

    Currently, to force the chart's AutoScale to include stuff drawn in Plot, I do a rather crude hack. Within OnBarUpdate, I call DrawRectangle with AutoScale set, Height and Width=0, Color.Empty at the price drawn in Plot.

    Something like:

    DrawRectangle("ScaleHigh",AutoScale,0,scalePrice,0 ,scalePrice,Color.Empty,Color.Empty,10); //Not visible (height and width = 0).

    I'm hoping there is a much cleaner way to do this within the Plot.

    Any suggestion would be appreciated.

    PS. I'm on NT6.5 but if NT7 brings something useful in this regard I would love to hear about it.

    thanks,
    shawnj

    #2
    autoscale included

    DrawRectangle(string tag, bool autoScale, DateTime startTime, double startY, DateTime endTime, double endY, Color color, Color areaColor, int areaOpacity)

    NT7 version includes autoscale.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    43 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    25 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    162 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    98 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    157 views
    2 likes
    Last Post CaptainJack  
    Working...
    X