Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Swing indicator

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

    Swing indicator

    I'm trying to work with the swing indicator and I want to get the value of it. As I read on the help guide: "A return value of 0 (zero) will be returned if the CurrentBar is less than the "strength" value or a swing pivot has not yet been found"

    I'm using this to get the value: Swing(int strength).SwingHigh[int barsAgo]

    The problem is that I want to know when a swing happened. So, I expected the value to be zero if the conditions for the swing don't accomplish. But I see that the indicator gets the value of the last swing and this value is kept till a new swing happens. I'm Wrong?

    Perhaps the only way to know when a new swing happens is to check if the value changes. That's right?

    #2
    Hello guillembm,
    Thanks for writing in and I am happy to assist you.

    To know when the swing happened please use the snippet
    Swing(int strength).SwingHighBar(int barsAgo, int instance, int lookBackPeriod)


    For example to know the at what bar the last swing happened, with a lookback of 50, then please use the below code.

    Code:
    int barsAgo = Swing(5).SwingHighBar(0,1,50);
    //print the high value of the bar
    Print(High[barsAgo]);
    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    61 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    40 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    21 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    23 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    51 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X