Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT submits stopLoss order in wrong place

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

    NT submits stopLoss order in wrong place

    My strategy normally runs fine, testing with a target of 6 and stop loss of 6.
    1 in 50 trades, it will crash because of an illegal stop order (sell stop high above mkt)...

    Upon a long fill, it will usually submit the target and stoploss, OCO, no problems.
    But here, at 9:56, it submits the long order, gets a long fill at 0.1227 (0.12270)
    It should have target .12276 (which it does), and stop .12264
    But it submits a stop loss sell at 12303, that is 33 ticks above my entry, rather than 6 ticks below
    This crashes the strategy.
    What could be causing that? It only happens 1/50 trades


    excerpt from my output log .. it tells me entry will be long at 0.01227
    the target and stops are 6 ticks, so 0.012276 target

    4/29 9:56:33 j0421 r3 3.51 [6J] Entry signals: ftz2 L
    4/29 9:56:33 j0421 r3 3.51 [6J] previous LONG Stop = 0 new Stop = 0.012264
    4/29/2011 9:56:33 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='.' Mode=Price Value=0.012264 Currency=0 Simulated=False
    4/29/2011 9:56:33 AM Entered internal PlaceOrder() method at 4/29/2011 9:56:33 AM: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=1 LimitPrice=0.012270 StopPrice=0 SignalName='ftz2L' FromEntrySignal=''
    4/29 9:56:33 j0421 r3 3.51 [6J] targetExit=6 maxStopLoss=6 longTarget=0.012276 estStop=0.012264
    4/29 9:56:33 j0421 r3 3.51 [6J] SETUP LONG ftz2L 0.01227 05/05/be-1@4
    4/29 9:56:33 j0421 r3 3.51 [6J] OnOrderUpdate: Order='b7a944e18a25490da8d43dadec7a28d5/Replay101' Name='ftz2L' State=PendingSubmit Instrument='6J 06-11' Action=Buy Limit price=0.01227 Stop price=0 Quantity=1 Type=Limit Tif=Day OverFill=False Oco='' Filled=0 Fill price=0 Token='b7a944e18a25490da8d43dadec7a28d5' Gtd='1/1/0001 12:00:00 AM'
    4/29 9:56:33 j0421 r3 3.51 [6J] OnOrderUpdate: Order='b7a944e18a25490da8d43dadec7a28d5/Replay101' Name='ftz2L' State=Accepted Instrument='6J 06-11' Action=Buy Limit price=0.01227 Stop price=0 Quantity=1 Type=Limit Tif=Day OverFill=False Oco='' Filled=0 Fill price=0 Token='b7a944e18a25490da8d43dadec7a28d5' Gtd='1/1/0001 12:00:00 AM'
    4/29 9:56:33 j0421 r3 3.51 [6J] OnOrderUpdate: Order='b7a944e18a25490da8d43dadec7a28d5/Replay101' Name='ftz2L' State=Working Instrument='6J 06-11' Action=Buy Limit price=0.01227 Stop price=0 Quantity=1 Type=Limit Tif=Day OverFill=False Oco='' Filled=0 Fill price=0 Token='b7a944e18a25490da8d43dadec7a28d5' Gtd='1/1/0001 12:00:00 AM'


    Yet from trace, right after the entry fill, it says the stop price will be higher than entry price
    ...Instrument='6J 06-11' Action=Sell Limit price=0 Stop price=0.012303 Quantity=1 Type=Stop

    see attachment for rest of trace output
    Attached Files

    #2
    Hello,

    Is this output genereated from live, market replay, or backtesting?

    I look forward to assisting you further.

    Comment


      #3
      Hi Brett,

      Mkt Replay
      Pls refer also to the attachment. I believe that also confirmed it was mkt replay.

      steve

      Comment


        #4
        Did you modify the stop or target in OnBarUpdate(); ?

        Comment


          #5
          Hello,

          Thanks for sending that in. I did not see your trace attached so thanks for pointing that out.

          Looking at your trace you have two orders that fill at the same time. There are shown below. Is there a reason you should have two orders in at the same time?

          This then looks to lead to the stop loss price bring what you see:

          2011-04-30 08:55:03:343 (Market Replay Connection) Cbi.Order.Update1: oldid='b7a944e18a25490da8d43dadec7a28d5' Order='b7a944e18a25490da8d43dadec7a28d5/Replay101' Name='ftz2L' New state=Filled Instrument='6J 06-11' Action=Buy Limit price=0.01227 Stop price=0 Quantity=1 Type=Limit Filled=1 Fill price=0.01227 Error=NoError Native error=''
          2011-04-30 08:55:03:343 (Market Replay Connection) Cbi.Connection.ProcessEventArgs.ExecutionUpdateEve ntArgs: Execution='7d3d4255899a4b43b3c3bc9dea3ded80' Instrument='6J 06-11' Account='Replay101' Exchange=Default Price=0.01227 Quantity=1 Market position=Long Operation=Insert Order='b7a944e18a25490da8d43dadec7a28d5' Time='4/29/2011 9:57:29 AM'
          2011-04-30 08:55:03:343 (Market Replay Connection) Cbi.Connection.ProcessEventArgs.ExecutionUpdateEve ntArgs2: executionId='7d3d4255899a4b43b3c3bc9dea3ded80' entry=True exit=False position=1 multiplier=1 rate=1 sod=False
          2011-04-30 08:55:03:343 (Market Replay Connection) Cbi.Connection.ProcessEventArgs.PositionUpdateEven tArgs1: Instrument='6J 06-11' Account='Replay101' Avg price=0.01227 Quantity=1 Market position=Long Operation=Insert Currency=Unknown
          2011-04-30 08:55:03:343 (Market Replay Connection) Cbi.OrderStatusEventArgs.Process: Order='b7a944e18a25490da8d43dadec7a28d5/Replay101' Name='ftz2L' New state=Filled Instrument='6J 06-11' Action=Buy Limit price=0.01227 Stop price=0 Quantity=1 Type=Limit Filled=1 Fill price=0.01227 Error=NoError Native error=''

          Comment


            #6
            Brett,
            There should only be one order submitted and filled. I have no idea how/why we are getting multiples. I sent in my code in a separate email on Sunday. Is there a chance you can run it and see if you get same problem?
            Steve

            Comment


              #7
              Steve,

              I can take a look at the code one more time. Can you please reopen your ticket with me by emailing me the strategy again. As I do not remember your email and would be hard to find in our system.

              Thanks.

              Comment


                #8
                Thanks for your offered assistance. A sign of great service. I slayed the bug.
                Steve

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Rogers101, 05-05-2024, 11:30 AM
                16 responses
                48 views
                0 likes
                Last Post Rogers101  
                Started by ninza33, Today, 12:31 PM
                2 responses
                9 views
                0 likes
                Last Post ninza33
                by ninza33
                 
                Started by Bobin, 03-12-2024, 08:51 AM
                15 responses
                481 views
                0 likes
                Last Post fiddich
                by fiddich
                 
                Started by Skifree, Today, 11:21 AM
                4 responses
                13 views
                0 likes
                Last Post Skifree
                by Skifree
                 
                Started by Bogdan097, Today, 03:25 PM
                0 responses
                7 views
                0 likes
                Last Post Bogdan097  
                Working...
                X