• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Referencing Price Series

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

    Referencing Price Series

    Hi,

    I am trying to use the price series Open and Close from a different namespace. I keep getting a compile errors stating:

    The name 'Open' does not exist in the current context.
    The name 'Close' does not exist in the current context.

    What is the fully qualified name for these price series so that I may use them outside the indicator class?

    #2
    Hello Zeos6,

    The open and close series would need to come from a script.

    I would recommend you pass the instance of the script and use the series from the variable that holds the instance of the script.

    Print(myIndicator().Close[0]);

    I have an example that passes an instance of a script to an addon.
    https://ninjatrader.com/support/foru...686#post492686

    If you are trying to get a series without an instance of a script constructing the series for you, you will not be able to do so. Instead use a BarsRequest to query for bar data.

    Below is a public link to the help guide on BarsRequest.
    https://ninjatrader.com/support/help...arsrequest.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks, ChelseaB.

      The instance approach worked like a charm. Exactly what I needed. Appreciate it.
      Had to make a minor adjustment though: myIndicator.Close[0] rather than myIndicator().Close[0].
      Thank you ChelseaB.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by dariuszszyc, Today, 09:08 AM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_JoshG  
      Started by Sadat, Today, 09:09 AM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_JoshG  
      Started by login_dejavu, Today, 07:57 AM
      4 responses
      17 views
      0 likes
      Last Post login_dejavu  
      Started by Lender, Yesterday, 05:15 PM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_Jim  
      Started by rcmcd, Today, 07:52 AM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_PatrickG  
      Working...
      X