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

Is there anyway to simulate partial fills on a Playback connection

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

    Is there anyway to simulate partial fills on a Playback connection

    Hello:

    I am wondering if there is a way to simulate partial fills on a playback connection. I set the Tools -> Options -> Trading -> Simulator- Force Partial Fills to true but i am guessing this is only when using the simulation data feed.

    Thanks

    #2
    Hello ntram,

    Thank you for your inquiry.

    Enforce partial fills are for all simulated orders (orders placed on the Sim101 account).

    Playback/Market Replay allows you to replay past data as if it were running realtime. If you see the partial fill occur at a certain time in real time, you could try replicating the behavior at that specific time when connected to Playback. You won't be able to "force" any partial fills to occur with Market Replay data since the results follow the data (i.e. if it did not occur in real time, it would not occur during the replay either).

    Please let us know if you have any further questions.
    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      Hello Gaby,

      Thank you for your response. I am just not able to simulate a partial fill in my playback, even though partial fills happen on live data. Perhaps, there is a different way to solve my problem. When my strategy triggers an entry, in the OnExecutionUpdate method, I create an OCO for a profit target and a stop loss. I only have one order/position at any time, so whenever the target or stop is triggered, my position should be flat. The issue i am having when there is a partial fill is the quantity of the OCO seems to get messed up and i am always left with yet another open position. I use the SubmitOrderUnmanaged methods to place my orders.

      Looking at the logs a little more, i am wondering what the quantity parameter in the OnExecutionUpdate actually mean. In the logs, i see there is a quantity and a Filled value.

      Appreciate any help.


      Thanks
      Last edited by ntram; 05-19-2024, 09:23 AM. Reason: Looked at the logs and saw 2 values quantity and filled

      Comment


        #4
        Hello ntram,

        Thank you for your response.

        In order to better understand how the code is working, it will be necessary to use Print to see how the conditions are evaluating and enable TraceOrders to see if orders are being submitted, ignored, rejected, or cancelled.

        Below is a link to a forum post that demonstrates using prints to understand behavior and includes a link to a video recorded using the Strategy Builder to add prints.


        Enable TraceOrders, print the time of the bar and all values used in the conditions that submit entry orders. Include labels for all values and comparison operators.

        Let me know if you need any assistance creating a print or enabling TraceOrders.

        Save the output from the output window to a text file and provide this with your reply.

        I'll be happy to assist with analyzing the output.​
        Gaby V.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Skifree, 06-17-2024, 06:35 PM
        3 responses
        18 views
        0 likes
        Last Post Skifree
        by Skifree
         
        Started by sy2023, 09-15-2023, 08:51 PM
        2 responses
        234 views
        0 likes
        Last Post Crusade12  
        Started by kiss987, 05-16-2018, 02:19 AM
        14 responses
        2,871 views
        0 likes
        Last Post bobperez  
        Started by jalley, 03-22-2021, 12:17 PM
        4 responses
        133 views
        0 likes
        Last Post bobperez  
        Started by HGTrader, Yesterday, 02:13 PM
        6 responses
        13 views
        0 likes
        Last Post HGTrader  
        Working...
        X