Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limit price slippage

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

    Limit price slippage

    Hi,

    I have faced a big issue on limit price(TP). I have developed a strategy and using ATM to take position and I have notice that the limit price is getting dropped when the order of Limit is filled.
    As you can see in the video, in this case Limit price is 30408 but when the order gets filled then it was dropped to 30403.
    Would you please explain , how something like this is possible.
    does it mean TP(take profit) is not trustable.

    Last edited by bosajin; 02-10-2021, 02:02 PM.

    #2
    Hello bosajin,

    Thank you for your post.

    I am unable to view the video you shared since it is a private video.

    Please send your log and trace files to scriptingsupport[AT]ninjatrader.com along with a reduced copy of your script that demonstrates the behavior you are reporting so we may investigate further. In the subject of your email please title it ATTN: Brandon H and include a link to this forum post in the body of your email.

    Follow the steps below to manually attach your log and trace files to your response so I may investigate this matter further.
    • Open your NinjaTrader folder under, "Documents" (sometimes called, "My Documents")
    • Right click on the 'log' and 'trace' folders and select Send To> Compressed (zipped) Folder.
    • Send the 2 compressed folders as attachments to this email.
    • Once complete, you can delete these compressed folders.
    Thanks in advance; I look forward to resolving this item.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Hi BrandonH,
      The issue of video is fixed .
      I have faced the issue on Playback account.
      do we have log for this account?
      The attached file is simplified script.
      Attached Files

      Comment


        #4
        Hello bosajin,

        Thank you for that information.

        To understand why the script is behaving as it is, such as placing orders or not placing orders when expected, it is necessary to add prints to the script that print the values used for the logic of the script to understand how the script is evaluating.

        In the strategy add prints (outside of any conditions) that print the values of every variable used in every condition that places an order along with the time of that bar.

        Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).

        You could also comment out AtmStrategyChangeStopTarget in your logic to see if that is causing the order to change.

        Below is a link to a forum post that demonstrates using prints to understand behavior and including a link to a video recorded using the Strategy Builder.
        https://ninjatrader.com/support/foru...121#post791121

        Please let me know if I may further assist
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          Hi BrandonH
          Please take a look at the video, the issue is there.



          this is result of print :

          CurrentBar:100
          action:Buy | orderType:Market | limitPrice:0 | stopPrice:0 | strategyTemplateName:Atm1
          MYM | Test Closing Order2 | NetPnL:7


          Per your request , I commented out AtmStrategyChangeStopTarget .
          Please attention the ATM is being closed by TP(Limit).

          This is config of Atm1.


          Click image for larger version  Name:	ATM1.JPG Views:	0 Size:	26.3 KB ID:	1141184

          Click image for larger version

Name:	chart type.JPG
Views:	107
Size:	74.3 KB
ID:	1141185
          Last edited by bosajin; 02-10-2021, 04:37 PM.

          Comment


            #6
            Hello bosajin,

            Thank you for that information.

            Unfortunately, in the support department at NinjaTrader it is against our policy to create, debug, or modify, code or logic for our clients. Further, we do not provide C# programming education services in our support. This is so that we can maintain a high level of service for all of our clients as well as our partners.

            I am unable to determine why the order was changed based on the video and information you shared. You would need to take debugging steps to monitor how your script is behaving. As a first step, I had suggested commenting out AtmStrategyChangeStopTarget to see if this is part of the issue since this method changes the price of a specified order of the specified ATM strategy. After commenting out this code, does the problem still persist? If so, you would need to add prints to your strategy for all conditions that change your orders to determine why that order is changing.

            Let us know if we may assist further.
            <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

            Comment


              #7
              Hi BrandonH,

              I never change the limit price of order (I have sent you the code if you take a look , you would see AtmStrategyChangeStopTarget is commented out ) and the issue still exists.
              I have provided enough data for replicating the issue on your side(not debugging, since the code is very simple) if you are not able ,let me know.
              However , I removed unnecessary code and attached it.
              This is bug undoubtedly please consider it.
              Attached Files
              Last edited by bosajin; 02-11-2021, 11:25 AM.

              Comment


                #8
                Hello bosajin,

                Thank you for your note.

                Using the settings you provided I was able to reproduce the behavior you are reporting when AtmStrategyChangeStopTarget was used. I am not able to reproduce the behavior when AtmStrategyChangeStopTarget is commented out. This leads me to believe that it is the use of AtmStrategyChangeStopTarget in your script that was changing the price of the order.

                Please let us know if we may assist further.
                Attached Files
                <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Today, 05:17 AM
                0 responses
                50 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                126 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                69 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                42 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                46 views
                0 likes
                Last Post TheRealMorford  
                Working...
                X