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 fafafdenis, Today, 04:56 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_EricB  
      Started by pjsmith, 07-18-2019, 04:21 AM
      7 responses
      247 views
      0 likes
      Last Post aligator  
      Started by ark321, Today, 05:12 PM
      0 responses
      8 views
      0 likes
      Last Post ark321
      by ark321
       
      Started by futurenow, Today, 04:49 PM
      0 responses
      9 views
      0 likes
      Last Post futurenow  
      Started by ofer1964spivak, Today, 04:27 PM
      0 responses
      5 views
      0 likes
      Last Post ofer1964spivak  
      Working...
      X