Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Zoom in in the code

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

    Zoom in in the code

    Hello,

    I would like to know if there is a way to zoom in on a particular trading day but in the code.

    For example I would like to programatically zoom the chart on today's trading.

    Probably I would have to play with ChartControl and Y axis.

    I know that it may be not supported but just a hint would be welcomed !


    Thanks

    #2
    I'm not sure exactly how you would want it to function, but I would start by looking at BarSpace, Time, LastBarPainted and FirstBarPainted.

    Just a guess.

    VT

    Comment


      #3
      I played a bit with LastBarPainted and firstbarPainted.
      I was able to get only the day that I wanted to show. (which was 3 days ago)
      So far so good. BUT putting the BarsSpace to 50 displayed only today or last day region.

      The next step would be how to scroll to the day that I want to show (3 days ago).

      I have somehow to move the XAxis to that day. How can I do that in code ?

      Thanks

      Comment


        #4
        Blar58,

        While there is not a supported method to control the X Axis, I would suggest taking a look at this ChartScale indicator to get an idea of how this user was able to control the Y axis. Hopefully this will give you some ideas on how to proceed with your custom script:

        MatthewNinjaTrader Product Management

        Comment


          #5
          Blar58,

          Using this in OnStartUp, seems to set the LastBarPainted and scrolls the chart back.

          ChartControl.LastBarPainted = 500;

          So you would need to find the last bar for the day you want to go to.
          Calculate the number of bars for the day, and set the bar spacing appropriately.

          Something like that anyway.

          VT
          Last edited by VTtrader; 09-22-2011, 09:50 AM.

          Comment


            #6
            VTTrader

            Thank you very much. You put me on the right track and I found the solution

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            581 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            338 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            554 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            552 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X