Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Closes Open Orders but then Reopens "ghost" entry

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

    Strategy Closes Open Orders but then Reopens "ghost" entry

    I've got a strategy that I've been testing in market replay. It's working well with the exception that about every 12 hours or so it will hit a profit target, close the open orders but then it doesn't re-enter a new order. Instead it seems to think its in a position that it's not. The unrealized PnL moves with the price change but the profit target and stop loss aren't there. This "ghost" order also doesn't show up in the orders tab. It's basically a non-issue except that the strategy requires the current position to be flat to enter a new order and since it thinks it's in some sort of long/short position it doesn't do anything. I can hit close on the chart trader and it clears the "ghost" order but I'd like the strategy to be able to run without my supervision. Any idea what might be causing this issue? There doesn't seem to be any rhyme or reason for when it happens.

    #2
    Hello mattdowns1234,

    More information is needed to assist.
    From printing the order object in OnOrderUpdate() and marketPosition object from OnPositionUpdate(), what is the last order that fills and what is the last position update?
    What does the printing the position show the strategy sees the position as?
    Have you enabled TraceOrders, and does this show that an order has been ignored? What is the full TraceOrders message?

    Please save the output from the NinjaScript Output window to a text file and we would be happy to assist with analyzing the output.

    If you have not have not taken any steps to add prints or enable TraceOrders to debug the script, please see the forum post below about using Print() and TraceOrders to understand script behavior.
    https://ninjatrader.com/support/foru...121#post791121
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Chelsea,
      Thanks for your quick reply. I reset NT and restarted my computer and the issue seems to have cleared itself. A month of replay data and it hasn't reoccurred. If it happens again I'll follow your instructions and let you know what I find. Thanks again.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by mlarocco, Today, 11:12 AM
      1 response
      28 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by futurenow, 12-06-2021, 05:49 PM
      19 responses
      1,010 views
      0 likes
      Last Post Redders
      by Redders
       
      Started by mathfrick2023, 05-08-2025, 12:51 PM
      8 responses
      124 views
      0 likes
      Last Post Yogaman
      by Yogaman
       
      Started by several, 04-22-2025, 05:21 AM
      1 response
      285 views
      0 likes
      Last Post Lukasxgtx  
      Started by NTEducationTeam, 06-12-2025, 02:30 PM
      0 responses
      45 views
      0 likes
      Last Post NTEducationTeam  
      Working...
      X