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 kinfxhk, 07-14-2026, 09:39 AM
    0 responses
    18 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    60 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    43 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    47 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    38 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X