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

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 ScottWalsh, 04-16-2024, 04:29 PM
            6 responses
            27 views
            0 likes
            Last Post ScottWalsh  
            Started by frankthearm, Today, 09:08 AM
            10 responses
            35 views
            0 likes
            Last Post frankthearm  
            Started by GwFutures1988, Today, 02:48 PM
            0 responses
            2 views
            0 likes
            Last Post GwFutures1988  
            Started by mmenigma, Today, 02:22 PM
            1 response
            3 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by NRITV, Today, 01:15 PM
            2 responses
            9 views
            0 likes
            Last Post NRITV
            by NRITV
             
            Working...
            X