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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        102 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        144 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        71 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        125 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        79 views
        0 likes
        Last Post PaulMohn  
        Working...
        X