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

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.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          thanks for replies

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Waxavi, 04-19-2024, 02:10 AM
          4 responses
          55 views
          0 likes
          Last Post sonia0101  
          Started by cmtjoancolmenero, Today, 03:58 PM
          0 responses
          8 views
          0 likes
          Last Post cmtjoancolmenero  
          Started by Segwin, 05-07-2018, 02:15 PM
          11 responses
          1,777 views
          0 likes
          Last Post aligator  
          Started by trilliantrader, Today, 03:01 PM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by geddyisodin, Today, 05:20 AM
          6 responses
          39 views
          0 likes
          Last Post geddyisodin  
          Working...
          X