Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

TickCount

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

    #16
    Hello,

    it is working OK in an indicator. But how do I have to modify please when I want to use it in a script-strategy for BIP==2?

    RSI1 = RSI(Closes[0], 5, 1);
    VOL1 = VOL(Closes[2]);
    myIntSeries = new Series<int>(this, MaximumBarsLookBack.Infinite); <----- ???

    What do I have to modify in state.dataloaded please so that the "myIntSeries" which I use for TickCount is counting from the correct dataseries (BIP=2)?

    Or is it enough and OK to have in OnBarUpdate
    if(BarsInProgress==2)
    {myIntSeries[2] = Bars.TickCount;
    ...
    }
    or isn´t this correct please?


    Thank you!
    Tony
    Last edited by tonynt; 05-27-2021, 05:47 AM. Reason: wrong translation

    Comment


      #17
      Hello tonynt,

      secondarySeries = new Series<int>(SMA(BarsArray[2], 50));
      secondarySeries[0] = BarsArray[2].TickCount;

      Please see the reference sample 'Synchronizing a DataSeries object to a secondary time frame'.
      https://ninjatrader.com/support/help...series_obj.htm
      Last edited by NinjaTrader_ChelseaB; 05-27-2021, 08:26 AM.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #18
        Hello,

        thank you for your reply. Sorry I do not understand to modify
        myIntSeries = new Series<int>(this, MaximumBarsLookBack.Infinite);
        from
        secondarySeries = new Series<double>(SMA(BarsArray[2], 50)); (which I have from that link already)

        --> ?? myIntSeries = new Series<int>(BarsArray[2], MaximumBarsLookBack.Infinite); <-- ??

        Thank you!
        Tony

        Comment


          #19
          Hello Tony,

          The indicator call to the SMA using BarsArray[2] synchronizes to BarsInProgress 2, which is used to generate the custom series which is also synchronized to BarsInProgress 2.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #20
            Hello,

            thank you for your reply. I understand the sample with the SMA but I dont know if this here is ok now:"myIntSeries = new Series<int>(BarsArray[2], MaximumBarsLookBack.Infinite);"

            Thank you!
            Tony

            Comment


              #21
              Hello Tony,

              No, what you have now is not ok, as this is not using an indicator to synchronize to a secondary series.

              Please see the example
              new Series<double>(SMA(BarsArray[2], 50))


              Chelsea B.NinjaTrader Customer Service

              Comment


                #22
                Hello,

                thank you for your reply. I have imported the sample and tried to understand form it.

                I do understand from the syntax working with the SMA for BarsArray[2] but, sorry, I do not understand to modify the "MaximumBarsLookBack.Infinite".

                Is this OK please (I have a hard time to understand everything accurately in english, even more this syntax I have never used before " Max....LookBack.Infinite")

                myIntSeries = new Series<int> (MaximumBarsLookBack(BarsArray[2],Infinite));
                "looks like"
                secondarySeries = new Series<double>(SMA (BarsArray[1], 50));

                Thank you!
                Tony






                Comment


                  #23
                  Hello Tony,

                  MaxiumumBarsLookBack controls how many bars will be loaded for the secondary series. This is not a method, this is a property.

                  SMA is an indicator called as a method.

                  To this with maximumbarslookback this would appear as:

                  secondarySeries = new Series<double>(SMA (BarsArray[1], 50), MaximumBarsLookBack.Infinite);

                  new Series<double>(bars, maximumBarsLookBack);
                  Last edited by NinjaTrader_ChelseaB; 05-31-2021, 10:11 AM.
                  Chelsea B.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  581 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  338 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  103 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  554 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  552 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X