Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Determine Scroll to last bar status

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

    Determine Scroll to last bar status

    Hi All,

    How can I determine programmatically from Ninjascript if the "Scroll to last bar" button is showing on the chart and whether its pointing left or right ?

    Thx !

    Click image for larger version

Name:	20220404_150850_WS2.png
Views:	113
Size:	1.8 KB
ID:	1196532

    #2
    Hello Bidder,

    You could compare the ChartBars.ToIndex to CurrentBar.

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Simple and effective. Thank you !

      Comment


        #4
        Update after testing in various scenarios:

        When called from Onbarupdate the comparison of ChartBars.ToIndex to Currentbar works well.
        When called from a timer, though, Currentbar displayed inaccurate values.
        After considering several alternatives I ultimately opted to switch out Currentbar for ChartBars.Count.
        This worked in all scenarios and was easy to implement.

        Here is the final result:

        Code:
        [FONT=Courier New]protected bool RightBarCurrent()
        {
          bool RtnBool = true;
          if (ChartBars.ToIndex+2<ChartBars.Count) RtnBool=false;
          return RtnBool;
        }[/FONT]
        Last edited by Bidder; 04-13-2022, 02:10 PM.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by arvidvanstaey, Today, 02:19 PM
        4 responses
        11 views
        0 likes
        Last Post arvidvanstaey  
        Started by samish18, 04-17-2024, 08:57 AM
        16 responses
        60 views
        0 likes
        Last Post samish18  
        Started by jordanq2, Today, 03:10 PM
        2 responses
        9 views
        0 likes
        Last Post jordanq2  
        Started by traderqz, Today, 12:06 AM
        10 responses
        18 views
        0 likes
        Last Post traderqz  
        Started by algospoke, 04-17-2024, 06:40 PM
        5 responses
        48 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X