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 TheWhiteDragon, 01-21-2019, 12:44 PM
    4 responses
    543 views
    0 likes
    Last Post PaulMohn  
    Started by GLFX005, Today, 03:23 AM
    0 responses
    3 views
    0 likes
    Last Post GLFX005
    by GLFX005
     
    Started by XXtrader, Yesterday, 11:30 PM
    2 responses
    12 views
    0 likes
    Last Post XXtrader  
    Started by Waxavi, Today, 02:10 AM
    0 responses
    7 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Started by TradeForge, Today, 02:09 AM
    0 responses
    14 views
    0 likes
    Last Post TradeForge  
    Working...
    X