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

NT autoplot misaligned

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

    NT autoplot misaligned

    note in pic that NT PnL line and entry/exit points are shifted down

    this occured after manually adding an indicator (keltner) to the chart after the trades had been made

    I tried to reproduce and could not so far...will look for it and document next time it occurs
    Attached Files

    #2
    Thanks ATI user for keeping us posted.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      this pic is not the same misalignment issue as the first pic, however I am getting these regularly without doing anything

      note the execution time is 6 seconds before the end of the bar and the plot is at the entry price (8559) however the high for the bar is 2 ticks below the entry price (8557)

      clearly this is not possible ...it is plotting a bar too soon...or the timestamp of the bar is wrong...

      this is a 90 tick chart of the YM...live Zenfire feed
      Attached Files

      Comment


        #4
        What type of order are you submitting? We are going to need reproducible steps if you manage to figure them out. Thanks.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          on a simple condition ....entryOrder = EnterLong(1, "MyEntry");

          no steps to reproduce...running a simple cs on a 90 tick.....one of 6 charts running exact same cs on 6 diff timeframes on quad processor....live feed

          do not know what other steps I can give you..please advise

          Comment


            #6
            same bug here on entry and exit

            ExitLong();

            first pic is 60 tick....second is 90 tick chart
            Attached Files
            Last edited by ATI user; 11-26-2008, 02:33 PM.

            Comment


              #7
              Please post a strategy and I will try it on my end.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                if you do not get the same plot error in the pic at 9:38:08 AM on 26 nov for the YM (i.e. plots entry at 8328 on a bar with a high of 8327), let me know and I will send you the data file

                I exported the strategy and tested on the same data on a second computer and reproduced the same plot error...
                Attached Files
                Last edited by ATI user; 12-02-2008, 01:16 AM.

                Comment


                  #9
                  Please send me the data as well. Is this for historical backtest? Do I need to be running in real-time? Please provide me with the exact steps you would like me to take. Thank you.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    Josh

                    Did you receive the data? I sent it to you email address.

                    Re steps...just run the data on a 60 tick chart and error will occur at 9:38:08

                    Comment


                      #11
                      I have. Thank you. I will investigate it on Monday. Thank you for your patience.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        ATI user,

                        I was unable to find the trade you were looking at, possibly due to time zone differences, but I reviewed every trade your strategy took against the Market Replay and I found no problems with any of them.

                        See screenshot of all the trades made by your strategy here: http://i38.tinypic.com/33aq4ut.jpg

                        Also, if you could upload your code in a fashion where I can see the code that would be of help too. Thank you.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          Josh

                          I was unable to reproduce error also...until I started the replay a couple bars before 9:38:08 EST.... then the first plot is the error

                          Comment


                            #14
                            this code produces the error running the data on a 60 tick YM chart in market replay

                            [Description("plotbugtest")]
                            [Gui.Design.DisplayName("plotbugtest")]
                            public class plotbugtest : Strategy
                            {
                            #region Variables
                            private IOrder entryOrder = null;
                            private IOrder stopOrder = null;
                            private IOrder targetOrder = null;
                            private string workingOrder = "flat";
                            private double scalpStop = 0;
                            #endregion

                            protected override void Initialize()
                            {
                            Add(EMA(4));
                            Add(EMA(6));
                            EMA(4).Plots[0].Pen.Color = Color.Lime;
                            SetTrailStop(CalculationMode.Ticks, 20 );
                            CalculateOnBarClose = false;
                            }

                            protected override void OnBarUpdate()
                            {
                            if ( !Historical && Position.MarketPosition == MarketPosition.Flat )
                            {
                            if ( entryOrder == null
                            && CrossAbove(EMA(4),EMA(6),1)
                            )
                            {
                            entryOrder = EnterLong(1, "MyEntry");
                            workingOrder = "long";
                            }
                            else if ( entryOrder == null
                            && CrossBelow(EMA(4),EMA(6),1)
                            )
                            {
                            entryOrder = EnterShort(1, "MyEntry");
                            workingOrder = "short";
                            }
                            }
                            }

                            protected override void OnOrderUpdate(IOrder order)
                            {
                            if ( entryOrder != null && entryOrder.Token == order.Token )
                            {
                            if (order.OrderState == OrderState.Cancelled && order.Filled == 0)
                            entryOrder = null;
                            }
                            }

                            protected override void OnExecution(IExecution execution)
                            {
                            if (entryOrder != null && entryOrder.Token == execution.Order.Token)
                            {
                            if ( execution.Order.OrderState == OrderState.Filled
                            || execution.Order.OrderState == OrderState.PartFilled
                            || (execution.Order.OrderState == OrderState.Cancelled && execution.Order.Filled > 0))
                            {
                            if ( workingOrder == "long" )
                            {
                            scalpStop = execution.Order.AvgFillPrice - 20 * TickSize;
                            stopOrder = ExitLongStop(0, true, execution.Order.Filled, scalpStop, "MyStop", "MyEntry");
                            }
                            else if ( workingOrder == "short" )
                            {
                            scalpStop = execution.Order.AvgFillPrice + 20 * TickSize;
                            stopOrder = ExitShortStop(0, true, execution.Order.Filled, scalpStop, "MyStop", "MyEntry");
                            }
                            if (execution.Order.OrderState != OrderState.PartFilled)
                            entryOrder = null;
                            }
                            }

                            if ( (stopOrder != null && stopOrder.Token == execution.Order.Token) )
                            {
                            if (execution.Order.OrderState == OrderState.Filled || execution.Order.OrderState == OrderState.PartFilled)
                            stopOrder = null;
                            }
                            }
                            Attached Files

                            Comment


                              #15
                              plot error is common....

                              this chart is live zenfire feed this morning...

                              all 3 pnl entry/exit plots are on the wrong bar
                              Attached Files
                              Last edited by ATI user; 12-02-2008, 09:03 AM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by rbeckmann05, Yesterday, 06:48 PM
                              1 response
                              12 views
                              0 likes
                              Last Post bltdavid  
                              Started by llanqui, Today, 03:53 AM
                              0 responses
                              6 views
                              0 likes
                              Last Post llanqui
                              by llanqui
                               
                              Started by burtoninlondon, Today, 12:38 AM
                              0 responses
                              10 views
                              0 likes
                              Last Post burtoninlondon  
                              Started by AaronKoRn, Yesterday, 09:49 PM
                              0 responses
                              15 views
                              0 likes
                              Last Post AaronKoRn  
                              Started by carnitron, Yesterday, 08:42 PM
                              0 responses
                              11 views
                              0 likes
                              Last Post carnitron  
                              Working...
                              X