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 GLFX005, Today, 03:23 AM
            0 responses
            1 view
            0 likes
            Last Post GLFX005
            by GLFX005
             
            Started by XXtrader, Yesterday, 11:30 PM
            2 responses
            11 views
            0 likes
            Last Post XXtrader  
            Started by Waxavi, Today, 02:10 AM
            0 responses
            6 views
            0 likes
            Last Post Waxavi
            by Waxavi
             
            Started by TradeForge, Today, 02:09 AM
            0 responses
            12 views
            0 likes
            Last Post TradeForge  
            Started by Waxavi, Today, 02:00 AM
            0 responses
            2 views
            0 likes
            Last Post Waxavi
            by Waxavi
             
            Working...
            X