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

Is there a data structure that holds Close,Open,Low, High of a bar?

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

    Is there a data structure that holds Close,Open,Low, High of a bar?

    Hi,

    Is there a single data structure that holds Close,Open,Low, High of a bar?
    I want to pass all this parameters to a function and wanted to know if there is a data structure in NT that include those parameters for the current bar.
    For example the Bars[0] return a double which is not what I need.

    Thanks in advance!

    #2
    I think I found a solution:
    Transfer to the function a reference of the indicator and then have access to the Close,Low etc.
    In the call for the function within the indicator use (this);
    Last edited by freewind; 02-27-2011, 06:55 AM.

    Comment


      #3
      Your method will have access to an Indicator/Strategy OHLCV and Time properties.

      For example:

      private void YourMethod()
      {
      double open = Open[0];
      double close = Close[0];
      }

      etc...
      RayNinjaTrader Customer Service

      Comment


        #4
        I'm referring to an external class(not inherit from Indicator) within the Indicator namespace.

        Comment


          #5
          Originally posted by freewind View Post
          I'm referring to an external class(not inherit from Indicator) within the Indicator namespace.
          I thought that that structure would be the Bar itself.

          Comment


            #6
            When you call your function/method, can't you just pass in the most recent bar's data?
            AustinNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by BIOK.NT, Yesterday, 01:56 PM
            3 responses
            15 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by betsuni_123, Yesterday, 04:20 PM
            1 response
            18 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by actualfacts.2021, 07-25-2021, 03:11 PM
            9 responses
            1,194 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by NinjaTrader_ChelseaB, 03-14-2017, 10:17 AM
            228 responses
            34,325 views
            7 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Philippe56140, 04-27-2024, 02:35 PM
            8 responses
            67 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Working...
            X