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

Creating a Time Based Indicator for my Range Chart

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

    Creating a Time Based Indicator for my Range Chart

    Hi,

    I'm trying to work out how I can get minute or 5 minute volume on my range chart. I saw this video http://www.youtube.com/watch?v=x_6BN5SIiig about putting multiple datasets on my chart, but that was causing problems. As soon as I put the 5 minute data series on my range chart all the candles were bunched up or spread out and the chart was not usable.

    Is there a way I can programmatically add a time based dataseries to my chart, then use one of the volume indicators to get the volume I require?

    Any other suggestion or method would be helpful too,

    thanks,
    Will.

    #2
    Hi Will, yes that would be expected since the equidistant bars spacing option then cannot be used, as you would have to align the different series strictly by time.

    You can Add() the series through internally so you have it for calculation but it would not be charted with your indicator then - http://www.ninjatrader.com/support/h...s/nt7/add3.htm

    The downside then is that you would not be able to select this series from the UI to run another indicator on it like you mentioned - however you could run the indicator on the series internally and then display the values for example via the drawing objects on the chart to highlight conditions seen that you wish to correlate with the primary Range chart.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      ok, so I can add the data series and it wont be plotted but I can use it for calculation... thats just what i want. But, I would then need access to volume data calculated using the 5 min dataseries, not the range chart dataseries. how would i do that?

      Thanks,
      Will.

      Comment


        #4
        Correct, there's two things then coming into play - which bars array you would want to access and at which update event you want to access it.

        The first would be defined via BarsArray[x] in NinjaScript - http://www.ninjatrader.com/support/h.../barsarray.htm

        The second would be done by specifying to act in which BarsInProgress - http://www.ninjatrader.com/support/h...inprogress.htm

        So if you have your range chart as primary you would access the BarsArray[1] data in BarsInProgress == 0.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Thanks for that, I am making some progress. I've added the series to my indicator and I am trying to get the volume levels.

          this works, to get the volume of the current bar

          double vol5min0=VOL(BarsArray[1])[0];

          but trying to get volume for barsago is giving me and index error

          double vol5min1=VOL(BarsArray[1])[1];

          Do I have the indexing or the syntax wrong here?

          Thanks,
          will.

          Comment


            #6
            I figured out the problem, I was trying to calculate volume at 1 barsago for bar 0, I forgot to put my filter

            if (CurrentBar >=...)

            Thanks.

            Comment


              #7
              Thanks for the update Will.
              BertrandNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Segwin, 05-07-2018, 02:15 PM
              14 responses
              1,789 views
              0 likes
              Last Post aligator  
              Started by Jimmyk, 01-26-2018, 05:19 AM
              6 responses
              837 views
              0 likes
              Last Post emuns
              by emuns
               
              Started by jxs_xrj, 01-12-2020, 09:49 AM
              6 responses
              3,293 views
              1 like
              Last Post jgualdronc  
              Started by Touch-Ups, Today, 10:36 AM
              0 responses
              13 views
              0 likes
              Last Post Touch-Ups  
              Started by geddyisodin, 04-25-2024, 05:20 AM
              11 responses
              63 views
              0 likes
              Last Post halgo_boulder  
              Working...
              X