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

Testing Series Array Size

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

    Testing Series Array Size

    are there any guidelines for testing series array count > x

    including Closes, DataSeries in Properties, DataSeries in Variables etc.

    when you have multi-series e.g. BarsInProgress 0 & 1?

    have noticed that CurrentBars[0] > 0 doesn't always guarantee that a DataSeries Count will be > 0
    Last edited by futurenets; 02-27-2015, 06:15 AM.

    #2
    futurenets, is your data series in this case always synched to the primary series?

    To programmatically see if a value was set for the bar index, you can work with .ContainsValue

    BertrandNinjaTrader Customer Service

    Comment


      #3
      ok thanks

      The primary is daily and secondary is 60min.

      but I still don't think I've got this organisation clear?

      For each OnBarUpdate

      I wanted to calculate a series based on Close[0][0] when BarsInProgress=0

      and calculate a series using Close[1][0] when BarsInProgress=1 but this uses previous bar values.

      I don't my thinking right?

      Comment


        #4
        Hello,

        Thank you for the question.

        Can you please provide an example of the calculation you are doing in OnBarUpdate?

        I would like to see the logic you are using and what you are calculating so I can better understand where the hold up may be.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Originally posted by futurenets View Post
          ok thanks

          The primary is daily and secondary is 60min.

          but I still don't think I've got this organisation clear?

          For each OnBarUpdate

          I wanted to calculate a series based on Close[0][0] when BarsInProgress=0

          and calculate a series using Close[1][0] when BarsInProgress=1 but this uses previous bar values.

          I don't my thinking right?

          Have you synched your secondary barSeries?

          Comment


            #6
            Originally posted by NinjaTrader_Jesse View Post
            Hello,

            Thank you for the question.

            Can you please provide an example of the calculation you are doing in OnBarUpdate?

            I would like to see the logic you are using and what you are calculating so I can better understand where the hold up may be.

            I look forward to being of further assistance.

            No I haven't sync'd the secondary.

            I've attached a simplified indicator. Thank you.
            Attached Files

            Comment


              #7
              Hello,

              Thank you for the indicator, I do have a question on this.

              I see in your comments you have placed in BarsInProgress 0

              //here I want to reference data my 60 minute data ...

              I see that you are using the Daily data with the xDaily, how are you trying to reference the 60 minute data where you comment is?

              Are you asking how to use the 60 minute data in place of xDaily or is there some other code that goes in this section you are asking about that is not included?

              I see that the indicator is plotting on the chart so I wanted to verify what exactly is being checked that is showing the prior bars value.

              I look forward to being of further assistance.
              JesseNinjaTrader Customer Service

              Comment


                #8
                it may be easier to explain like this (I hope) ...

                if I created:

                iStoch60 = Stochastics(Closes[1], 3, 14, 7); //60 minute
                iStochD = Stochastics(Closes[0], 3, 14, 7); //daily

                iStochD[0] is current day & iStochD[1] is previous day
                iStoch60[0] the current hour current day & iStoch60[1] the previous hour current day

                to calculate hourly data based on daily data, need e.g. primary 60min plus secondary daily.
                Last edited by futurenets; 02-28-2015, 07:08 AM.

                Comment


                  #9
                  Hello futurenets,

                  Thank you for your response.

                  If I understand this thread correctly, you are looking to sync the each data series to a different bar series. We have an example of this at the following link: http://www.ninjatrader.com/support/f...ead.php?t=3572

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by cmtjoancolmenero, Yesterday, 03:58 PM
                  11 responses
                  39 views
                  0 likes
                  Last Post cmtjoancolmenero  
                  Started by FrazMann, Today, 11:21 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post FrazMann  
                  Started by geddyisodin, Yesterday, 05:20 AM
                  8 responses
                  52 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Started by DayTradingDEMON, Today, 09:28 AM
                  4 responses
                  26 views
                  0 likes
                  Last Post DayTradingDEMON  
                  Started by George21, Today, 10:07 AM
                  1 response
                  22 views
                  0 likes
                  Last Post NinjaTrader_ChristopherJ  
                  Working...
                  X