Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Swing High Retracement

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

    Swing High Retracement

    Hey All-

    I am trying to get my strategy to take a trade once the price has retraced at least 50% of the distance between that last swing high and last swing low. I am having a little issue with the swing highs and lows.

    A long trade was placed during a backtest correctly at 4205 and the sell order was set correctly at the swing high of 4211.75. However, a new swing high was made at 4208 at the 7:36 bar and the sell limit was lowered and the trade was exited.

    However, the price continued upward and that swing high of 4208 disappeared with the swing high of 4211.75 becoming the swing high again.

    My swing strength is set to 3.

    Please see the attached photo. I am trying to figure out how the swing could change like that. I thought the indicator was a lagging one so it should only chart a swing if one was truly made and once the bar closes.

    If also included the code that handles my exits. I'm sure there is something I am doing wrong I just can't figure it out.

    Thank you,

    Nick
    Attached Files

    #2
    Hello njmeyer713,

    Thanks for your post.

    The Swing indicator plots can change due to how the swing works. The indicator goes back and rewrites the plots. This indicator is mostly a visual tool and not meant to be predictive in nature. This means this indicator is not meant to be used as a signal for placing orders. This is mentioned in the help guide page linked below.

    Swing: https://ninjatrader.com/support/help...html?swing.htm

    From the help guide: "The Swing indicator will plot lines that represent the swing points based on the strength (number of bars to the left and right of the swing point) parameter provided, it's mostly a visual tool and not meant to be predictive in nature. Only after the strength number of bars has passed since the extreme point, the swing return value could be definitely set, thus the indicator updates its calculations as new incoming data warrants so."

    You could consider using the SwingHighBar to get the specific values of the swings.

    Swing(ISeries<double> input, int strength).SwingHighBar(int barsAgo, int instance, int lookBackPeriod)

    Let me know if I may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bmaltz, Yesterday, 07:15 PM
    2 responses
    13 views
    0 likes
    Last Post bmaltz
    by bmaltz
     
    Started by iceman600, Yesterday, 01:51 PM
    4 responses
    25 views
    0 likes
    Last Post iceman600  
    Started by NinjaTrader_ChelseaB, 01-08-2017, 06:59 PM
    55 responses
    13,426 views
    3 likes
    Last Post grimes12  
    Started by Mindset, Yesterday, 05:43 AM
    4 responses
    36 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by brenton, Today, 08:31 PM
    0 responses
    15 views
    0 likes
    Last Post brenton
    by brenton
     
    Working...
    X