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

ATM Strategy Stop Placement Entry price or fill price?

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

    ATM Strategy Stop Placement Entry price or fill price?

    Hi, This is probably simple to work out but I am struggling to work out exactly what's going on with ATM Strategy Stop placements when I consider slippage, can you please answer the following for me?
    1. When an order if filled, is the stop supposed to be placed below/above the initial order entry price or below/above the average fill price?
    2. When an order is filled and when set to move the stop to breakeven is the stop moved up/down to the initial order entry price or to the average fill price?
    3. When an order is filled, is the Target Limit order set to the initial order entry price plus/minus the profit target or is it set to the average fill price plus/minus the profit target?

    Thanks

    #2
    Hello sjmuk1,

    Thanks for your post.

    When using Atm Strategy methods, the stop will be placed a certain distance above/below the average entry price based on the Atm Strategy template you defined.

    If the Atm Strategy template moves the stop to breakeven, it will move the stop to the average entry price for the ATM Strategy position once a user-defined Profit Trigger has been reached.

    The target will be placed a certain distance above/below the average entry price just like the stop order.

    You could find more information about how Atm Strategies work from the help guide links below.

    Understanding Target and Stop parameters: https://ninjatrader.com/support/help...ndTargetValues
    Auto Breakeven: https://ninjatrader.com/support/help...evenParameters
    Using Atm Strategies: https://ninjatrader.com/support/help...strategies.htm

    Please let me know if I may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Thanks, I have now read those and it clearly shows the average entry price but I have been tracking all my entries and stop placement versus the template and I am finding instances (maybe 1 in 10) where the stop is placed a few ticks further below the average fill price than the stop is strategy is set to. For example, my average fill might be $100 on a stock and my stop is 100 ticks (1$) i.e. $99.00 but the stop will get placed at $89.95 for instance. I know the template I am using and the stop parameters in the template are correct. What could be causing this as it affects my risk profile per trade?

      Comment


        #4
        hello sjmuk1,

        Thanks for your note.

        If your custom NinjaScript strategy is not behaving as expected, you should add debugging prints to the script that print out each value the orders are submitted to instead of comparing it to manually placed orders that use an ATM Strategy Template.

        This way you are seeing the calculated average entry price of the strategy submitted Atm Strategy and the status of the stop loss or profit target. You could use GetAtmStrategyPositionAveragePrice() to get the price of the Atm Strategy. You could get the stop and target order status using GetAtmStrategyStopTargetOrderStatus().

        See the help guide documentation linked below for more information.

        GetAtmStrategyPositionAveragePrice(): https://ninjatrader.com/support/help...onaveragep.htm
        GetAtmStrategyStopTargetOrderStatus(): https://ninjatrader.com/support/help...rgetorders.htm

        Below is a link to a forum post that demonstrates how to use prints to understand behavior.

        https://ninjatrader.com/support/foru...121#post791121

        Let me know if I may assist further.
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          thanks but i don't need to do that as I am monitoring the fills and placement of orders in IB TWS, I am keeping track of all trades in a spreadsheet from the TWS interface. They are clearly not being placed at the correct price. Please advise what might be causing this.

          Comment


            #6
            Hello sjmuk1,

            Thanks for your note.

            To investigate this matter further or report an issue to the Development team we would need to have a consistent way to reproduce the behavior.

            Please test reproducing the behavior you are reporting using the SampleAtmStrategy strategy that comes default with NinjaTrader on the Playback connection.

            Once you are able to consistently reproduce the behavior using the SampleAtmStrategy script on Playback, please send me the exact steps and settings you used to reproduce the behavior so we may reproduce it on our end and investigate further.

            Playback: https://ninjatrader.com/support/help...connection.htm

            I look forward to assisting further.
            Brandon H.NinjaTrader Customer Service

            Comment


              #7
              I only have access to interactive brokers' data, will this provide market depth and show recreate partial fills as in real trading?

              Comment


                #8
                Hello sjmuk1,

                Thanks for your note.

                Market replay data does not come from your data provider, it is provided by NinjaTrader. Market replay is available for the most popular futures and forex instruments for the past 90 days.

                For information about downloading Market Replay data to use with the Playback connection, see this help guide page.

                The Playback connection used with Market Replay data will allow you to test the strategy as if it were running in real-time.



                It is also possible to record market replay data yourself using your real-time data feed. For information about recording market replay data, please see the link below;

                https://ninjatrader.com/support/help...LiveMarketData

                Let me know if I may assist further.
                Brandon H.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks, so i was playing with this today and the Sample ATM Strategy has the same problem, it looks like I will need to record playback data from IB and use that as the instruments I am trading (stocks) aren't available in Ninjatrader to download for playback. Will I be able to send this recorded data to you?

                  Comment


                    #10
                    Hello sjmuk1,

                    Thanks for your note.

                    I see you mentioned you were able to reproduce the behavior using SampleAtmStrategy on the Playback connection.

                    Send me the exact steps and settings you used in the order you used them so I may reproduce the behavior on my end and investigate further. This includes the Playback settings, Instrument and Data Series settings, strategy settings, and steps to reproduce.

                    Also, please send a screenshot showing the behavior you are reporting.
                    • To send a screenshot with Windows 10 or newer I would recommend using the Windows Snipping Tool.
                    • Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save it as a jpeg file and send the file as an attachment.

                    I look forward to assisting further.
                    Brandon H.NinjaTrader Customer Service

                    Comment


                      #11
                      I did not say i had reproduced it, i said the same behaviour exists with live data with the ATM Strategy. I will now have to record replay data and see if it occurs in playback. I asked you if I can easily share the recorded replay data as you have such a limited number of instruments available your data doesn't include instruments I trade and that this error occurs on.

                      Comment


                        #12
                        Hello sjmuk1,

                        Thanks for your note.

                        Yes, Market Replay data is recorded and stored in compressed files located in the Documents\NinjaTrader 8\db\replay directory. You could create a ZIP file for the Market Replay instrument data you want to share and attach it to your reply. To create a ZIP file, right-click on the folder you want to share, and select 'Send to' > 'Compressed (zipped) folder'.

                        Or, you could let me know what instrument, dates, and times the data is recorded for and I will download the Market Replay data for that instrument/dates/times on my end for testing reproducing the behavior using the steps and settings you provide.

                        I look forward to further assisting you.
                        Brandon H.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by cls71, Today, 04:45 AM
                        0 responses
                        1 view
                        0 likes
                        Last Post cls71
                        by cls71
                         
                        Started by mjairg, 07-20-2023, 11:57 PM
                        3 responses
                        213 views
                        1 like
                        Last Post PaulMohn  
                        Started by TheWhiteDragon, 01-21-2019, 12:44 PM
                        4 responses
                        544 views
                        0 likes
                        Last Post PaulMohn  
                        Started by GLFX005, Today, 03:23 AM
                        0 responses
                        3 views
                        0 likes
                        Last Post GLFX005
                        by GLFX005
                         
                        Started by XXtrader, Yesterday, 11:30 PM
                        2 responses
                        12 views
                        0 likes
                        Last Post XXtrader  
                        Working...
                        X