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

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 Karado58, 11-26-2012, 02:57 PM
    8 responses
    14,825 views
    0 likes
    Last Post Option Whisperer  
    Started by Option Whisperer, Today, 09:05 AM
    0 responses
    1 view
    0 likes
    Last Post Option Whisperer  
    Started by cre8able, Yesterday, 01:16 PM
    3 responses
    11 views
    0 likes
    Last Post cre8able  
    Started by Harry, 05-02-2018, 01:54 PM
    10 responses
    3,203 views
    0 likes
    Last Post tharton3  
    Started by ChartTourist, Today, 08:22 AM
    0 responses
    6 views
    0 likes
    Last Post ChartTourist  
    Working...
    X