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

Syntax for a Close within multi types on one Chart

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

    Syntax for a Close within multi types on one Chart

    I have multiple bar types on one chart- Range, Volume and time. I need to know the proper syntax for the close of a 14 Range bar. I am thinking it may look similar to :
    (Instrument, PeriodType.Range, 14,Close);
    I have looked through the Contents for NT7 but the only thing it has are for single time frames on a chart.

    #2
    Or would it be this... double ES14RangeClose = Close[0];

    Comment


      #3
      Hello RJBen,

      Thanks for your post.

      For an indicator to access other bars objects, those need to be added to the indicator (even though they may already be on the chart, the indicator only has access to the initial (base) chart series. You can add a dataseries to the script through the following:

      Add() https://ninjatrader.com/support/help.../nt7/?add3.htm

      Once the data is added to the script, you can then reference the added data series either by its BarsArray[n] or by the plural of Open, High, Low or Close. For example to refer to the first added dataseries you can use Closes[1][0] which points to the first added dataseries [1] and the current bar [0] of that data series.

      A multi-series or time frame script has many requirements and it is recommended that you review the entire helpguide section for this to understand all of the references:



      edit: Removed references to NT8.
      Last edited by NinjaTrader_PaulH; 04-11-2018, 09:00 AM.
      Paul H.NinjaTrader Customer Service

      Comment


        #4
        It is for NT7.
        What I need to do is make a variable and assign it the value of the Close of the 14 Range bar. Then based on that Close, compare whether it is <= or >= various levels on my chart to determine whether they are Support or Resistance levels.

        Comment


          #5
          Hello RJBen,

          Thanks for your reply.

          We've moved your thread into the NT7 section and I will remove the NT8 references and links in my previous post.

          Adding a data series to your script will cause it to be a multi time frame script and the helpguide link for the multi time frame that is in the prior post will detail what you need to do to access the close value of the added data series.
          Paul H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by usazencort, Today, 01:16 AM
          0 responses
          1 view
          0 likes
          Last Post usazencort  
          Started by kaywai, 09-01-2023, 08:44 PM
          5 responses
          603 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by xiinteractive, 04-09-2024, 08:08 AM
          6 responses
          23 views
          0 likes
          Last Post xiinteractive  
          Started by Pattontje, Yesterday, 02:10 PM
          2 responses
          22 views
          0 likes
          Last Post Pattontje  
          Started by flybuzz, 04-21-2024, 04:07 PM
          17 responses
          230 views
          0 likes
          Last Post TradingLoss  
          Working...
          X