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 zstheorist, Today, 07:52 PM
        0 responses
        3 views
        0 likes
        Last Post zstheorist  
        Started by pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        149 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Started by mattbsea, Today, 05:44 PM
        0 responses
        5 views
        0 likes
        Last Post mattbsea  
        Started by RideMe, 04-07-2024, 04:54 PM
        6 responses
        33 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        5 views
        0 likes
        Last Post tkaboris  
        Working...
        X