Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Y axis max and min

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

    Y axis max and min

    Anyone knows this?

    I managed to get the Y axis values with this code:

    Code:
    public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
               {
             yaxmax=Math.Round(max,4);
             yaxmin=Math.Round(min,4);
               }
     protected override void OnBarUpdate()
            {
             ....
             Plot0.Set(GV2);
            }
    ...then with a global variable those values (yaxmin and yaxmax) can be accessed within OnBarUpdate(), however they are actualized only when pressing F5 key...is there a solution to be actualized on each tick?...how can I pass those yaxmax and yaxmin values within the OnBarUpdate() and have them updated every tick? ...the purpose being when I manually change the Y axis scale the new max and min of Y axis to be immediately changed without pressing F5.

    I obviously have no clue about C++ or C# excuse the question if its a noob question.

    Thank you.

    #2
    Paul, unfortunately this outside of the NinjaScript scope we can support here - have you tried working with CalculateOnBarClose = false in your indicators?

    Comment


      #3
      Thank you Bertrand, adding CaculateObarclose=false worked, I never considered using it there because in help section it writes that it should be only used within Initialize method.

      However I think its not the best idea to have it calculated like this on each tick, since I want to have the Y axis values updated only when I manually change the Y scale. Is there any function/method or whatever that acts as response to a user action like rescaling axis?

      Thanks

      Comment


        #4
        Unfortunately there's no such method for programmatic access Paul.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        42 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