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 Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            633 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            364 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            567 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            568 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X