Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop ignored when close price and open price = the stop.

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

    Stop ignored when close price and open price = the stop.

    Stop ignored when close price and open price = the stop.

    I believe NT 6.5.1000.15 might have an issue. I have been running my strategy and everything seems to be working correctly,
    until my stop is ignored when the close price of the previous bar equals the open price of the next bar which both
    equal my stop. NT automatcially cancels my orders but does not get out of the market. I am using the External
    datafeed to test.

    1. 1:39:51 - Issued EnterLongLimit(924.25)
    2. 1:41:28 - Execute limit order at 924.25
    3. 1:41:28 - Issued ExitLongStop(923.25) when the OnExecution tiggered.
    4. 1:50:23 - Issued ExitLongStop(923.25) on a reevaluate
    5. 1:58:20 - Issued ExitLongStop(923.25) on a reevaluate
    6. 1:58:20 - Issued ExitLongLimit(925) for the proffit (obviously never hit)
    7. When the stop is hit, the strategy code knows that my position is flat, but the position in the ORDERS tab still
    thinks we are in the market. Then 2:06:20, I issue another EnterShortLimit() and the ORDERS/POSITIONS is closing the
    position, but I should have already been out of market.
    I have only noticed this behavior when the close of the previous bar equals the open of the next bar which equals my
    stop.
    Attached Files

    #2
    Hi TradingDreamer,

    Lets start with TraceOrders to find out why/if the order is getting ignored...

    More info at - http://www.ninjatrader-support.com/H...ml?TraceOrders

    You may be running in to one of the following situations under the "Interal Order Handling Rules that Reduce Unwanted Positions" section at - http://www.ninjatrader-support.com/H...tml?Overview36
    TimNinjaTrader Customer Service

    Comment


      #3
      Update with Trace - NT is works

      Thanks for the info on using TraceOrders. My Strategy is pretty complex and I see I missed some code and the TraceOrders helps identify my coding error.

      Comment


        #4
        Hi TradingDreamer,

        Great! Glad to hear that is useful to you.
        TimNinjaTrader Customer Service

        Comment


          #5
          More info, still not trading as I would expect

          Hello, I have ran a trace and outlined all the trades (and used my text file debug along with the order trace, and I still don't know why NT is behaving the way it is. I have checked out the order rules again. I outlined in detail with screen shots in the attached word document the trades being submitted. I don't know why there are orders submitted in the trace that don't show in the orders tab in the control center. The orders in the trace are not marked as canceled or ignored, they just don't show in the control center. So something is happening that I don't understand or I am doing something incorect and any help would be appreciated.
          Attached Files
          Last edited by TradingDreamer; 05-06-2010, 08:42 AM.

          Comment


            #6
            Hi TradingDreamer,

            Are you able to identify if the order was every ignored anywhere in the TraceOrder output?

            Also, ensure the orders are matching up with what's being entered on the chart, by visually checking.
            TimNinjaTrader Customer Service

            Comment


              #7
              Yes, I have tracked all this. I provided you all the information, you can see the trades (and trades not executied) in the attached files. It shows that a signal is generated in the strategy and in the trace file and in my log file at a limit price and the orders tab DOES NOT show this order. It also does not show on the chart because the price has not been met. Please review the attached documentation, I was very thorough in my explanations and tracing (I included the NT commands in the trace file to easily track the trace file, a time line, and the attached screen shots). Either NT 6.5 has an error or I am not understanding why I can't place an order at a certain time. There is too much detail to put in this message window. Any help will be appreciated.

              If there is something else you need me to send you, let me know. Thanks
              Last edited by TradingDreamer; 05-06-2010, 11:08 AM.

              Comment


                #8
                Hello TradingDreamer,

                Just jumping in here and this may not explain it.

                It shows that a signal is generated in the strategy and in the trace file and in my log file at a limit price and the orders tab DOES NOT show this order.
                This will be the case if the orders are hypothetical transactions. The orders tab will display orders generated by a strategy running in real time only. Past hypothetical fills will show up in TraceOrders output as well as on the chart, but not the orders tab.

                Let us know if this does not explain this.
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  I remember reading something about the hypothetical orders when in simulation.

                  I can understand the Hypothetical situation not working, but I am concerned that the stop and the profit just canceled somewhere when the price was around 924.00 or 923.25. I never saw the stop or reverse sell appear on the chart. And I was still in the market long. The chart didn't adjust, either flat or short. If the EnterShortLimit is causing the issue, should it or the stop execute and show on the chart? Something is just canceling the orders.

                  I have a lot of orders in queue: I'm in long position, I have a ExitLongStop, EnterShortLimit to reverse direction (this is the one I'm struggling with), and a ExitLongLimit.

                  It is hard to test/evaluate a strategy when this occurs. I might be able to code around it.
                  Last edited by TradingDreamer; 05-06-2010, 12:51 PM.

                  Comment


                    #10
                    Hi TradingDreamer,

                    The orders would not be cancelled without reason. TraceOrders would identify the reason for any cancellation.

                    Agreed, recoding to avoid the Internal Handling Rules mentioned earlier would be the best next step.
                    TimNinjaTrader Customer Service

                    Comment


                      #11
                      Hello, would you mind glancing at the attached trace log (that I have documented and hilighted areas) because my concern is that I am not sending any cancel orders, and if the last EnterShortLimit is causing the cancels (which it probably should), the EnterShortLimit never displays on the chart and NT still thinks I am long! I can understand it canceling the stop and profit orders, but why am I still long? TheEnterShortLimit (1 contract) should reverse my position (or at least make me flat), but NT still says long.

                      EnterShortLimit
                      7/1/2009 2:01:56 PM Entered internal PlaceOrder() method at 7/1/2009 2:01:56 PM: Action=SellShort OrderType=Limit Quantity=1 LimitPrice=924.00 StopPrice=0 SignalName='ESsell' FromEntrySignal=''
                      This never shows on the Ninja Orders Tab and NT still says I am long.
                      7/1/2009 2:01:56 PM Cancelled expired order: BarsInProgress=0: Order='57f99d19d5c1424ca799b4609b2cb308/Sim101' Name='LongStop' State=Working Instrument='ES 09-09' Action=Sell Limit price=0 Stop price=923.25 Quantity=1 Strategy='CompositeStrength' Type=Stop Tif=Gtc Oco='' Filled=0 Fill price=0 Token='57f99d19d5c1424ca799b4609b2cb308' Gtd='12/1/2099 12:00:00 AM'
                      Why is this cancelled? The Sell order does not show on the Ninja Order tab.

                      By the way, after this happens, NT quits working. No trades show on the chart and I have lost markers I put on the chart after this happens. Please reference the first image file I attached at the beginning of this thread. You will see my concern.

                      I am also confused by the statement, orders will not appear on the orders tab when running in simulated (external datafeed mode). When I run in external data feed mode, all my transactions show on the orders tab until this NT issue. The more I look at it, I don't see I am doing anything wrong. I could be missing something, but with out anyone validating my well documented trace log, I can't determine if this is a NT issue or a missunderstanding of trading rules.
                      Last edited by TradingDreamer; 05-06-2010, 08:26 PM.

                      Comment


                        #12
                        TradingDreamer, can you please send us or attach the complete trace output you generated with the strategy in question? The trace taken out of context can be easily misleading...

                        For sure if you've got a Long Stop place it would prevent the EnterShortLimit from triggering as you're running into the order handling rules with this. You needed to cancel the stop first, wait for a confirmation of the changed orderstate and then issue the reversal order here.

                        Also: are the orders / stops set to liveUntilCancelled? If not they would expire on the next OnBarUpdate() call, this is default and expected behavior in NT.

                        Orders from backtesting would not show in the Control Center's Orders tab, only if you for example trade realtime on sim or Market Replay you would see relevant orders being shown there.

                        Comment


                          #13
                          I am going to close this posting. I have found that NT is working correctly. Since NT is a well designed systems for simple trading and complex strategy development, the trading rules can get extremely complex and the liveUntilCancelled was throwing me off.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                          0 responses
                          656 views
                          0 likes
                          Last Post Geovanny Suaza  
                          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                          0 responses
                          370 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by Mindset, 02-09-2026, 11:44 AM
                          0 responses
                          109 views
                          0 likes
                          Last Post Mindset
                          by Mindset
                           
                          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                          0 responses
                          574 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by RFrosty, 01-28-2026, 06:49 PM
                          0 responses
                          577 views
                          1 like
                          Last Post RFrosty
                          by RFrosty
                           
                          Working...
                          X