Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Position Reversal

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

    Position Reversal

    Hello,

    I'm having an issue when running my strategy on the market (as it runs fine in simulated).

    What seems to be the trouble, is during a position reversal.

    NinjaTrader sends both a "Close Position" and an "Entry" order, as my entry is done in LMT, they are both LMT orders.

    The issue is that SOMETIMES, the "Entry" gets filled before the "Close Position".

    What happens then, is that all my Target orders are getting ignored by Ninja because "No
    FromSignalEntry" ...

    #2
    Hello zark.be,

    Using the Managed Approach, NinjaTrader will submit the "Close Position" order first so that it will get filled before the other entry order. Are you using multiple different Signal names in one direction?
    JCNinjaTrader Customer Service

    Comment


      #3
      Hello,

      I'm using Managed Orders with LiveUntilCancelled.


      I am seeing "Close Position" order sent in LMT in Interactive Brokers before the "Entry" order.

      But both are pending in IB, and SOMETIMES the Entry order gets filled BEFORE the Close Position order.

      When the close Position order gets filled first, there are no problems.

      When the Entry order gets filled first, I cannot send any linked orders, as ninja refuses them.

      Here's some samples from tracelog when there is a problem

      Code:
      Trace Log too long to be included here. (even though i only selected the interesting text)

      And here in the Output Log with traceOrders:
      The lines starting with "U" are logs from the OnOrderUpdate event.
      Code:
      04/04/2013 15:33:27 Entered internal PlaceOrder() method at 04/04/2013 15:33:27: BarsInProgress=0 Action=Buy OrderType=Stop Quantity=0.1M LimitPrice=0 StopPrice=1.2794 SignalName='Entry Long' FromEntrySignal=''
      04/04/2013 15:33:18  - U  PendingSubmit - Close position
      04/04/2013 15:33:18  - U  PendingSubmit - Entry Long
      04/04/2013 15:33:27  - U  Accepted - Close position
      04/04/2013 15:33:27  - U  Accepted - Entry Long
      04/04/2013 15:33:35  - U  Working - Entry Long
      04/04/2013 15:33:35  - U  Filled - Entry Long
      04/04/2013 15:33:35  - U  Working - Close position
      04/04/2013 15:33:35  - U  Filled - Close position
      04/04/2013 15:33:39 Entered internal PlaceOrder() method at 04/04/2013 15:33:39: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=0.02M LimitPrice=1.2824 StopPrice=0 SignalName='TGT 4' FromEntrySignal='Entry Long'
      04/04/2013 15:33:39 Ignored PlaceOrder() method at 04/04/2013 15:33:39: Action=Sell OrderType=Limit Quantity=0.02M LimitPrice=1.2824 StopPrice=0 SignalName='TGT 4' FromEntrySignal='Entry Long' Reason='SignalName does not have a matching FromEntrySignal to exit'
      04/04/2013 15:33:39 Entered internal PlaceOrder() method at 04/04/2013 15:33:39: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=0.02M LimitPrice=1.2817 StopPrice=0 SignalName='TGT 3' FromEntrySignal='Entry Long'
      04/04/2013 15:33:39 Ignored PlaceOrder() method at 04/04/2013 15:33:39: Action=Sell OrderType=Limit Quantity=0.02M LimitPrice=1.2817 StopPrice=0 SignalName='TGT 3' FromEntrySignal='Entry Long' Reason='SignalName does not have a matching FromEntrySignal to exit'
      04/04/2013 15:33:39 Entered internal PlaceOrder() method at 04/04/2013 15:33:39: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=0.02M LimitPrice=1.2809 StopPrice=0 SignalName='TGT 2' FromEntrySignal='Entry Long'
      04/04/2013 15:33:39 Ignored PlaceOrder() method at 04/04/2013 15:33:39: Action=Sell OrderType=Limit Quantity=0.02M LimitPrice=1.2809 StopPrice=0 SignalName='TGT 2' FromEntrySignal='Entry Long' Reason='SignalName does not have a matching FromEntrySignal to exit'
      04/04/2013 15:33:39 Entered internal PlaceOrder() method at 04/04/2013 15:33:39: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=0.02M LimitPrice=1.2800 StopPrice=0 SignalName='TGT 1' FromEntrySignal='Entry Long'
      04/04/2013 15:33:39 Ignored PlaceOrder() method at 04/04/2013 15:33:39: Action=Sell OrderType=Limit Quantity=0.02M LimitPrice=1.2800 StopPrice=0 SignalName='TGT 1' FromEntrySignal='Entry Long' Reason='SignalName does not have a matching FromEntrySignal to exit'

      Comment


        #4
        Hello zark.be,

        I would not expect this since, the "Close Position" order was entered first. Could you send me your log and trace files so that I may look into this.

        You can do this by going to the Control Center-> Help-> Mail to Support.

        Please reference this thread in the body of the email and put ATTN: JC in the Subject line.
        JCNinjaTrader Customer Service

        Comment


          #5
          Mail sent !

          Originally posted by NinjaTrader_JC View Post
          I would not expect this since, the "Close Position" order was entered first.

          indeed, but it is barely sent first. And as it is not a "market" order but a STP order, it can take a while to actually get executed.


          My Workaround has been to manually exit the position first with an order i call "My Exit Position"
          and in the OnExecute method, if the order is named "My Exit Position", i send the other order.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Balage0922, Today, 07:38 AM
          0 responses
          3 views
          0 likes
          Last Post Balage0922  
          Started by JoMoon2024, Today, 06:56 AM
          0 responses
          6 views
          0 likes
          Last Post JoMoon2024  
          Started by Haiasi, 04-25-2024, 06:53 PM
          2 responses
          19 views
          0 likes
          Last Post Massinisa  
          Started by Creamers, Today, 05:32 AM
          0 responses
          6 views
          0 likes
          Last Post Creamers  
          Started by Segwin, 05-07-2018, 02:15 PM
          12 responses
          1,786 views
          0 likes
          Last Post Leafcutter  
          Working...
          X