Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Differences between 6.5 and 7.0

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

    Differences between 6.5 and 7.0

    Dear sirs,
    we are trading fine with 6.5 release.
    Now we are testing ts with latest release 7.0.0.23 and we found differences.
    Suppose we are long with an exinglongstop sended.
    After few hours we will send 2 orders:
    - one ExitLongLimit
    - one ExitLongStop

    the second order doesn't work and in the log there isn't any row that explain because.
    We already tried to change entry handling and entries per direction but error persists.
    Can you please check this behaviour?
    Thanks in advanced
    Simone

    #2
    Simone, which NT 7 version are you using? Is this the latest provided B23 / RC1?

    Do you have TraceOrders enabled in your strategy?



    What would the output window tell you if you try to update your stop and send the target limit exit?

    Thanks
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Dear mr. Bertrand,
      we are using RC1.
      We don't have traceOrders enable, but we will enable it.
      One information to understand the problem: if we removed manually the first exinglong stop all works fine.
      Consider that we are using a lot of ts and, if it's possible, we would not modified them..
      Thank you

      Comment


        #4
        Ok Simone - thanks - would you please monitor the strategy with TraceOrders enabled and post the ouput then when the issue surfaces again?

        In addition, please sent me your diagnostic files via the Help > Mail to Support feature in NinjaTrader.

        Thanks in advance
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Answer was:
          There is no remaining quantity to exit

          Here complete trace:
          08/10/2008 12.20.01 Entered internal PlaceOrder() method at 08/10/2008 12.20.01: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=1 LimitPrice=2724 StopPrice=0 SignalName='TS_Livelli_MAttina_DAX_2_6_LongLimit' FromEntrySignal=''
          08/10/2008 12.20.01 Entered internal PlaceOrder() method at 08/10/2008 12.20.01: BarsInProgress=0 Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=2734 SignalName='TS_Livelli_MAttina_DAX_2_6_LongStop' FromEntrySignal=''
          Cancelled custom managed order at 08/10/2008 12.20.33: Order='7059fac9adce4546b5230c48260d2c1e/Replay101' Name='TS_Livelli_MAttina_DAX_2_6_LongStop' State=Accepted Instrument='FESX 12-08' Action=Buy Limit price=0 Stop price=2734 Quantity=1 Strategy='TS_Livelli_MAttina_DAX_2_6' Type=Stop Tif=Day Oco='' Filled=0 Fill price=0 Token='7059fac9adce4546b5230c48260d2c1e' Gtd='01/12/2099 0.00.00'
          08/10/2008 12.20.33 Entered internal PlaceOrder() method at 08/10/2008 12.20.33: BarsInProgress=0 Action=Sell OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=2627 SignalName='TS_Livelli_MAttina_DAX_2_6_STOPPATA_LO NG' FromEntrySignal=''
          08/10/2008 21.54.32 Entered internal PlaceOrder() method at 08/10/2008 21.54.32: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=1 LimitPrice=2688 StopPrice=0 SignalName='TS_Livelli_MAttina_DAX_2_6_ExitLongLim it' FromEntrySignal=''
          08/10/2008 21.54.32 Entered internal PlaceOrder() method at 08/10/2008 21.54.32: BarsInProgress=0 Action=Sell OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=2677 SignalName='TS_Livelli_MAttina_DAX_2_6_ExitLongSto p' FromEntrySignal=''
          08/10/2008 21.54.32 Ignored PlaceOrder() method at 08/10/2008 21.54.32: Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=2677 SignalName='TS_Livelli_MAttina_DAX_2_6_ExitLongSto p' FromEntrySignal='' Reason='There is no remaining quantity to exit'

          Comment


            #6
            Sounds to me as if your position is already closed.

            You can confirm this by seeing if you have an execution filled already by printing in OnExecution().

            Code:
            protected override void OnExecution(IExecution execution)
            {
                 Print("OnExecution: " + execution.ToString());
            }
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Hallo Josh
              >Sounds to me as if your position is already closed.
              No, I'm long, I can see this in the book and in the log of my ts

              Here the trace:
              08/10/2008 12.20.01 Entered internal PlaceOrder() method at 08/10/2008 12.20.01: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=1 LimitPrice=2724 StopPrice=0 SignalName='TS_Livelli_MAttina_DAX_2_6_LongLimit' FromEntrySignal=''
              08/10/2008 12.20.01 Entered internal PlaceOrder() method at 08/10/2008 12.20.01: BarsInProgress=0 Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=2734 SignalName='TS_Livelli_MAttina_DAX_2_6_LongStop' FromEntrySignal=''
              Cancelled custom managed order at 08/10/2008 12.20.33: Order='8f728c1925f746c08d3e7e992e6fcb49/Replay101' Name='TS_Livelli_MAttina_DAX_2_6_LongStop' State=Accepted Instrument='FESX 12-08' Action=Buy Limit price=0 Stop price=2734 Quantity=1 Strategy='TS_Livelli_MAttina_DAX_2_6' Type=Stop Tif=Day Oco='' Filled=0 Fill price=0 Token='8f728c1925f746c08d3e7e992e6fcb49' Gtd='01/12/2099 0.00.00'
              08/10/2008 12.20.33 Entered internal PlaceOrder() method at 08/10/2008 12.20.33: BarsInProgress=0 Action=Sell OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=2627 SignalName='TS_Livelli_MAttina_DAX_2_6_STOPPATA_LO NG' FromEntrySignal=''
              OnExecution: Execution='d1f4e115bae44829a0e1f24ea8446023' Instrument='FESX 12-08' Account='Replay101' Name='TS_Livelli_MAttina_DAX_2_6_LongLimit' Exchange=Default Price=2724 Quantity=1 Market position=Long Commission=0 Order='e6ce50370ed948d48fa4793b6c8d4473' Time='08/10/2008 12.20.33'
              08/10/2008 21.54.32 Entered internal PlaceOrder() method at 08/10/2008 21.54.32: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=1 LimitPrice=2688 StopPrice=0 SignalName='TS_Livelli_MAttina_DAX_2_6_ExitLongLim it' FromEntrySignal=''
              08/10/2008 21.54.32 Entered internal PlaceOrder() method at 08/10/2008 21.54.32: BarsInProgress=0 Action=Sell OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=2677 SignalName='TS_Livelli_MAttina_DAX_2_6_ExitLongSto p' FromEntrySignal=''
              08/10/2008 21.54.32 Ignored PlaceOrder() method at 08/10/2008 21.54.32: Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=2677 SignalName='TS_Livelli_MAttina_DAX_2_6_ExitLongSto p' FromEntrySignal='' Reason='There is no remaining quantity to exit'
              Cancelled custom managed order at 08/10/2008 21.55.32: Order='993e298565ad461ebb0d0a88148de9d1/Replay101' Name='TS_Livelli_MAttina_DAX_2_6_ExitLongLimit' State=Working Instrument='FESX 12-08' Action=Sell Limit price=2688 Stop price=0 Quantity=1 Strategy='TS_Livelli_MAttina_DAX_2_6' Type=Limit Tif=Day Oco='' Filled=0 Fill price=0 Token='993e298565ad461ebb0d0a88148de9d1' Gtd='01/12/2099 0.00.00'
              08/10/2008 21.55.32 Entered internal PlaceOrder() method at 08/10/2008 21.55.32: BarsInProgress=1 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='TS_Livelli_MAttina_DAX_2_6_END_DAY_FOR ZATO_LONG' FromEntrySignal=''
              08/10/2008 21.55.32 Cancelled pending exit order, since associated position is closed: Order='226a0b971a224a5a90d003d42bc80a61/Replay101' Name='TS_Livelli_MAttina_DAX_2_6_STOPPATA_LONG' State=Accepted Instrument='FESX 12-08' Action=Sell Limit price=0 Stop price=2627 Quantity=1 Strategy='TS_Livelli_MAttina_DAX_2_6' Type=Stop Tif=Day Oco='' Filled=0 Fill price=0 Token='226a0b971a224a5a90d003d42bc80a61' Gtd='01/12/2099 0.00.00'
              OnExecution: Execution='67a384b5e0d049db98014a1f650afcca' Instrument='FESX 12-08' Account='Replay101' Name='TS_Livelli_MAttina_DAX_2_6_END_DAY_FORZATO_L ONG' Exchange=Default Price=2683 Quantity=1 Market position=Short Commission=0 Order='c3b83d921e4c4ae6870c71ecad785cce' Time='08/10/2008 21.55.32'

              Comment


                #8
                simone, can you please post the code you're using here?
                AustinNinjaTrader Customer Service

                Comment


                  #9
                  >simone, can you please post the code you're using here?

                  Sorry, I can't..
                  Ts has 2000 rows and it's not possible post the code.
                  But I think is simple replicate the problem..
                  Best

                  Comment


                    #10
                    Simone, are you sure you reference the correct signal names in your code? Can you replay the same portion of the strategy with just blank signal names so everything would be picked up?
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      >Simone, are you sure you reference the correct signal names in your code?
                      Yes,
                      We tested same day, same ts, same instrument but with 6.5 release and all work.
                      In the log you can check at 21.54.32 two rows with Entered internal PlaceOrder, in the previous trace (rel 7.0) there were one Entered internal PlaceOrder and one Ignored PlaceOrder.

                      TRACE rel 6.5:
                      08/10/2008 12.20.01 Entered internal PlaceOrder() method at 08/10/2008 12.20.01: Action=Buy OrderType=Limit Quantity=1 LimitPrice=2724 StopPrice=0 SignalName='TS_Livelli_MAttina_DAX_2_6_LongLimit' FromEntrySignal=''
                      08/10/2008 12.20.01 Entered internal PlaceOrder() method at 08/10/2008 12.20.01: Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=2734 SignalName='TS_Livelli_MAttina_DAX_2_6_LongStop' FromEntrySignal=''
                      Cancelled custom managed order at 08/10/2008 12.20.33: Order='eddbf967edb94655ad523fccb33a30c2/Replay101' Name='TS_Livelli_MAttina_DAX_2_6_LongStop' State=Accepted Instrument='FESX 12-08' Action=Buy Limit price=0 Stop price=2734 Quantity=1 Strategy='TS_Livelli_MAttina_DAX_2_6' Type=Stop Tif=Day Oco='' Filled=0 Fill price=0 Token='eddbf967edb94655ad523fccb33a30c2' Gtd='01/12/2099 0.00.00'
                      08/10/2008 12.20.33 Entered internal PlaceOrder() method at 08/10/2008 12.20.33: Action=Sell OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=2627 SignalName='TS_Livelli_MAttina_DAX_2_6_STOPPATA_LO NG' FromEntrySignal=''
                      08/10/2008 21.54.32 Entered internal PlaceOrder() method at 08/10/2008 21.54.32: Action=Sell OrderType=Limit Quantity=1 LimitPrice=2688 StopPrice=0 SignalName='TS_Livelli_MAttina_DAX_2_6_ExitLongLim it' FromEntrySignal=''
                      08/10/2008 21.54.32 Entered internal PlaceOrder() method at 08/10/2008 21.54.32: Action=Sell OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=2677 SignalName='TS_Livelli_MAttina_DAX_2_6_ExitLongSto p' FromEntrySignal=''
                      Cancelled custom managed order at 08/10/2008 21.55.32: Order='5c1128e70bd3429989609c732609197a/Replay101' Name='TS_Livelli_MAttina_DAX_2_6_ExitLongLimit' State=Working Instrument='FESX 12-08' Action=Sell Limit price=2688 Stop price=0 Quantity=1 Strategy='TS_Livelli_MAttina_DAX_2_6' Type=Limit Tif=Day Oco='' Filled=0 Fill price=0 Token='5c1128e70bd3429989609c732609197a' Gtd='01/12/2099 0.00.00'
                      Cancelled custom managed order at 08/10/2008 21.55.32: Order='72bc4fe11c014a6ca3be0c28ddc6b13a/Replay101' Name='TS_Livelli_MAttina_DAX_2_6_ExitLongStop' State=Accepted Instrument='FESX 12-08' Action=Sell Limit price=0 Stop price=2677 Quantity=1 Strategy='TS_Livelli_MAttina_DAX_2_6' Type=Stop Tif=Day Oco='' Filled=0 Fill price=0 Token='72bc4fe11c014a6ca3be0c28ddc6b13a' Gtd='01/12/2099 0.00.00'
                      08/10/2008 21.55.32 Entered internal PlaceOrder() method at 08/10/2008 21.55.32: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='TS_Livelli_MAttina_DAX_2_6_END_DAY_FOR ZATO_LONG' FromEntrySignal=''
                      08/10/2008 21.55.32 Cancelled pending exit order, since associated position is closed: Order='5a0f964f89b4485c87ce6acdd60cc645/Replay101' Name='TS_Livelli_MAttina_DAX_2_6_STOPPATA_LONG' State=Accepted Instrument='FESX 12-08' Action=Sell Limit price=0 Stop price=2627 Quantity=1 Strategy='TS_Livelli_MAttina_DAX_2_6' Type=Stop Tif=Day Oco='' Filled=0 Fill price=0 Token='5a0f964f89b4485c87ce6acdd60cc645' Gtd='01/12/2099 0.00.00'

                      Comment


                        #12
                        We created a simple test for you.
                        At 9:00 enter long + exitlongstop (stop loss)
                        At 12:00 Exitlongstop (this doesn't work)

                        Here the trace
                        08/10/2008 9.00.01 Entered internal PlaceOrder() method at 08/10/2008 9.00.01: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='TS_Test4NJ_EnterLong' FromEntrySignal=''
                        08/10/2008 9.00.01 Entered internal PlaceOrder() method at 08/10/2008 9.00.01: BarsInProgress=0 Action=Sell OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=25 SignalName='TS_Test4NJ_STOPPATA_LONG' FromEntrySignal=''
                        OnExecution: Execution='509743587ad7464f8ddece650641e452' Instrument='FESX 12-08' Account='Replay101' Name='TS_Test4NJ_EnterLong' Exchange=Default Price=2746 Quantity=1 Market position=Long Commission=0 Order='cb9d3eb9d0a242f59a9a57308232943f' Time='08/10/2008 9.00.01'
                        08/10/2008 12.00.01 Entered internal PlaceOrder() method at 08/10/2008 12.00.01: BarsInProgress=0 Action=Sell OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=2705 SignalName='TS_Test4NJ_ExitLongStop' FromEntrySignal=''
                        08/10/2008 12.00.01 Ignored PlaceOrder() method at 08/10/2008 12.00.01: Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=2705 SignalName='TS_Test4NJ_ExitLongStop' FromEntrySignal='' Reason='There is no remaining quantity to exit'



                        Here the ts:
                        #region Using declarations
                        using System;
                        using System.ComponentModel;
                        using System.Diagnostics;
                        using System.Drawing;
                        using System.Drawing.Drawing2D;
                        using System.Xml.Serialization;
                        using NinjaTrader.Cbi;
                        using NinjaTrader.Data;
                        using NinjaTrader.Indicator;
                        using NinjaTrader.Strategy;
                        using System.Windows.Forms;
                        #endregion

                        // This namespace holds all strategies and is required. Do not change it.
                        namespace NinjaTrader.Strategy
                        {
                        /// <summary>
                        /// Enter the description of your strategy here
                        /// </summary>
                        [Description("TS_Test4NJ")]
                        [Gui.Design.DisplayName("TS_Test4NJ")]
                        public class TS_Test4NJ : Strategy
                        {
                        private int Ticks_Long_Meno=6;//6

                        /// <summary>
                        /// This method is used to configure the strategy and is called once before any strategy method is called.
                        /// </summary>
                        protected override void Initialize()
                        {

                        this.RealtimeErrorHandling = RealtimeErrorHandling.TakeNoAction;

                        CalculateOnBarClose = true;
                        this.BarsRequired=1;
                        this.EntryHandling= EntryHandling.UniqueEntries;
                        this.TimeInForce=Cbi.TimeInForce.Day;
                        Add(PeriodType.Second, 30);
                        Add(PeriodType.Minute, 1);
                        this.ExitOnClose=true;
                        this.TraceOrders=true;
                        }

                        protected override void OnExecution(IExecution execution)
                        {
                        Print("OnExecution: " + execution.ToString());
                        }

                        /// <summary>
                        /// Called on each bar update event (incoming tick)
                        /// </summary>
                        protected override void OnBarUpdate()
                        {

                        if (BarsInProgress==0 && Time[0].Hour==9 && Time[0].Minute==0 ) //ENTER LONG 9:00
                        {
                        EnterLong(0,1,this.Name + "_EnterLong");
                        }

                        if (BarsInProgress==0 && Time[0].Hour==12 && Time[0].Minute==0 ) //EXIT LONG 12:00
                        {
                        double dblMarketValueMeno = Convert.ToDouble(Open[0] - ((double)Ticks_Long_Meno * TickSize));

                        ExitLongStop(0,true,1,dblMarketValueMeno,this.Name + "_ExitLongStop","");
                        }
                        }

                        protected override void OnOrderUpdate(IOrder order)
                        {
                        if (order.OrderState == OrderState.Filled && order.Name==this.Name + "_EnterLong")
                        {
                        double dblUscitaLONGStop=order.AvgFillPrice/111.0061;
                        ExitLongStop(0,true,1,dblUscitaLONGStop , this.Name + "_STOPPATA_LONG", "");
                        }
                        }

                        }
                        }

                        Comment


                          #13
                          Thanks Simone, we'll look into reproducing here and get back to you then.
                          BertrandNinjaTrader Customer Service

                          Comment


                            #14
                            Does it work any different for you when setting ExitOnClose = false?
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              To add - since you have realtime error handling off you would have a harder time noticing this log message - **NT** A Sell stop order placed at 'xxx' has been ignored since the stop price is greater than or equal to close price of the current bar. This is an invalid order and subsequent orders may also be ignored. Please fix your strategy.

                              This means some orders would not resolve unfortunately and you would need to fix your code to issue proper orders.
                              BertrandNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by helpwanted, Today, 03:06 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post helpwanted  
                              Started by Brevo, Today, 01:45 AM
                              0 responses
                              7 views
                              0 likes
                              Last Post Brevo
                              by Brevo
                               
                              Started by aussugardefender, Today, 01:07 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post aussugardefender  
                              Started by pvincent, 06-23-2022, 12:53 PM
                              14 responses
                              242 views
                              0 likes
                              Last Post Nyman
                              by Nyman
                               
                              Started by TraderG23, 12-08-2023, 07:56 AM
                              9 responses
                              384 views
                              1 like
                              Last Post Gavini
                              by Gavini
                               
                              Working...
                              X