Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

stop not triggered

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

    stop not triggered

    Hello,

    in one of the rooms I´m in, the moderator says it has occurred to him in CL that price runs through stop fast and stop was not triggered (fast moving market).

    I think one can not avoid this situation but I have an idea to solve this and want to ask if this works in a script.

    Entry (priceX)
    Stop (priceX-10TickSize)

    Exitcondition
    if(marketposition != flat and getcurrentask()< entryprice-12*TickSizeI then exitlong(exitshort)

    Will this work in this situation (this might be faster than to call the broker and to ask by phone to close)?

    Thank you
    Tony

    #2
    Hello Tony,

    Thanks for your post.

    Please clarify, did the last traded price move past your stop before it could become accepted/working and you got an error or did you have a stop limit order that was accepted/working but the market moved passed it without being able to fill you within you stop limit offset price?
    BrandonNinjaTrader Customer Service

    Comment


      #3
      Hello Tony,

      Your idea to set the stop loss and look for this scenario could prevent the position not closing due to slippage however, I could see this also causing an overfill where the stop loss is waiting to fill but also meets the exit condition as well.

      As you stated, it would be recommended to contact your broker to close any position or orders that did not cancel or close as you intended.

      Please let me know if you have any questions.

      Comment


        #4
        Hello,

        thank you for your reply. When the strategy action with the condition is Exitlong() or exitshort() why can there be an overfill?

        Thank you
        Tony


        Originally posted by NinjaTrader_PatrickH View Post
        Hello Tony,

        Your idea to set the stop loss and look for this scenario could prevent the position not closing due to slippage however, I could see this also causing an overfill where the stop loss is waiting to fill but also meets the exit condition as well.

        As you stated, it would be recommended to contact your broker to close any position or orders that did not cancel or close as you intended.

        Please let me know if you have any questions.

        Comment


          #5
          Hello Tony,

          Thank you for your response.

          Entry (priceX)
          Stop (priceX-10TickSize)

          Exitcondition
          if(marketposition != flat and getcurrentask()< entryprice-12*TickSizeI then exitlong(exitshort)
          Here you demonstrate two exits, the Stop and the Exit Condition. This can cause an overfill if the Stop fills when the Exit is filled.

          Comment


            #6
            Hello,

            thank you for your reply. To avoid such situation (or better, I can not avoid so "to react in such a situation") I have already seperated my scripts in a strategy for long trades and a strategy for short trades. This way I catch (I think I can do??) a position in the wrong direction. So if in my "strat-long" there is marketposition==short (this is the situation in an overfill) then I want the script to add a stop.

            My question now is if I can do this ordermanagment
            ...
            else if(marketposition...short)
            stopOrderoverfill = ExitShortStop(....Position.Quantity....)

            or if I can also do this with simple setstoploss. But how to tell the script that we need the position.qty in setstoploss? and would this be alos in the direction we need the stop?

            Thank you
            Tony






            Originally posted by NinjaTrader_PatrickH View Post
            Hello Tony,

            Thank you for your response.


            Here you demonstrate two exits, the Stop and the Exit Condition. This can cause an overfill if the Stop fills when the Exit is filled.

            Comment


              #7
              Hello Tony,

              Thank you for your response.

              I would recommend testing both options out, one test for the Exit() method and one with the SetStopLoss(). The quantity of the entry signal is passed to the SetStopLoss(), there is no need to set the quantity as it is pulled from the filled amount of the entry signal.

              Please let me know if you have any questions.

              Comment


                #8
                Hello,

                thank you for your reply. You all do a great support, thank you also to your collegues!

                My thoughts for probably issues with setstoplos ist that there is maybe entry signal in case of an overfill(?) As you write "it is pulled from the filled amount of the entry signal". But which one is the "entry signal" in case of an overfill (that is not defined in the code) for having then a corresponding stop quantity?

                Thank you
                Tony

                Originally posted by NinjaTrader_PatrickH View Post
                Hello Tony,

                Thank you for your response.

                I would recommend testing both options out, one test for the Exit() method and one with the SetStopLoss(). The quantity of the entry signal is passed to the SetStopLoss(), there is no need to set the quantity as it is pulled from the filled amount of the entry signal.

                Please let me know if you have any questions.

                Comment


                  #9
                  Hello Tony,

                  Thank you for your response and the kind words!

                  The overfill should not trigger SetStopLoss(). And therefore the SetStopLoss() is only going to use the actual entry you set in code.

                  Comment


                    #10
                    Hello,

                    thank you for your reply. But now its unlogical.

                    My question in this thread was how to have a stoploss to an overfill. And there was the reply including the setstoploss - but to test it and "it is pulled from the filled amount of the entry signal". I wrote my thoughts about this, and how this could work. And not I have the reply that it does not work with setstoploss because of no entrysignal.

                    Please clearify.

                    Thank you
                    Tony

                    Originally posted by NinjaTrader_PatrickH View Post
                    Hello Tony,

                    Thank you for your response and the kind words!

                    The overfill should not trigger SetStopLoss(). And therefore the SetStopLoss() is only going to use the actual entry you set in code.

                    Comment


                      #11
                      Originally posted by tonynt View Post
                      Hello,

                      thank you for your reply. But now its unlogical.

                      My question in this thread was how to have a stoploss to an overfill. And there was the reply including the setstoploss - but to test it and "it is pulled from the filled amount of the entry signal". I wrote my thoughts about this, and how this could work. And not I have the reply that it does not work with setstoploss because of no entrysignal.

                      Please clearify.

                      Thank you
                      Tony
                      I will tell you how I resolved it. Your mileage may vary.
                      1. Use the directive to ignore overfills.
                      2. Have your strategy set so that it will take trades in only one direction.
                      3. If ever there is a position in the other direction, there MUST have been an overfill, so use a Mar****rder to exit the entire position.

                      This has the effect, of course, that an overfill will not stop the strategy; which was my initial aim.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by judysamnt7, 03-13-2023, 09:11 AM
                      4 responses
                      57 views
                      0 likes
                      Last Post DynamicTest  
                      Started by ScottWalsh, Today, 06:52 PM
                      4 responses
                      36 views
                      0 likes
                      Last Post ScottWalsh  
                      Started by olisav57, Today, 07:39 PM
                      0 responses
                      7 views
                      0 likes
                      Last Post olisav57  
                      Started by trilliantrader, Today, 03:01 PM
                      2 responses
                      19 views
                      0 likes
                      Last Post helpwanted  
                      Started by cre8able, Today, 07:24 PM
                      0 responses
                      9 views
                      0 likes
                      Last Post cre8able  
                      Working...
                      X