Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

[x] = [x] or [x] <> [x]

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

    [x] = [x] or [x] <> [x]

    Hello,

    in coding for NinjaTrader Stragies for "within x-bars" there´s to code with [x].

    For "bars ago" there´s to code with [x]. ALSO!


    So, how one knows when [x] means "within x-bars" and when [x] means "bars ago". Which indicators, which codes, which conditions work "[x] within" or "[x] bars ago"

    Thanks
    Tony

    #2
    Tony, I thought we already discussed this extensively in your other thread on the same topic - you have to differentiate between barsAgo (exact) and a lookback period - to see what indicator offers which overloads and paramters, please use the NinjaScript language reference we have (F1 in the software to enter the helpguide).

    Thanks,
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hello,

      back to office I see you reply. After 1 year free-license-user and another year lifetime-member let me answer as follows: "discussed" doesn´t mean necessarily "answered".

      NT determines 2 different approaches "x bars ago" and "within x bars" both with [x] and you answer the question "how to recognize which one...." with F1 key? There should be some system which kind of indicators or conditions have then "within.." or "...ago". If you name both dogs same nickname which one you call to action??

      Please don´t tell me there´s to differentiate between barsago and lookback period - for your information I know. How could I do the question if I wouldn´t???

      AND I also have no - correct - answer to the question if the [3] in the example Stochastics(BarsArray[1], 3,5,2).D[3] < 70

      refers to the dataseries used in the strategy or the added dataseries BarsArray[1].

      (Moreover I don´t know if it means stochastics within last 3 bars or 3 bars ago lower 70)

      Best
      Tony

      Comment


        #4
        Tony, you can differentiate between barsAgo and lookback period as parameter by either reviewing the overload used in the helpguide or by following Intellisense as it guides you through the expected parameters for the call.

        For working in a MultiSeries environment the BarsInProgress context is paramount - http://www.ninjatrader.com/support/h...inprogress.htm

        The snippet you posted refers to the exact stochastic plot D value 3 bars of the input array ago.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Hello,

          thank you for your reply. So after the discussion about definitions we can come to the concrete question: how can I do then for having stochastic plot D value 3 bars "within 3 bars"?

          Best
          Tony

          Comment


            #6
            You could for example check with a loop running through the bars back index, or you could code this specifically out for D[0, D[1], D[2] and D[3] in your condition, so it would return true for all the bars back you're interested in.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              You mean like:

              "Return true if the value of the Stochastic D plot has been ValueX within the last 3 bars"?

              Comment


                #8
                Hello,

                the concrete question - for this there was to find out when NinjaTrader works as "within" or "bars ago" - is how to code that WHEN there occurs stockKcrossD THEN eg stochK is below 25.

                I know that in stockKcrossD we have lookback period and with stockD<25 we have bars ago determination so I conclude now for having a cross within last 3 bars and at this moment of time also stochKD was below a certain value I have to code 3 conditions for entries (every bar a condition) to match both cross and below and to grab it if it occured last bar or 2 bars before or 3 bars before.

                Best
                Tony

                Comment


                  #9
                  Hi Tony, take for example the simple snippet below - if the DoubleStochastic Period 10 crosses above the 30 level it would hold true this condition for 3 bars :

                  if (CrossAbove(this.DoubleStochastics(10), 30, 3))
                  DrawArrowUp("sig" + CurrentBar, true, 0, Low[0] - TickSize, Color.Blue);
                  BertrandNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by mgco4you, Today, 09:46 PM
                  1 response
                  3 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by wzgy0920, Today, 09:53 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post wzgy0920  
                  Started by Rapine Heihei, Today, 08:19 PM
                  1 response
                  8 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by Rapine Heihei, Today, 08:25 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post Rapine Heihei  
                  Started by f.saeidi, Today, 08:01 PM
                  1 response
                  9 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Working...
                  X