Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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?
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by GussJ, 03-04-2020, 03:11 PM
        16 responses
        3,279 views
        0 likes
        Last Post Leafcutter  
        Started by WHICKED, Today, 12:45 PM
        2 responses
        19 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Started by Tim-c, Today, 02:10 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Taddypole, Today, 02:47 PM
        0 responses
        5 views
        0 likes
        Last Post Taddypole  
        Started by chbruno, 04-24-2024, 04:10 PM
        4 responses
        51 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Working...
        X