Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetStopLoss "confuses" strategy

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

    SetStopLoss "confuses" strategy

    Hi,

    I have a strategy that works fine, but it did not have any stoploss mechanism. I decided to add in a stop loss for testing purposes. I simply added in a SetStopLoss just prior to every instance of an Enter statement. I've done this before and sort of know what to expect.

    However, in this case, adding in the SetStopLoss statement caused all kinds of changes to to trades (historical at this point). For example, instead of a series of 3 reversals, there was now just one long trade, and the stop loss exit price never touched, never even came close.

    Are there any known issues with SetStopLoss? Any ideas where I might start looking for issues?

    Thanks.

    #2
    I had had the same problem, with EnterLongStop/EnterShortStop with calculated stopprice can resolve the issue.. in some cases you can get the same problem with this "workaround" but in lower percentage..

    Comment


      #3
      That could be the case depending on the order types in the strategy originally used, as adding Set methods into the mix opens up new internal order handling rules to be aware of - those would be detailed on the bottom section of this link -



      A useful tool for debugging your strategy order behavior occurring 'under the hood' would be TraceOrders -

      Comment


        #4
        Wyatt (or Bertrand if you understand what Wyatt means)...

        Can you explain briefly what you mean by "calculated stopprice can resolve issue"? Not following what you mean. Thanks.

        Thank you Bertrand. I'm fairly familiar with the order handling rules, and as best I can figure this is not the issue. In this strategy, once the first trade of the day is executed, there are no resting orders. Let's say I get long, then some bars later I get a short signal which places a limit order to sell. I either get filled or the limit order is canceled when next bar starts. So, I'm not seeing where there could be any order handling conflicts as when the SetStopLoss would trigger, there are no resting (or submitted) orders in the strategy at all.

        Comment


          #5
          coolmoss, wouldn't the marked case here be yours?

          Methods that generate orders to enter a position will be ignored

          if:• A position is open and an order submitted by an exit method (ExitLongLimit() for example) is active and the order is used to open a position in the opposite direction
          A position is open and an order submitted by a set method (SetStopLoss() for example) is active and the order is used to open a position in the opposite direction
          • The strategy position is flat and an order submitted by an enter method (EnterLongLimit() for example) is active and the order is used to open a position in the opposite direction
          • The entry signal name is not unique
          Last edited by NinjaTrader_Bertrand; 05-23-2012, 10:11 AM.

          Comment


            #6
            Bertrand,

            I live on a planet where no real use of the brain is in effect until after lunch!

            Thank you for walking me through that, very much appreciated.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            646 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            367 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            107 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            569 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            573 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X