• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATM Trailing Stop error

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

    ATM Trailing Stop error

    When using an ATM and the Entry gets filled at a price 1.25 points better, the Auto Trail and Auto Breakeven activates immediately (based on the original Entry price) causing an error (resulting in a rejection and immediate fill due to: "Stop price can't be changed above the market"). It appears that the ATM internal code does not look at the actual (or best) fill price when initiating the algorithm for the Trailing Stop and Breakeven positions.

    Here are the specifics:
    1. Using Playback for ES 3-18, set date/time to 2/16/18 9:44
    2. Use an ATM setup (see pics attached)
    3. Place the order for 2-Long at 2730
    4. Watch it get filled at 2728.75

    Regardless of whether in a Real trade this fill would occur, the ATM should always adjust to the actual trade price.

    Thanks,
    Ron
    Attached Files
    Last edited by ronhb107; 02-24-2018, 02:15 AM.

    #2
    Hello ronhb107,

    Please send an email to platformsupport [at] ninjatrader [dot] com so that we may request your log and trace files.

    In the email please include a link to this forum post.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      ATM Trailing Stop error

      Chelsea:

      Were you not able to reproduce this given the data in the post?

      Ron

      Comment


        #4
        Hello Ron,

        At your request I have tested these parameters.

        As a tip, the autobreakeven and trailing stop are redundant. After 3 ticks of profit the order is going to try and be moved to the entry point with the autobreakeven, and at the same time will be moved to 3 behind the current price (also the entry point) from the trailing stop.

        There is no need for the autobreakeven to be set at all.

        Below is a link to a video I've recorded of the test.

        https://drive.google.com/file/d/1f_a...w?usp=drivesdk
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Chelsea, your video would not completely play (half way it starts to buffer without end).

          However, the best way to test is using Playback, with the date and time provided in the post.

          Ron

          Comment


            #6
            Hello Ron,

            As you have requested I have created a video showing an order placed during playback of market replay data.
            https://drive.google.com/file/d/1IN6...w?usp=drivesdk
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              ATM Trailing Stop error

              If a pic is worth a thousand words, how many words for a video?

              Let's go to the video tape! (see attached)

              Well, I tried using a Zip file, but the system would not allow the upload.

              Try again, Chelsea. Except this time place a Limit Order for 2-Long at 2730 as per the pics attached, then start Playback.

              Ron

              PS: this is a pernicious bug that only occurs when there is a trailing stop. Not only does this occur in the standard ATM with a trailing stop, it also occurs within my Strategy (that has a trailing stop). Whenever in Playback and the Limit Order is filled at a price different from the Order.LimitPrice (slippage or otherwise), Playback sets the Order.AverageFillPrice before there is any movement shown on the Chart (which I suppose is to be expected). But, internally the system sees an exception and throws the error. Btw, the Close[0] shows the LimitPrice; not the AverageFillPrice.

              Two questions:
              1. Is there another way to get the current price other than Close[0]? I'm using a Renko chart set to a single tick.

              2. In my code, how can I check for this Exception so I can Halt the program? Otherwise, it stays in an endless loop forcing the use of Task Manager to stop NT8.
              Attached Files
              Last edited by ronhb107; 02-27-2018, 08:06 AM.

              Comment


                #8
                ATM Trailing Stop error

                Chelsea, click on the link to view the video. https://youtu.be/-jQ5PiYujJ0

                If you're too busy, please pass this on to another support person; or better yet, to the technical staff.

                Ron

                Comment


                  #9
                  I apologize for the delay. Your last two messages came outside of our regular support hours. Chelsea is a member of the Technical Support Team. In fact, most replies you see will come exclusively from members of the Platform Support Team (what we would call the 'technical team' internally).

                  I am able to reproduce the order rejections when duplicating your test using a limit entry, however, I am not able to reproduce the issue when using a market order.

                  It seems that the actual fill price of the limit order in my test was 2728.75. What fill price do you see on your end? This would be recorded in the Executions tab of the Control Center.

                  For the market order, I got a fill price of 2731.75. I could not ever get the market order to fill at the exact same moment as the limit order. This makes it difficult to perform a valid test.

                  Is the market order fill and limit order fill at the exact same time/average entry price on your end?
                  Patrick G.NinjaTrader Customer Service

                  Comment


                    #10
                    Patrick, welcome to the conversation.

                    "It seems that the actual fill price of the limit order in my test was 2728.75. What fill price do you see on your end? This would be recorded in the Executions tab of the Control Center."

                    If we go to the video, you will see the fill for the limit order is the same: 2728.75 (per the Chart).

                    "For the market order, I got a fill price of 2731.75. I could not ever get the market order to fill at the exact same moment as the limit order. This makes it difficult to perform a valid test."

                    First, I would never place a market order except to exit a position immediately. Limit orders guarantee a fill (if it occurs) at or better than the asking price (as has occurred here, in this test).

                    I'm not sure why you would consider this not "a valid test". In your opinion, do you feel only market entry orders are valid tests? My confusion is why would you want to include market orders in the test when the issue is the failure of the trailing stop (which, generally, is a market order to ensure it gets filled)? Internally, your ATM system is not capable of handling a fast moving underlying (the ES in this case) since it, imo, relies on the original order placement and not the actual fill price.

                    "Is the market order fill and limit order fill at the exact same time/average entry price on your end?"

                    So, as explained above, market orders are irrelevant to this issue (which is your trailing stop has a flaw in logic, a bug, and should be addressed as such).

                    Ron

                    PS: when I referred to the 'technical team', I meant the 'development team'. I assume the Platform Support Team was not involved in development, nor has access to the development team's code.
                    Last edited by ronhb107; 03-03-2018, 11:35 PM.

                    Comment


                      #11
                      The auto-breakeven and auto-trail features of an ATM strategy are based on fill price. This is the case in live and sim trading.

                      Everything looks as if it is functioning as expected here. The market moved so quickly that, at that exact moment, the stop and target orders became invalid due to market movement.

                      If you want the orders to behave differently when this scenario occurs, what would you prefer to occur?
                      Patrick G.NinjaTrader Customer Service

                      Comment


                        #12
                        Patrick:

                        "The auto-breakeven and auto-trail features of an ATM strategy are based on fill price. This is the case in live and sim trading."
                        Ans: I agree, they should be based on 'fill' price; not order position price. The fill price was 2728.75 (5-ticks below the original position price of 2730). The Stop price was set to 8-ticks below the fill.

                        "Everything looks as if it is functioning as expected here. The market moved so quickly that, at that exact moment, the stop and target orders became invalid due to market movement."
                        Ans: If you review the video again, you will see that the Stop1 (trailing stop) was initiated immediately upon a fill. The ATM was setup for a 3-4 tick increase before the Stop1 was to be adjusted (and 8-ticks below the fill for the initial Stop1 position); this did not occur. Hence, logically, the trailing stop was based off the position price (or something else); not the fill price.

                        Reviewing the tape frame by frame, I can see that Stop1 is placed 8-ticks below the fill price. And, immediately after that the Stop is adjusted as a trailing stop (even though the price has not risen at all).

                        This leaves just one possibility: the current price is lagging. One approach is to recognize the gap between fill and current price and delay a few milliseconds to allow the current price to catch up.

                        Btw, is there a tick price that could be referred to instead of Close[0]?
                        Last edited by ronhb107; 03-05-2018, 10:26 AM.

                        Comment


                          #13
                          Your screenshot shows that the playback controller is at 09:44:27 at the time of the error.

                          At that exact second, the low of the bar was 2728.75 (this was the fill price) and the high was 2729.50 (this is 3 ticks higher).

                          https://www.screencast.com/t/yxlKvWy63p

                          The above scenario also could have occurred during the large move during one second at 09:44:21.

                          This would have triggered the stop strategy to move your stop loss. However, the market moved back down towards your fill price which would make the stop loss move invalid.

                          All of this is expected behavior during a fast moving market.
                          Patrick G.NinjaTrader Customer Service

                          Comment


                            #14
                            Patrick, see my response (updated) prior to your current post.

                            The problem with your scenario is you're using 1-second bars (that's 1k milliseconds) which is an eternity in trading; you need to use tick bars.

                            Ron

                            Comment


                              #15
                              I'm not sure I understand. Is there something which is apparent on the tick chart which disproves that this occurred due to fill price + stop strategy settings + market volatility? if so, please elaborate.
                              Patrick G.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by vitixs, Today, 04:45 AM
                              1 response
                              11 views
                              0 likes
                              Last Post NinjaTrader_Marco  
                              Started by J4Runner, Yesterday, 07:21 PM
                              1 response
                              29 views
                              0 likes
                              Last Post NinjaTrader_Marco  
                              Started by dtl-saw, Yesterday, 08:44 PM
                              0 responses
                              16 views
                              0 likes
                              Last Post dtl-saw
                              by dtl-saw
                               
                              Started by ballboy11, Yesterday, 04:29 PM
                              0 responses
                              15 views
                              0 likes
                              Last Post ballboy11  
                              Started by zacharydw00, Yesterday, 02:29 PM
                              2 responses
                              30 views
                              0 likes
                              Last Post zacharydw00  
                              Working...
                              X