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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    89 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    135 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X