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 benmarkal, Yesterday, 12:52 PM
    3 responses
    22 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by helpwanted, Today, 03:06 AM
    1 response
    17 views
    0 likes
    Last Post sarafuenonly123  
    Started by Brevo, Today, 01:45 AM
    0 responses
    11 views
    0 likes
    Last Post Brevo
    by Brevo
     
    Started by aussugardefender, Today, 01:07 AM
    0 responses
    6 views
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    244 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Working...
    X