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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        576 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X