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

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 algospoke, Today, 06:40 PM
      0 responses
      10 views
      0 likes
      Last Post algospoke  
      Started by maybeimnotrader, Today, 05:46 PM
      0 responses
      7 views
      0 likes
      Last Post maybeimnotrader  
      Started by quantismo, Today, 05:13 PM
      0 responses
      7 views
      0 likes
      Last Post quantismo  
      Started by AttiM, 02-14-2024, 05:20 PM
      8 responses
      168 views
      0 likes
      Last Post jeronymite  
      Started by cre8able, Today, 04:22 PM
      0 responses
      10 views
      0 likes
      Last Post cre8able  
      Working...
      X