Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Data for Current Date

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

    Data for Current Date

    I am trying to get the "close" price for today's date, but only seem to be able to get everyday prior to today.

    If I loop through dates using the below. Today's date never gets hit.

    protected override void OnBarUpdate()
    {
    MessageBox.Show(Times[0].ToString());
    }

    This is in a indicator script.

    Thanks in advance.

    #2
    Welcome to our forums here - which CalculateOnBarClose setting were you working with in your study?

    Comment


      #3
      Actually this seems to be working now!. Not sure if its just because of the time of day. Will check again later. In the Initialize function I have set CalculateOnBarClose = false;.

      While I have you is it possible to write scan scripts with NT? i.e loop through Instruments and do some calculations? Can you point me a document anywhere?

      Thanks!

      Comment


        #4
        Ok, yes if process on false > then it would mean the current bar process in OnBarUpdate() would be reflected otherwise it would reference the last fully closed bar.

        Yes, you can create so called MultiSeries (timeframe or instrument) scripts in NinjaTrader, we ship for example per default with the SampleMultiTimeFrame and SampleMultiInstrument strategies.

        A full documentation on the framework offered could be reviewed here -

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        93 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        48 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        31 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        34 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        70 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X