Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Previous High not correct using Swing Indicator

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

    Previous High not correct using Swing Indicator

    Dear Support

    i am using Swing Indicator to get the previous High, however, there is an issue, apparently.

    if you see screenshot, although there is a new Swing High and the data box shows the correct value, when asking for
    SwingHigh[0] i am getting an old Previous High, you can see that in the log output

    is there something wrong with my code?

    i am just saving the SwingHigh[0] at the moment of the entry signal in a variable and then comparing the Close[0] if it is above or below I exit the position

    Entering Short
    EnterShort(Position.Quantity * 2, "GoShort");
    PreviousMaxPosHigh = Swing1.SwingHigh[0];

    if (Position.Quantity >= MaxPositions && Close[0] > (PreviousMaxPosHigh))
    {
    ExitShort("Loss Max Position Hit", "GoShort");
    Print(Time[0].ToString() + " EXITING AT A LOSS - MAX POSITION REACHED AND DID NOT REVERSE TO THE EMA 100");
    }

    OR PERHAPS there is a better way to get the Previous High and Low?

    Thanks

    #2
    Hello jimmy_NT,

    Below are links to forum posts about getting previous swing values.
    Hello, I'm using the Swing indicator in my strategy and I'm having trouble finding information on how to access previous highs and lows. For example, using Swing(5).SwingHigh[0] will give me the most recent Swing High with a strength of 5, but I would like to know where the last x number of highs were so I can plot higher

    Hi - I trying to develop a strategy that needs to read the previous 2-3 swing high/low values in Swing indicator. It seems like the indicator itself doesn't memorize previous values. Would you please provide any adivce on how this can be done? Thank you!
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    32 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    195 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    356 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    277 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X