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 love2code2trade, 04-17-2024, 01:45 PM
    4 responses
    37 views
    0 likes
    Last Post love2code2trade  
    Started by alifarahani, Today, 09:40 AM
    2 responses
    13 views
    0 likes
    Last Post alifarahani  
    Started by junkone, Today, 11:37 AM
    3 responses
    16 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by pickmyonlineclass, Today, 12:23 PM
    0 responses
    3 views
    0 likes
    Last Post pickmyonlineclass  
    Started by frankthearm, Yesterday, 09:08 AM
    12 responses
    44 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Working...
    X