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 NullPointStrategies, Today, 05:17 AM
    0 responses
    51 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    129 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    69 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X