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?

    BertrandNinjaTrader Customer Service

    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 -

        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rbeckmann05, Yesterday, 06:48 PM
        1 response
        12 views
        0 likes
        Last Post bltdavid  
        Started by llanqui, Today, 03:53 AM
        0 responses
        6 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        10 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        15 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Working...
        X