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 Christopher_R, Today, 12:29 AM
    0 responses
    6 views
    0 likes
    Last Post Christopher_R  
    Started by sidlercom80, 10-28-2023, 08:49 AM
    166 responses
    2,235 views
    0 likes
    Last Post sidlercom80  
    Started by thread, Yesterday, 11:58 PM
    0 responses
    3 views
    0 likes
    Last Post thread
    by thread
     
    Started by jclose, Yesterday, 09:37 PM
    0 responses
    7 views
    0 likes
    Last Post jclose
    by jclose
     
    Started by WeyldFalcon, 08-07-2020, 06:13 AM
    10 responses
    1,415 views
    0 likes
    Last Post Traderontheroad  
    Working...
    X