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

Detect Horizontal Scrolling / "Play Icon"

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

    Detect Horizontal Scrolling / "Play Icon"

    Hi,

    i'm developing my own Volume Flow Indicator. I works good, but i try to do some improvements.

    When showing current bar/price (i use tick charts and bars), the chart is scrolling vertical with the price to see the current price bar on the chart window. that's default on all charts.
    When i scroll back to the past(horizontal scrolling), i will get this "play icon" in the top right corner, thats clickable to scroll to the current bar.

    Is it possible with ninja script to get the info, that i have scrolled to the past? I need this, to turn off my "auto centering mode". When i watch the current bar, auto centering mode is working perfectly to have at least the current bar centered on screen. But when i scroll to the past, i want to turn off the centering OR i want to centering the last bar to the right, that would be the best option. but turning off would be ok.

    So, is it possible to find out that my chart is not showing the current bar because i scrolled to the past?


    Greetings,
    Tom

    #2
    Hello Tom299,

    Thank you for writing in and welcome to the NinjaTrader Support Forum!

    What you can do is compare the value of CurrentBar to the value of this undocumented code: this.LastBarIndexPainted.

    If this.LastBarIndexPainted is less than CurrentBar, this would denote that the CurrentBar isn't being painted on the chart and, therefore, you have scrolled back.

    For more information about CurrentBar, please take a look at this help guide link: https://ninjatrader.com/support/help...currentbar.htm

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Hi Zachary,

      thank you very much, it works fine with LastBarIndexPainted :-)


      One more question: is it possible to react on the event when the user clicks the "F" in the upper right scale to reset zooming etc? I would like to center and resize my indicator at this point too.


      Greetings,
      Tom

      Comment


        #4
        Hello Tom299,

        I do not know of a way how this can be accessed in NinjaTrader 7.

        However, NinjaTrader 8 will allow one to access this property. NinjaTrader 8 provides documentation on both ChartPanel and ChartScale classes:



        You'd be able to access this with YAxisRangeType, Fixed being the enum value that denotes an "F" appearing on the chart.

        Please, let us know if we may be of further assistance.
        Zachary G.NinjaTrader Customer Service

        Comment


          #5
          Thank you for this info

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by bortz, 11-06-2023, 08:04 AM
          47 responses
          1,603 views
          0 likes
          Last Post aligator  
          Started by jaybedreamin, Today, 05:56 PM
          0 responses
          8 views
          0 likes
          Last Post jaybedreamin  
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          18 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          4 views
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          12 views
          0 likes
          Last Post Javierw.ok  
          Working...
          X