Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Save horizontal scaling on a chart

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

    Save horizontal scaling on a chart

    Hi,

    I'm using manually horizontal scaling on a chart like this documentation: https://ninjatrader.com/support/help...ng_a_chart.htm

    I can do it manually but every time I change the instrument or reaload historic data or ninjascript I must do it again.

    What I need is to have a concrete number of bars visible in the chart window, I mean that X numbers of bars must fill the entire visible area of the chart window.

    I would like to save in a template or somehow that a concrete chart window will show X bars at same time. I'm not talking about loaded bars in the chart (in Data Series), I mean visible bars in the screen.

    Is there someway to do it?

    Thank you for your help.

    Regards


    #2
    If we assume that no other items have been added to the chart and it is strictly a single data series, I would expect that the same amount of bars would exist in the same size chart window with a horizontal scale that has not changed. Here is a short video example of a 5 second chart which always maintains 10 bars in view even after switching instruments and reloading data:Can you elaborate about whats different about your chart compared to my video and also steps you're taking that are resulting in a different amount of bars being visible?

    Is the interval on your chart time based?

    Comment


      #3
      Hi,

      Thank you for replay. Yes, my chart is time based.

      If you are saying that It should work as the video without doing nothing special then is not doing the same. In my case it come back to previous scale when I change intrument or reload script/historial.

      I'm using a custom indicator that I develop (which implements OnRender), may be is because of that I didn't thought that this can affect. If that is the case I would like to know what I'm missing in the custom indicator to mantain scale. I attached three screenshots: one manually scaled and the next when I change instrument and the last when is loaded new instrument.

      Let me know if you need more information.

      Regards
      Attached Files

      Comment


        #4
        Based on your screenshots, it looks like the custom NinjaScript you have implemented has variable width based on market conditions. Since this indicator is introducing a variable width into the equation, it is expected that the amount of bars visible horizontally would change.

        I'd recommend posting in the NinjaScript forums or contacting us via email at PlatformSupport[AT]NinjaTrader[DOT]com if you'd like some assistance with your NinjaScript.

        Comment


          #5
          Ok Thank you I'll check!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by rocketman7, Today, 02:12 AM
          1 response
          16 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by briansaul, Today, 05:31 AM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by PaulMohn, Today, 03:49 AM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by frslvr, 04-11-2024, 07:26 AM
          6 responses
          106 views
          1 like
          Last Post NinjaTrader_BrandonH  
          Started by trilliantrader, 04-18-2024, 08:16 AM
          6 responses
          26 views
          0 likes
          Last Post trilliantrader  
          Working...
          X