• 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

results having huge slippage

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

    results having huge slippage

    I have a strategy tested on strategy analyzer and it's having a huge slippage even though I put a 0 on slippage. It has 5 ticks of slippage sometimes.

    #2
    Can someone help me on using High fill resolution? Any sample strategy or code on it?

    Comment


      #3
      Hello,

      Thank you for the question.

      Do you have an example of the logic you had used and a situation that can reproduce what you are seeing?

      If you have not yet at this point tried to extract the logic generating the order and isolate it, that would be my suggestion or to look at that logic alone to see why that may be the case. If you have a sample you can provide, we could review that together.

      As for a sample of a strategy, without knowing what you are trying it would be difficult to provide a specific sample. You could try the SampleMACrossOver that comes with the platform as a general test script.

      I look forward to being of further assistance.
      JesseNinjaTrader Customer Service

      Comment


        #4
        I have attached the test strategy that I am working on. The submitted trades are filled correctly but the stops and targets are not filled in the desired price, it slips a couple of ticks especially when stops are move to break-even.
        Attached Files

        Comment


          #5
          Hello,

          Thank you for the reply.

          I reviewed the attached script but due to the amount of logic in the file, this would likely be a case where you need to debug the logic further or make a more refined sample. This would be a case where showing only 1 entry at a specific point in time and then allowing the target to demonstrate the problem in a specific scenario could be used to address what may be happening.

          I do see that you are using limit orders for the targets. Are you seeing that the price the limit was submitted at was slipping or is this that your logic is allowing for the limit to change the price at a not opportune moment? You have not yet provided a specific example of the problem you are seeing so I would not be sure what specifically is happening regarding slippage. Could you provide a more specific example of what you are seeing in contrast to a specific portion of your logic you provided?


          I look forward to being of further assistance.
          JesseNinjaTrader Customer Service

          Comment


            #6
            I have attached some images that sites the issue. The strategy submits a limit entry at a certain condition, it will be cancel if it's not filled after 1 bar from the entry bar. It works fine, the only problem is that when the stop will be move to breakeven after 3 ticks from the entry the stop will not be executed on the desired price which is the breakeven price. I am using the High resolution of fill type. Please check the long trade at 2/5/2018 4:30:30 PM in the images, it is highlighted. Stop should be executed at 2599.25 because it was move to breakeven but it is executed at 2598.25 which is 4 ticks difference from the breakeven price. I have attached also the output print outs text file. There a lot of that kind of issues.
            Attached Files

            Comment


              #7
              Hello,

              Thank you for the reply.

              I reviewed the script in contrast to your prints and do have one question. I don't see that you are checking if the ChangeOrder was successful but instead are printing directly after calling ChangeOrder. Generally, for calling order methods that generate or change an order you would want to Print the changes from OnOrderUpdate or OnExecution, are you certain the order was successfully changed to the new price? You could check this using OnOrderUpdate and check the stop order there specifically and then print. This would be one test you could do in the test you are trying now to see if the change was successful.

              I look forward to being of further assistance.
              JesseNinjaTrader Customer Service

              Comment


                #8
                Okay I have added code on the OnOrderUpdate to monitor the state of the stop order and check what's the average filled price and the issue still there. I still don't know why it filled on the wrong price. I am using Dorman connection so I don't know if this data related. Will you please run it on your side to see if it's just my side here. Hoping for your cooperation.
                Attached Files

                Comment


                  #9
                  Hello,

                  Thank you for the reply.

                  I tried the sample but unfortunately, this would be outside of the scope in which I could debug further. It appears you are using third-party indicators in your conditions so I cannot run the script without making quite a few modifications to it.

                  I would still suggest extracting the logic generating the orders in question and isolate it in a test script so it can be tested by its self. Without having the third party indicators and the specific scenario you are testing in, I would not likely be able to reproduce the exact problem on my end to further address what may be happening.

                  As you noted you are using dorman, are you only seeing this in historical data during backtesting? Are you able to reproduce this at all going forward in another mode such as replay?


                  I look forward to being of further assistance.
                  JesseNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Da vinci, Today, 04:19 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post Da vinci  
                  Started by brunoviveiros, Today, 09:36 AM
                  1 response
                  19 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by GARZONJ, Today, 11:22 AM
                  1 response
                  10 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by KonalGondal, Today, 10:18 AM
                  1 response
                  19 views
                  0 likes
                  Last Post NinjaTrader_Kate  
                  Started by Jorge.andres.o, Today, 09:24 AM
                  4 responses
                  23 views
                  0 likes
                  Last Post NinjaTrader_PaulH  
                  Working...
                  X