Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Swing stop issue

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

    Swing stop issue

    The swing stops can exit a position but it looks like there are cases where the swing stop goes in at the same price as the entry price and immediately takes off the new position, or price moves and the swing stop goes in a tick above price for a long for example and cancels the order.

    Screenshot of strategy analyzer https://i.gyazo.com/7f18fa2bf9fea473...5876d59dfb.png

    Cancel code from log https://i.gyazo.com/33b355267c0d256f...23ff1e63bc.png

    Screenshot of swing code https://i.gyazo.com/c7f519e2d11dc6bd...8d7b423a8e.png
    Last edited by brucelevy; 09-19-2015, 07:01 PM.

    #2
    Hello brucelevy,

    Thank you for your post.

    You would need a check that the swing high or low does not equal the current price level. Such as:
    Code:
    if(Close[0] != Swing(5).SwingLow[0])

    Comment


      #3
      Thanks, how can I modify it to not only to place stops at the swing low but also for example -10 ticks below that swing low?

      Comment


        #4
        Hello brucelevy,

        Use TickSize: http://ninjatrader.com/support/helpG...7/ticksize.htm
        Code:
        SetStopLoss(CalculationMode.Price, Swing(5).SwingLow[0] - 10 * TickSize);

        Comment


          #5
          Thanks, worked great.. Do the swing stops and trailing stops work in backtesting the strategy analyzer? (nonatm)

          Comment


            #6
            Hello brucelevy,

            Thank you for your response.

            The stops we defined would work in backtesting.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            56 views
            0 likes
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            143 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            160 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 05-10-2026, 08:12 PM
            0 responses
            96 views
            0 likes
            Last Post CarlTrading  
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            276 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Working...
            X