Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem with SWING indicator

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

    Problem with SWING indicator

    I have 2 questions:

    1) I am interested, why the
    Code:
    private Series<double> SwingHighPlot
    are private in Swing indicator? It would be good, if you made them public, as we could access that from other indicators..

    2) we know, that Swing indicator uses 0 as return value, when "..CurrentBar number is less than the "strength" value..." .. SO, how we can differ that 0 value from the case, when SwingLow(or SwingHigh) value of the stock is actually at 0 line...
    Last edited by ttodua; 03-16-2017, 04:23 PM.

    #2
    Hello,

    Thank you for the post.

    In this case, the SwingHighPlot is used for Plotting purposes in the indicator and then there is the SwingHigh series which is public and the documented method to call. http://ninjatrader.com/support/helpG...lightsub=swing

    This would just be how this item is programmed, this prevents users from utilizing the plot that was not intended for signal use. You could certainly duplicate this indicator and make the plot public if you see a reason to do so.

    For your second question, are you asking what logic would be required to change the swing indicator to differentiate these two different times in the logic? If so, you would likely need to make a duplicate of the swing indicator and append some logic where the current bar is less than the strength and set a variable to know that. Once you are out of this period, you could reset a variable to a different value to know it changed.

    Please let me know if I may be of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by selnomeria View Post
      2) we know, that Swing indicator uses 0 as return value, when "..CurrentBar number is less than the "strength" value..." .. SO, how we can differ that 0 value from the case, when SwingLow(or SwingHigh) value of the stock is actually at 0 line...
      (Uh, not sure what you really mean by 'value of the stock is actually at 0 line'. The Swing indicator is returning bar numbers, using the word '0 line' in your question makes no sense to me.)

      Because 0 is never valid anyways. Ever.

      The algorithm simply does not allow 0 to be returned as a
      valid 'bar number where a swing has occurred'.

      Why?

      The definition of a Swing High is:

      all High values for N bars to the left are less than the Swing bar's High
      all High values for N bars to the right are less than the Swing bar's High
      (where N is the "Strength" parameter)

      Ok, so think about this: if N is 5 then we need at least 5 bars
      to appear to satisfy the "left side" requirement. Thus, returning
      any valid value of 0 through 4 (aka Strength-1) is technically
      impossible, so the indicator returns 0 for all of them.

      That's what this means:
      * A return value of 0 (zero) will be returned if the CurrentBar number is less than the "strength" value, or a swing pivot has not yet been found.

      When N is 5 the first possible bar for a swing to occur is the 6th bar.
      (But the Swing indicator won't know that until 11 bars have closed, it
      needs 5 bars to the left of bar 6, and another 5 bars to the right of bar
      6, for a total of 11 closed bars, to confirm bar 6 was, in fact, a swing.)

      Also, the minimum value of N (aka Strength) is 1, so you need at least
      one bar to appear (which is bar 0) for bar 1 to be a swing (which if N=1
      is known only at the close of bar 2).

      (Recall bar numbering starts at 0, not 1, so the very first bar is bar 0,
      the second bar is bar 1, and so on.)

      Make sense?
      Last edited by bltdavid; 03-18-2017, 11:04 PM.

      Comment


        #4
        Btw, would support please consider changing the word "pivot" to "point".

        See here:


        Current Wording:
        A return value of 0 (zero) will be returned if the CurrentBar number is less than the "strength" value, or a swing pivot has not yet been found.

        Proposed Wording:
        A return value of 0 (zero) will be returned if the CurrentBar number is less than the "strength" value, or a swing point has not yet been found.

        Swings are "swing points", not pivots. They are not the same thing, the words are not interchangeable (well, they're not supposed to be.)

        There is already enough confusion out in the wild where people say "pivot" but they mean "swing" -- I think NT documentation should be precise as possible.

        The word "pivot" is already well-defined, there is even an indicator named "Pivots" --
        but too many people have hijacked the word "pivot" when they should be saying "swing".

        Just my 2˘ on the matter.
        Last edited by bltdavid; 03-18-2017, 11:06 PM.

        Comment


          #5
          Originally posted by bltdavid View Post
          Btw, would support please consider changing the word "pivot" to "point".

          See here:


          Current Wording:
          A return value of 0 (zero) will be returned if the CurrentBar number is less than the "strength" value, or a swing pivot has not yet been found.

          Proposed Wording:
          A return value of 0 (zero) will be returned if the CurrentBar number is less than the "strength" value, or a swing point has not yet been found.

          Swings are "swing points", not pivots. They are not the same thing, the words are not interchangeable (well, they're not supposed to be.)

          There is already enough confusion out in the wild where people say "pivot" but they mean "swing" -- I think NT documentation should be precise as possible.

          The word "pivot" is already well-defined, there is even an indicator named "Pivots" --
          but too many people have hijacked the word "pivot" when they should be saying "swing".

          Just my 2˘ on the matter.
          Hm. Not quite sure that I agree with you there about "pivot". NT's use in the context is correct, in consonance with the ordinary English meaning of the word: in the context of a chart, that is the point at which the joining line changed direction (making your use of "point" also correct, of course).

          I think you did highlight the real issue. The meaning of "pivot" has been misappropriated by the trading fraternity, to use to describe something where there is actually scarcely ever a pivot, in the English meaning of the word. Hence we have a "Pivots" indicator where the lines that are so-called pivots almost never indicate a change in direction anyway. That being said, the trader's lingo is full of other such misappropriated words too. Examples:
          • "fractal" - identifying bars formations with a SwingStrength of 2. That has nothing to do with what Mandelbrot described when he coined the word.
          • "stochastics" - a reference to statistical sample spaces and randomness. That has nothing to do with what Bernoulli described, and George Lane's calculation of the relative close over a period.
          • "momentum" - a measure of mass times velocity. What traders describe as momentum does not even qualify as velocity: it is simply a measure of distance!

          Can someone add to the list?

          Comment


            #6
            good explanation, thanks !!!!!!!!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by helpwanted, Today, 03:06 AM
            1 response
            7 views
            0 likes
            Last Post sarafuenonly123  
            Started by Brevo, Today, 01:45 AM
            0 responses
            7 views
            0 likes
            Last Post Brevo
            by Brevo
             
            Started by aussugardefender, Today, 01:07 AM
            0 responses
            5 views
            0 likes
            Last Post aussugardefender  
            Started by pvincent, 06-23-2022, 12:53 PM
            14 responses
            242 views
            0 likes
            Last Post Nyman
            by Nyman
             
            Started by TraderG23, 12-08-2023, 07:56 AM
            9 responses
            384 views
            1 like
            Last Post Gavini
            by Gavini
             
            Working...
            X