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 CaptainJack, 05-29-2026, 05:09 AM
          0 responses
          175 views
          0 likes
          Last Post CaptainJack  
          Started by CaptainJack, 05-29-2026, 12:02 AM
          0 responses
          91 views
          0 likes
          Last Post CaptainJack  
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          130 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          210 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          186 views
          0 likes
          Last Post CarlTrading  
          Working...
          X