Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limit forex order partially filled by $1 on MarketReplay

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

    Limit forex order partially filled by $1 on MarketReplay

    I am not sure if it is bug or I am just doing something wrong, but here is the situation.

    I am using 7B6. $AUDUSD, 5 min. I have downloaded market replay data from NT servers. 5/01/2010 - 7/01/2010. Acoount: Replay101.

    I am trying to run my strategy that uses custom order handling. Some orders (like initial entry) $80000 and some stop Orders filled ok - at once.

    But when I set Limit order for $40000 ( half position ) and price touches it it fills with $1 many many times. So basically Ninja is trying to fill it by partial fills with $1 each time. and it creates a bunch of trades ( 40,000 ? ).

    I tried to tweak some parameters like Enforce immediate files, etc. Nothing helps.

    Please advise me.

    Here is some from Log:

    7/01/2010 11:26 PM Position Instrument='$AUDUSD' Account='Replay101' Avg price=0.913850000625 Quantity=79,994 Market position=Short Operation=Update Currency=Unknown
    7/01/2010 11:26 PM Execution Execution='6035d5f2db3a437d8d5978eb4f58f678' Instrument='$AUDUSD' Account='Replay101' Exchange=Default Price=0.91225 Quantity=1 Market position=Long Operation=Insert Order='79c2a88a0eed49e29356f7f875a56176' Time='6/01/2010 4:45:15 AM' Multiplier=1E-05
    7/01/2010 11:26 PM Order Order='79c2a88a0eed49e29356f7f875a56176/Replay101' Name='LIMIT.S' New state=PartFilled Instrument='$AUDUSD' Action=BuyToCover Limit price=0.91225 Stop price=0 Quantity=0.04M Type=Limit Filled=6 Fill price=0.91225 Error=NoError Native error=''
    7/01/2010 11:26 PM Position Instrument='$AUDUSD' Account='Replay101' Avg price=0.913850000625 Quantity=79,995 Market position=Short Operation=Update Currency=Unknown
    7/01/2010 11:26 PM Execution Execution='5f18c221459f42128f1869bc28f78839' Instrument='$AUDUSD' Account='Replay101' Exchange=Default Price=0.91225 Quantity=1 Market position=Long Operation=Insert Order='79c2a88a0eed49e29356f7f875a56176' Time='6/01/2010 4:45:12 AM' Multiplier=1E-05
    7/01/2010 11:26 PM Order Order='79c2a88a0eed49e29356f7f875a56176/Replay101' Name='LIMIT.S' New state=PartFilled Instrument='$AUDUSD' Action=BuyToCover Limit price=0.91225 Stop price=0 Quantity=0.04M Type=Limit Filled=5 Fill price=0.91225 Error=NoError Native error=''
    7/01/2010 11:26 PM Position Instrument='$AUDUSD' Account='Replay101' Avg price=0.913850000625 Quantity=79,996 Market position=Short Operation=Update Currency=Unknown
    7/01/2010 11:26 PM Execution Execution='056934477f584b8795c62ef8544aa32e' Instrument='$AUDUSD' Account='Replay101' Exchange=Default Price=0.91225 Quantity=1 Market position=Long Operation=Insert Order='79c2a88a0eed49e29356f7f875a56176' Time='6/01/2010 4:45:12 AM' Multiplier=1E-05
    7/01/2010 11:26 PM Order Order='79c2a88a0eed49e29356f7f875a56176/Replay101' Name='LIMIT.S' New state=PartFilled Instrument='$AUDUSD' Action=BuyToCover Limit price=0.91225 Stop price=0 Quantity=0.04M Type=Limit Filled=4 Fill price=0.91225 Error=NoError Native error=''
    7/01/2010 11:26 PM Position Instrument='$AUDUSD' Account='Replay101' Avg price=0.913850000625 Quantity=79,997 Market position=Short Operation=Update Currency=Unknown
    7/01/2010 11:26 PM Execution Execution='846fd72d8ed0432a90ff475d67269aac' Instrument='$AUDUSD' Account='Replay101' Exchange=Default Price=0.91225 Quantity=1 Market position=Long Operation=Insert Order='79c2a88a0eed49e29356f7f875a56176' Time='6/01/2010 4:45:11 AM' Multiplier=1E-05
    7/01/2010 11:26 PM Order Order='79c2a88a0eed49e29356f7f875a56176/Replay101' Name='LIMIT.S' New state=PartFilled Instrument='$AUDUSD' Action=BuyToCover Limit price=0.91225 Stop price=0 Quantity=0.04M Type=Limit Filled=3 Fill price=0.91225 Error=NoError Native error=''
    7/01/2010 11:26 PM Position Instrument='$AUDUSD' Account='Replay101' Avg price=0.913850000625 Quantity=79,998 Market position=Short Operation=Update Currency=Unknown
    7/01/2010 11:26 PM Execution Execution='0e62e338a42141cc8fad3b6c12f780c3' Instrument='$AUDUSD' Account='Replay101' Exchange=Default Price=0.91225 Quantity=1 Market position=Long Operation=Insert Order='79c2a88a0eed49e29356f7f875a56176' Time='6/01/2010 4:45:11 AM' Multiplier=1E-05
    7/01/2010 11:26 PM Order Order='79c2a88a0eed49e29356f7f875a56176/Replay101' Name='LIMIT.S' New state=PartFilled Instrument='$AUDUSD' Action=BuyToCover Limit price=0.91225 Stop price=0 Quantity=0.04M Type=Limit Filled=2 Fill price=0.91225 Error=NoError Native error=''
    7/01/2010 11:26 PM Order Order='a93dd70216664000a28bb27e4a3f4837/Replay101' Name='STOP.S' New state=Accepted Instrument='$AUDUSD' Action=BuyToCover Limit price=0 Stop price=0.91445 Quantity=79,998 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
    7/01/2010 11:26 PM Order Order='a93dd70216664000a28bb27e4a3f4837/Replay101' Name='STOP.S' New state=PendingChange Instrument='$AUDUSD' Action=BuyToCover Limit price=0 Stop price=0.91445 Quantity=79,998 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
    7/01/2010 11:26 PM Position Instrument='$AUDUSD' Account='Replay101' Avg price=0.913850000625 Quantity=79,999 Market position=Short Operation=Update Currency=Unknown
    7/01/2010 11:26 PM Execution Execution='f5082f4d985543ba8ed4ea6700982655' Instrument='$AUDUSD' Account='Replay101' Exchange=Default Price=0.91225 Quantity=1 Market position=Long Operation=Insert Order='79c2a88a0eed49e29356f7f875a56176' Time='6/01/2010 4:45:11 AM' Multiplier=1E-05
    7/01/2010 11:26 PM Order Order='79c2a88a0eed49e29356f7f875a56176/Replay101' Name='LIMIT.S' New state=PartFilled Instrument='$AUDUSD' Action=BuyToCover Limit price=0.91225 Stop price=0 Quantity=0.04M Type=Limit Filled=1 Fill price=0.91225 Error=NoError Native error=''
    7/01/2010 11:24 PM Order Order='79c2a88a0eed49e29356f7f875a56176/Replay101' Name='LIMIT.S' New state=Working Instrument='$AUDUSD' Action=BuyToCover Limit price=0.91225 Stop price=0 Quantity=0.04M Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
    7/01/2010 11:24 PM Order Order='79c2a88a0eed49e29356f7f875a56176/Replay101' Name='LIMIT.S' New state=Accepted Instrument='$AUDUSD' Action=BuyToCover Limit price=0.91225 Stop price=0 Quantity=0.04M Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
    7/01/2010 11:24 PM Order Order='79c2a88a0eed49e29356f7f875a56176/Replay101' Name='LIMIT.S' New state=PendingSubmit Instrument='$AUDUSD' Action=BuyToCover Limit price=0.91225 Stop price=0 Quantity=0.04M Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
    7/01/2010 11:24 PM Order Order='a93dd70216664000a28bb27e4a3f4837/Replay101' Name='STOP.S' New state=Accepted Instrument='$AUDUSD' Action=BuyToCover Limit price=0 Stop price=0.91445 Quantity=0.08M Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
    7/01/2010 11:24 PM Order Order='a93dd70216664000a28bb27e4a3f4837/Replay101' Name='STOP.S' New state=PendingSubmit Instrument='$AUDUSD' Action=BuyToCover Limit price=0 Stop price=0.91445 Quantity=0.08M Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
    7/01/2010 11:24 PM Position Instrument='$AUDUSD' Account='Replay101' Avg price=0.913850000625 Quantity=0.08M Market position=Short Operation=Update Currency=Unknown
    7/01/2010 11:24 PM Execution Execution='0612d9632e12480ead9e2c64683099a8' Instrument='$AUDUSD' Account='Replay101' Exchange=Default Price=0.91385 Quantity=79,999 Market position=Short Operation=Insert Order='de7a2014808c43a994b6eb7bfa099718' Time='6/01/2010 4:05:08 AM' Multiplier=1E-05
    7/01/2010 11:24 PM Order Order='de7a2014808c43a994b6eb7bfa099718/Replay101' Name='TRADE' New state=Filled Instrument='$AUDUSD' Action=SellShort Limit price=0 Stop price=0.91395 Quantity=0.08M Type=Stop Filled=80000 Fill price=0.913850000625 Error=NoError Native error=''
    7/01/2010 11:24 PM Position Instrument='$AUDUSD' Account='Replay101' Avg price=0.9139 Quantity=1 Market position=Short Operation=Insert Currency=Unknown
    7/01/2010 11:24 PM Execution Execution='aaece091420d41e2abb76e6c7dbda7d3' Instrument='$AUDUSD' Account='Replay101' Exchange=Default Price=0.9139 Quantity=1 Market position=Short Operation=Insert Order='de7a2014808c43a994b6eb7bfa099718' Time='6/01/2010 4:05:08 AM' Multiplier=1E-05
    7/01/2010 11:24 PM Order Order='de7a2014808c43a994b6eb7bfa099718/Replay101' Name='TRADE' New state=PartFilled Instrument='$AUDUSD' Action=SellShort Limit price=0 Stop price=0.91395 Quantity=0.08M Type=Stop Filled=1 Fill price=0.9139 Error=NoError Native error=''
    7/01/2010 11:24 PM Order Order='de7a2014808c43a994b6eb7bfa099718/Replay101' Name='TRADE' New state=Working Instrument='$AUDUSD' Action=SellShort Limit price=0 Stop price=0.91395 Quantity=0.08M Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''



    and here is from Output window:

    MRP 1 CurrentBar 1043 Stop 0.91445
    OPEN SHORT 80000 Price = 0.91395
    6/01/2010 4:05:07 AM Entered internal PlaceOrder() method at 6/01/2010 4:05:07 AM: Action=SellShort OrderType=Stop Quantity=0.08M LimitPrice=0 StopPrice=0.9139'5 SignalName='TRADE' FromEntrySignal=''
    SET STOP SHORT 80000 Price = 0.91445
    6/01/2010 4:05:08 AM Entered internal PlaceOrder() method at 6/01/2010 4:05:08 AM: Action=BuyToCover OrderType=Stop Quantity=0.08M LimitPrice=0 StopPrice=0.9144'5 SignalName='STOP.S' FromEntrySignal='TRADE'
    SET LIMIT SHORT 40000 Price = 0.91225
    6/01/2010 4:05:08 AM Entered internal PlaceOrder() method at 6/01/2010 4:05:08 AM: Action=BuyToCover OrderType=Limit Quantity=0.04M LimitPrice=0.9122'5 StopPrice=0 SignalName='LIMIT.S' FromEntrySignal='TRADE'
    6/01/2010 4:45:11 AM Amended pending exit order, since associated position is closed: Order='a93dd70216664000a28bb27e4a3f4837/Replay101' Name='STOP.S' State=Accepted Instrument='$AUDUSD' Action=BuyToCover Limit price=0 Stop price=0.91445 Quantity=0.08M Strategy='AAADogScore' Type=Stop Tif=Gtc Oco='' Filled=0 Fill price=0 Token='a93dd70216664000a28bb27e4a3f4837' Gtd='1/12/2099 12:00:00 AM'

    #2
    Please uncheck (!) Tools->Options->Simulator->Enforce partial fills.

    Comment


      #3
      Originally posted by NinjaTrader_Dierk View Post
      Please uncheck (!) Tools->Options->Simulator->Enforce partial fills.
      I have verified again. It is Unchecked indeed.

      ANy other ideas that could help ?

      Comment


        #4
        Then it likely is related to your custom order handling. You may verify by trying SampleMACrossOver which should not exhibit this behavior. Next you needed to debug your strategy in order to find out why those orders are placed.

        Comment


          #5
          Originally posted by NinjaTrader_Dierk View Post
          Then it likely is related to your custom order handling. You may verify by trying SampleMACrossOver which should not exhibit this behavior. Next you needed to debug your strategy in order to find out why those orders are placed.
          That is what I did. I checked what orders I place. It is ok. Plus, it works fine in real-time.

          Ok, will dig deeper. But something says to me that there might be a bug ...

          Comment


            #6
            Here's a hint: replay event handling is different, since it needed to yield reproducible results, it's "rather synchronous than asycnronous". I can't share details since it's pretty complex (no offense), but a hot candidate for checking would be any logic which placed orders in OnOrderUpdate, OnExecution or OnPosition since the order placement might be triggered by some order/execution/position info which might be different than on Sim101 or live.

            Comment


              #7
              Originally posted by NinjaTrader_Dierk View Post
              Here's a hint: replay event handling is different, since it needed to yield reproducible results, it's "rather synchronous than asycnronous". I can't share details since it's pretty complex (no offense), but a hot candidate for checking would be any logic which placed orders in OnOrderUpdate, OnExecution or OnPosition since the order placement might be triggered by some order/execution/position info which might be different than on Sim101 or live.
              Sure, I understand. Thank you for sharing this. I will add more trace logic and see if I could find the problem.

              Thanks again.

              Comment


                #8
                Originally posted by NinjaTrader_Dierk View Post
                Here's a hint: replay event handling is different, since it needed to yield reproducible results, it's "rather synchronous than asycnronous". I can't share details since it's pretty complex (no offense), but a hot candidate for checking would be any logic which placed orders in OnOrderUpdate, OnExecution or OnPosition since the order placement might be triggered by some order/execution/position info which might be different than on Sim101 or live.
                I did a bit of investigation and, yes, my strategy places orders incorrectly.
                But that is not a problem.

                The main problem is that Forex orders in Replay filled like this:
                1) I place Stop Sell order for $80,000 using method SubmitOrder
                2) It triggered and filled like this:

                $AUDUSD Sell 79999 0.92505 19/01/2010 5:56 PM fba5b25ec7bc465182e6069327b95f12 Entry 0.08M S 63bdd7ca282a4abda81af24beedbffd9 S9 0 1 Replay101 Market Replay Connection
                $AUDUSD Sell 1 0.9251 19/01/2010 5:56 PM d3a57ae80d834a11a2cdc36f5ce9c5f8 Entry 1S 63bdd7ca282a4abda81af24beedbffd9 S9 0 1 Replay101 Market Replay Connection


                See options page attached.

                My questrion is : How I can enforce immidiate fills ?

                I understand that there might be some logic of partial fills. But fill of $1 sound ridiculas.

                If you guys could make enforcing of immidiate fills or at least make any reasonable Partial fills, it would be a great help as we can use Replay properly.
                Attached Files
                Last edited by dimkdimk; 01-22-2010, 10:32 PM.

                Comment


                  #9
                  dimkdimk,

                  That fill happens due to dynamically generated bid/ask availability. Unfortunately there is no "all or nothing" filling mechanism. If you want it to split up with partial fills more regularly you could try checking that Enforce Partial Fills option.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    We have changed the logic on our next beta update. Now if "Enforce immediate fills" is enabled, you will get one fill for your full order quantity size.
                    RayNinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_Ray View Post
                      We have changed the logic on our next beta update. Now if "Enforce immediate fills" is enabled, you will get one fill for your full order quantity size.
                      That is really great news. Thank you guys !

                      From your previous explanations, I know, you have some fill algorythm. However, you may need to think of more realistic one as fills with $1 against $80,000 are not looking good. I admit that in simulator we need partial orders for some tests, the matter is their reasonable sizing. I think you guys, can develop something better in the future versions.

                      Comment


                        #12
                        Originally posted by NinjaTrader_Ray View Post
                        We have changed the logic on our next beta update. Now if "Enforce immediate fills" is enabled, you will get one fill for your full order quantity size.

                        Hi Ray,

                        I have checked 7B7 andForexordes fill in replay very nicely. Thank you for this improvement.

                        Only problem is that bad error message about assembly, see other posts.

                        28/01/2010 11:38:13 AM|1|32|Order='bb98d16a15974743a5f4d079f3b89dce/Replay101' Name='S22' New state=Filled Instrument='$AUDUSD' Action=BuyToCover Limit price=0 Stop price=0 Quantity=0.02M Type=Market Filled=20000 Fill price=0.8966 Error=NoError Native error=''
                        28/01/2010 11:38:13 AM|1|16|Execution='d8d9267ef24d478a8acfd9d3691d475 5' Instrument='$AUDUSD' Account='Replay101' Exchange=Default Price=0.8966 Quantity=0.02M Market position=Long Operation=Insert Order='bb98d16a15974743a5f4d079f3b89dce' Time='26/01/2010 6:45:03 PM' Multiplier=1E-05
                        28/01/2010 11:38:13 AM|1|64|Instrument='$AUDUSD' Account='Replay101' Avg price=0.8966 Quantity=0 Market position=Short Operation=Remove Currency=Unknown
                        28/01/2010 11:38:14 AM|0|4|Failed to execute DB job 'StrategyUpdateJob': Could not load file or assembly 'System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

                        Comment


                          #13
                          dimkdimk,

                          Please try if post #4 fixes the issue: http://www.ninjatrader-support2.com/...ad.php?t=25182
                          Josh P.NinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                          0 responses
                          636 views
                          0 likes
                          Last Post Geovanny Suaza  
                          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                          0 responses
                          366 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by Mindset, 02-09-2026, 11:44 AM
                          0 responses
                          107 views
                          0 likes
                          Last Post Mindset
                          by Mindset
                           
                          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                          0 responses
                          569 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by RFrosty, 01-28-2026, 06:49 PM
                          0 responses
                          571 views
                          1 like
                          Last Post RFrosty
                          by RFrosty
                           
                          Working...
                          X