Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

cancelled expired order

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

    cancelled expired order

    I have settrailstop in initialize section set to 5 ticks. Sometimes the trailstop works, sometimes it cancels immediately after the entry order is sent.

    I'm using the managed approach with calc on bar close set to false. Below is the traceorder output.

    9/28/2010 7:02:29 AM Entered internal PlaceOrder() method at 9/28/2010 7:02:29 AM: Action=SellShort OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''

    9/28/2010 7:02:29 AM Cancelled expired order: BarsInProgress=0: Order='40dd4001e2a749f495d48d6c23709961/Replay101' Name='Trail stop' State=Accepted Instrument='$EURUSD' Action=BuyToCover Limit price=0 Stop price=1.34594 Quantity=1 Strategy='OFc2a5_w_HighLow2' Type=Stop Tif=Gtc Oco='78fda6470c67432b82d5ddf370143667' Filled=0 Fill price=0 Token='40dd4001e2a749f495d48d6c23709961' Gtd='12/1/2099 12:00:00 AM'

    #2
    mgin98, thanks for the report, those should not auto expire like the Exit() methods - which NT version are you using to test?

    Thanks

    Comment


      #3
      I'm still using 7.0.0.19. I'll upgrade to 22 and let you know if that fixes it.

      Comment


        #4
        Just upgraded to 22 and still seeing the same behavior during replay of strategy. There doesn't appear to be any consistency. Some trail and others immediately cancel. I just sent the log and trace files.


        9/28/2010 7:08:40 AM Entered internal PlaceOrder() method at 9/28/2010 7:08:40 AM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='long' FromEntrySignal=''

        9/28/2010 7:08:40 AM Cancelled expired order: BarsInProgress=0: Order='48cc444fa123435a9479d1c451a9b1a8/Replay101' Name='Trail stop' State=Accepted Instrument='$EURUSD' Action=Sell Limit price=0 Stop price=1.34575 Quantity=1 Strategy='OFc2a5_w_HighLow2' Type=Stop Tif=Gtc Oco='b0e0d8ec6d0e488bbc873f87259b7e4c' Filled=0 Fill price=0 Token='48cc444fa123435a9479d1c451a9b1a8' Gtd='12/1/2099 12:00:00 AM'

        Comment


          #5
          Ok, thanks for checking on B22 - will check for your files sent to support.

          Comment


            #6
            As an additional reference, the strategy is running on a tenth-pip 1-tick chart with signals generated in onbarupdate, bar close set to false.

            I'm running live NT against an MB demo account and encountered cancelled trailstops in the strategy position frequently as well as several hard lockups of the platform and an NT app crash. Taking that as an indication, I changed from tenth-pip 1-tick chart to running the strategy on a tenth-pip 1-range chart and have had no cancelled trailstops nor app crashes running for several hours today so far.

            Comment


              #7
              Thanks for the additional input - can you please let me know under which ticket # you sent in the logs with the app crashes so I can check into?

              Thanks

              Comment


                #8
                I didn't send the logs for the app crash before but have just now.

                Comment


                  #9
                  cancelled expired order

                  I am seeing this now under RC1 when setting an initial setstoploss. I worked around the canceled trailing stop problem by switching from tick to range charts but now I'm seeing basic stop losses being canceled...not under all circumstances, but enough to be very concerned. It's copied from the help file straight to the initialize section.

                  11/18/2010 6:48:31 AM Entered internal PlaceOrder() method at 11/18/2010 6:48:31 AM: BarsInProgress=0 Action=SellShort OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='breakoutshort' FromEntrySignal=''

                  11/18/2010 6:48:31 AM Cancelled expired order: BarsInProgress=0: Order='f0f6acd3e887442985e254549180f5e4/Replay101' Name='Stop loss' State=Accepted Instrument='$EURUSD' Action=BuyToCover Limit price=0 Stop price=1.36492 Quantity=1 Strategy='Algo2b' Type=Stop Tif=Gtc Oco='61bcb0931ad34ecca9db22796c39b02e-930' Filled=0 Fill price=0 Token='f0f6acd3e887442985e254549180f5e4' Gtd='12/1/2099 12:00:00 AM'

                  Comment


                    #10
                    Hello there, I will have Bertrand get back to you tomorrow.
                    AustinNinjaTrader Customer Service

                    Comment


                      #11
                      You would need to check the TraceOrders output for the sequence / events leading to the expiring order to understand the scenario you're running into here - if you like please send me the code you tested and your settings to support at ninjatrader dot com to my Attn.

                      Comment


                        #12
                        I am using setstoploss but dynamically setting and resetting it in onbarupdate which is where the problem may be. I emailed the script to support referencing this post number.



                        11/18/2010 5:33:49 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Ticks Value=30 Currency=0 Simulated=False

                        11/18/2010 5:33:49 AM Entered internal PlaceOrder() method at 11/18/2010 5:33:49 AM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='breakoutlong' FromEntrySignal=''

                        11/18/2010 5:33:49 AM Cancelled expired order: BarsInProgress=0: Order='80f192447fd94e5885f49008e343f453/Replay101' Name='Stop loss' State=Accepted Instrument='$EURUSD' Action=Sell Limit price=0 Stop price=1.36201 Quantity=1 Strategy='Algo2bNT' Type=Stop Tif=Gtc Oco='eab488faf86549a0bcae64934cb22029-2122' Filled=0 Fill price=0 Token='80f192447fd94e5885f49008e343f453' Gtd='12/1/2099 12:00:00 AM'

                        11/18/2010 5:36:07 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1.36241 Currency=0 Simulated=False

                        Comment


                          #13
                          Ok, thanks got it and also replied to your email directly - have you tried calling the Enter() method first and then SetStopLoss() for your 'breakout entry' code part?

                          Comment


                            #14
                            I did not try entry first since I received confirmation from Brett Barret that setstoploss must preceed. Here is summary of what I have just for others who may come across the issue since you have the code and already aware.

                            I have setstoploss in initialize where istop is an int variable set to 30 (tenth-pip charts) or 3 pips.

                            SetStopLoss(CalculationMode.Ticks, istop);

                            In onbarupdate:

                            I have a condition that when marketposition is flat to:

                            SetStopLoss(CalculationMode.Ticks, istop);


                            Next I have a condition that if position is long and price is in profit 30/3 pips to dynamically move stop to breakeven:

                            stopprice = longprice + 10 * TickSize;
                            SetStopLoss(CalculationMode.Price, stopprice);


                            Then I have the entry condition to go long where I set everything up:

                            SetStopLoss(CalculationMode.Ticks, istop);
                            EnterLong(lotsize,
                            "breakoutlong");
                            longprice = GetCurrentAsk();


                            Attached is a pic of a few trades and the associated tracelogs below.

                            11/18/2010 6:08:25 AM |BOlong| Flat
                            11/18/2010 6:08:25 AM Entered internal PlaceOrder() method at 11/18/2010 6:08:25 AM: BarsInProgress=0 Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
                            11/18/2010 6:08:25 AM Ignored PlaceOrder() method: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
                            11/18/2010 6:08:25 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Ticks Value=30 Currency=0 Simulated=False
                            11/18/2010 6:08:25 AM Entered internal PlaceOrder() method at 11/18/2010 6:08:25 AM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='breakoutlong' FromEntrySignal=''
                            11/18/2010 6:10:25 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1.36402 Currency=0 Simulated=False
                            11/18/2010 6:10:25 AM Amended stop order: Order='6d7584d9a7ec4f6586d74029b1735aa2/Replay101' Name='Stop loss' State=Accepted Instrument='$EURUSD' Action=Sell Limit price=0 Stop price=1.36402 Quantity=1 Strategy='Algo2bNT' Type=Stop Tif=Gtc Oco='0011f77454724fa6821dffa6ca8ee6fc-2401' Filled=0 Fill price=0 Token='6d7584d9a7ec4f6586d74029b1735aa2' Gtd='12/1/2099 12:00:00 AM'
                            11/18/2010 6:10:25 AM breakevenlong || stop = 1.36402 || longprice= 1.36392 || Close = 1.36422
                            11/18/2010 6:11:15 AM |BOShort| Flat
                            11/18/2010 6:11:15 AM Entered internal PlaceOrder() method at 11/18/2010 6:11:15 AM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
                            11/18/2010 6:11:15 AM Ignored PlaceOrder() method: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
                            11/18/2010 6:11:15 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Ticks Value=30 Currency=0 Simulated=False
                            11/18/2010 6:11:15 AM Entered internal PlaceOrder() method at 11/18/2010 6:11:15 AM: BarsInProgress=0 Action=SellShort OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='breakoutshort' FromEntrySignal=''
                            11/18/2010 6:11:15 AM Cancelled expired order: BarsInProgress=0: Order='9d7a523f442e4886a200265f072a08e4/Replay101' Name='Stop loss' State=Accepted Instrument='$EURUSD' Action=BuyToCover Limit price=0 Stop price=1.36374 Quantity=1 Strategy='Algo2bNT' Type=Stop Tif=Gtc Oco='15f3afc7f92041699c7b809038386e99-2401' Filled=0 Fill price=0 Token='9d7a523f442e4886a200265f072a08e4' Gtd='12/1/2099 12:00:00 AM'
                            11/18/2010 6:14:02 AM |BOlong| Short
                            11/18/2010 6:14:02 AM Entered internal PlaceOrder() method at 11/18/2010 6:14:02 AM: BarsInProgress=0 Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
                            11/18/2010 6:14:02 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Ticks Value=30 Currency=0 Simulated=False
                            11/18/2010 6:14:02 AM Entered internal PlaceOrder() method at 11/18/2010 6:14:02 AM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='breakoutlong' FromEntrySignal=''
                            11/18/2010 6:14:02 AM Cancelled expired order: BarsInProgress=0: Order='4652a16deda946a1bdd5dbbf5da49479/Replay101' Name='Stop loss' State=Accepted Instrument='$EURUSD' Action=Sell Limit price=0 Stop price=1.36372 Quantity=1 Strategy='Algo2bNT' Type=Stop Tif=Gtc Oco='d4dbc96fa5a346b4bfec4537dc96cab7-2401' Filled=0 Fill price=0 Token='4652a16deda946a1bdd5dbbf5da49479' Gtd='12/1/2099 12:00:00 AM'
                            11/18/2010 6:14:02 AM Cancelled expired order: BarsInProgress=0: Order='ca0c58cc9eb94aa38f64fed348f9a9e1/Replay101' Name='Stop loss' State=Accepted Instrument='$EURUSD' Action=Sell Limit price=0 Stop price=1.36372 Quantity=1 Strategy='Algo2bNT' Type=Stop Tif=Gtc Oco='e21e63434ebd427198cdd3532408e73c-2401' Filled=0 Fill price=0 Token='ca0c58cc9eb94aa38f64fed348f9a9e1' Gtd='12/1/2099 12:00:00 AM'
                            11/18/2010 6:14:29 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1.36412 Currency=0 Simulated=False
                            11/18/2010 6:14:29 AM breakevenlong || stop = 1.36412 || longprice= 1.36402 || Close = 1.36433
                            11/18/2010 6:18:37 AM |BOShort| Long
                            11/18/2010 6:18:37 AM Entered internal PlaceOrder() method at 11/18/2010 6:18:37 AM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
                            11/18/2010 6:18:37 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Ticks Value=30 Currency=0 Simulated=False
                            11/18/2010 6:18:37 AM Entered internal PlaceOrder() method at 11/18/2010 6:18:37 AM: BarsInProgress=0 Action=SellShort OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='breakoutshort' FromEntrySignal=''
                            Attached Files
                            Last edited by mgin98; 11-22-2010, 11:28 AM.

                            Comment


                              #15
                              Hello,

                              Thanks for posting for others!

                              Let me know if I can be of further assistance.
                              BrettNinjaTrader Product Management

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              648 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              369 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              108 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              572 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              573 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X