Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

last session

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

    last session

    Hallo to everyone

    I need a hint about how i could know if this is the last session on the chart.

    To explain more i'd like to :

    if( LastSession() ) { Print( ... ); }

    while the Print runs only during the last session

    Thanks in advance !

    #2
    voyager,

    There is no logic for you to know what is the last session on a chart per se. As the code is processing it sees each bar in sequence. When it is processing bar #100, it does not know that bar #1000 is the end. When you are on #1000 it still does not know it is the end, it just stops after that. Only way for you to know is if you explicitly tell your code you know exactly which date your chart ends on and then you can check against that specific date when processing the bars.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for replying

      I know these. Iwas wondering if there is a way to know the last bar's daytime even when processing the first.
      Something like ChartControl.LastBarPainted where holds the last painted bar (e.g. 88512) even when processing the first.

      Comment


        #4
        Unfortunately not aware of one, if you keep constant session times you would know when 'your' set daysession is ending...or you just add an input to the script where you enter for example the date of your last session on the chart and then check for this in the code to run your Prints.

        Comment


          #5
          thanks for replies

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          579 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          554 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X