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 CarlTrading, 03-31-2026, 09:41 PM
            1 response
            156 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            90 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            138 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            130 views
            1 like
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            107 views
            0 likes
            Last Post CarlTrading  
            Working...
            X