Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Incorrect Slippage Applied

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

    Incorrect Slippage Applied

    Hi,

    I have specified a slippage of 2 but a slippage of more than two is being applied during execution. The order quantity is 1.

    The trace long states:

    === OnExecution() ===
    Slippage = 2
    execution.Order.StopPrice = 1138.4
    execution.Order.AvgFillPrice = 1138.7

    Is there any reason why this could happen? Any ideas would be greatly appreciated. Thank you.

    #2
    Hello Zeos6,

    Thank you for your post.

    Do you see the same thing happening with any other scripts? Sample MA CrossOver, etc

    Can you please provide a screenshot of back test results, specifically of the chart and where this execution took place?

    To send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file. Click Reply -> Go Advanced -> Click the Paperclip icon on the toolbar

    For detailed instructions please visit the following link

    How to take a screenshot on your smartphone, tablet, notebook or desktop computer
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hi Cal,

      Here is the image requested.
      Attached Files

      Comment


        #4
        Zeos6,

        Was this a StopMarket or StopLimit order that was submitted?
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Hi Cal,

          The entry order was:
          EnterShortStop()

          Comment


            #6
            Zeos6,

            This is what the FillType is looking for. The FillType looks at the next bar and for a StopMarket Buy order;
            if the stop price is less than the next open, it will find which value is small between, the high or the open + the slippage amount. In this case the high, which is also the open, is the smaller value and thus got filled at that price.

            You can view how the FillType works by going to (My) Documents -> NinjaTrader 7 -> bin -> Custom -> Type and checking the @DefaultFillType

            Let me know if I can be of further assistance.
            Cal H.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by Zeos6 View Post
              Hi Cal,

              The entry order was:
              EnterShortStop()

              You used a Market Order. That means that you will almost always have what looks like additional slippage, but is really just the effect of market dynamics and the bid/ask spread. I am assuming that your instrument has a bid/ask spread of 1 tick?

              Comment


                #8
                Thanks for the explanation Cal. It makes sense, especially as there is a 4 tick gap between the bars. The 1138.6 is the low for the bar on which the order is filled, and 1138.7 is the high, and the open. Thank you for the clear explanation. I will check out the FillType code in more detail.

                Comment


                  #9
                  Hi koganam,

                  Thank you for your reply. Yes, the bid/ask spread is 1 tick.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by geddyisodin, Today, 05:20 AM
                  3 responses
                  20 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Started by lorem, Today, 09:18 AM
                  1 response
                  5 views
                  0 likes
                  Last Post lorem
                  by lorem
                   
                  Started by bmartz, Today, 09:30 AM
                  0 responses
                  5 views
                  0 likes
                  Last Post bmartz
                  by bmartz
                   
                  Started by GussJ, 03-04-2020, 03:11 PM
                  14 responses
                  3,245 views
                  0 likes
                  Last Post GussJ
                  by GussJ
                   
                  Started by ArkansasClint, Today, 09:28 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post ArkansasClint  
                  Working...
                  X