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:	172
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 argusthome, 03-08-2026, 10:06 AM
        0 responses
        71 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        43 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        25 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        28 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        56 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X