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 Taddypole, Today, 02:47 PM
          0 responses
          0 views
          0 likes
          Last Post Taddypole  
          Started by chbruno, 04-24-2024, 04:10 PM
          4 responses
          50 views
          0 likes
          Last Post chbruno
          by chbruno
           
          Started by TraderG23, 12-08-2023, 07:56 AM
          10 responses
          398 views
          1 like
          Last Post beobast
          by beobast
           
          Started by lorem, Yesterday, 09:18 AM
          5 responses
          22 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by WHICKED, Today, 12:56 PM
          2 responses
          15 views
          0 likes
          Last Post WHICKED
          by WHICKED
           
          Working...
          X