Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8 - discrepancy between feels in real time and strategy anayser

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

    NT8 - discrepancy between feels in real time and strategy anayser

    I am running my strategy using real time data feed.
    As reported in different thread, some of the fills are questionable as they are at levels where market never traded;

    in this thread I would like to discuss/find out why when I run the same strategy in data analyzer now, I get different fills, (1 or 2 ticks below of the fills from real time run),
    in strategy analyzer I am running with tick replay, why the fills are different?
    fills from real time run are really suspicious, as are at levels where marked never traded.....
    what is wrong, why I am getting different results when everything is set up to be processed on every tick
    Attached Files
    Last edited by astef; 02-08-2016, 06:52 PM.

    #2
    Did you really mean the word "feel"? Or is it a typo for feed?
    Trying to understand the post. Feel is probably not the English word you mean to use.

    Comment


      #3
      Originally posted by sledge View Post
      Did you really mean the word "feel"? Or is it a typo for feed?
      Trying to understand the post. Feel is probably not the English word you mean to use.
      fill ( a price at which an order executed)

      Thanks for point that out; I hope now spelling is correct

      Comment


        #4
        Hello,
        What Order Fill resolution type do you have selected for the Historical Fill Processing in the backtest?
        Cody B.NinjaTrader Customer Service

        Comment


          #5
          with tick replay you can only select standard resolution
          if you select high, ninja complains indicating that you are already running at highest resolution

          Comment


            #6
            Hello,
            This is the opposite actually. If you are using Tick Replay we recommend that you use High for the historical order fill processing. Please see the help guide at the following link on the note for this: http://ninjatrader.com/support/helpG...ick_replay.htm
            Note: Tick Replay is not intended to function in NinjaScript strategy backtests, and will not provide the same results as running a strategy on live data with Tick Replay enabled. For greater order-fill resolution in strategy backtests, you can use the High Fill Resolution in the Strategy Analyzer.

            Can you provide the source of where you are seeing that we recommend to not use High with Tick Replay so we may make this change?
            Cody B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_CodyB View Post
              Hello,
              This is the opposite actually. If you are using Tick Replay we recommend that you use High for the historical order fill processing. Please see the help guide at the following link on the note for this: http://ninjatrader.com/support/helpG...ick_replay.htm
              Note: Tick Replay is not intended to function in NinjaScript strategy backtests, and will not provide the same results as running a strategy on live data with Tick Replay enabled. For greater order-fill resolution in strategy backtests, you can use the High Fill Resolution in the Strategy Analyzer.

              Can you provide the source of where you are seeing that we recommend to not use High with Tick Replay so we may make this change?
              1 High Resolution
              please note attached screen dump and clear message indicating that you can not select high resolution in tick replay
              2.re Tick Replay is not intended to function in NinjaScript
              I started another thread exactly on this subject pointing to inconsistency of the documentation
              NinjaTrader_Dave had made few comments on this and the thread: TickReplay NOT FOR BackTesting Strategy ???????? - and after few incorrect answers, the thread was deleted

              it is actually the best improvement in NT8 that we can now run tick replay.
              this is what gives you a competitive advantage as comparing to other programs
              for the first time I can write one ninja program good for testing and running live without the need to use multiple time frames and have convoluted ways of handling tick and 1 min bars and different processing of historical and live data
              the only problem is that the strategy analyzer does not handle fills appropriately.
              instead of using last tick (or next tick( value it is completely wrong
              I just cloect the last tick value and calculate my PL manually as can not relay on fills reported by ninja; this however works and for first time I can calculate what the real precise historical order fills should have been
              Attached Files

              Comment


                #8
                Hello,
                The message you are receiving was from previous versions of the beta. Can you verify that you have NinjaTrader 8 Beta 9 installed?
                I have confirmed with our Development team and Product Management team the Tick Replay should be used with High order fill processing.
                Cody B.NinjaTrader Customer Service

                Comment


                  #9
                  Beta 10 - significant step backwards

                  installed 8 beta 10

                  this is far worse then previous version
                  tick replay simply does not work

                  note the following code which will print all bars and all ticks
                  when running in tick reply mode i only get one tick for each 1 minute bar
                  previously it did work correctly and i could observe multiple ticks in tick replay mode

                  your charts and fills were incorrect, but i was able to capture entry criteria and was able to calculate p/l for each trade; now i can not do anything as i just get one tick regardless

                  //
                  // Copyright (C) 2015, NinjaTrader LLC <www.ninjatrader.com>.
                  // NinjaTrader reserves the right to modify or overwrite this NinjaScript component with each release.
                  //
                  #region Using declarations
                  using System;
                  using System.Collections.Generic;
                  using System.ComponentModel;
                  using System.ComponentModel.DataAnnotations;
                  using System.Linq;
                  using System.Text;
                  using System.Threading.Tasks;
                  using System.Windows;
                  using System.Windows.Input;
                  using System.Windows.Media;
                  using System.Xml.Serialization;
                  using NinjaTrader.Cbi;
                  using NinjaTrader.Gui;
                  using NinjaTrader.Gui.Chart;
                  using NinjaTrader.Gui.SuperDom;
                  using NinjaTrader.Data;
                  using NinjaTrader.NinjaScript;
                  using NinjaTrader.Core.FloatingPoint;
                  using NinjaTrader.NinjaScript.Indicators;
                  using NinjaTrader.NinjaScript.DrawingTools;
                  #endregion

                  //This namespace holds strategies in this folder and is required. Do not change it.
                  namespace NinjaTrader.NinjaScript.Strategies
                  {
                  public class MACrossOverTick : Strategy
                  {
                  private SMA smaFast;
                  private SMA smaSlow;

                  protected override void OnStateChange()
                  {
                  if (State == State.SetDefaults)
                  {
                  Description = "MACrossOverTick";
                  Name = "MACrossOverTick";
                  Fast = 10;
                  Slow = 25;


                  Calculate = Calculate.OnEachTick;
                  EntriesPerDirection = 1;
                  EntryHandling = EntryHandling.AllEntries;
                  IsExitOnSessionCloseStrategy = true;
                  ExitOnSessionCloseSeconds = 30;
                  IsFillLimitOnTouch = false;
                  MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
                  OrderFillResolution = OrderFillResolution.Standard;
                  Slippage = 0;
                  StartBehavior = StartBehavior.WaitUntilFlat;
                  TimeInForce = TimeInForce.Gtc;
                  TraceOrders = false;
                  RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
                  StopTargetHandling = StopTargetHandling.PerEntryExecution;
                  BarsRequiredToTrade = 20;




                  }
                  else if (State == State.Configure)
                  {
                  smaFast = SMA(Fast);
                  smaSlow = SMA(Slow);

                  smaFast.Plots[0].Brush = Brushes.Orange;
                  smaSlow.Plots[0].Brush = Brushes.Green;

                  AddChartIndicator(smaFast);
                  AddChartIndicator(smaSlow);
                  }
                  }

                  protected override void OnBarUpdate()
                  {

                  if (CurrentBar < BarsRequiredToTrade)
                  return;

                  if (IsFirstTickOfBar)
                  {
                  Print(" BAR "
                  + (State == State.Historical ? " H " : "R ")
                  + " " + Time[0].ToString()

                  + " Close[0]:" + Close[0].ToString()
                  + " High[0]:" + High[0].ToString("N2")
                  + " Low[0]:" + Low[0].ToString("N2")

                  );
                  }
                  Print(" TICK "
                  + (State == State.Historical ? " H " : "R ")
                  + " " + Time[0].ToString()

                  + " Close[0]:" + Close[0].ToString()
                  + " High[0]:" + High[0].ToString("N2")
                  + " Low[0]:" + Low[0].ToString("N2")

                  );


                  /* CROSSOVER DOES NOT WORK
                  if (CrossAbove(smaFast, smaSlow, 1))
                  EnterLong();
                  else if (CrossBelow(smaFast, smaSlow, 1))
                  EnterShort();
                  */

                  if (SMA(Fast)[0] > SMA(Slow)[0] && SMA(Fast)[1] <= SMA(Slow)[1])
                  {

                  Print(">>>>> GOLONG "
                  + (State == State.Historical ? " H " : "R ")
                  + " " + Time[0].ToString()
                  + " Close[0]:" + Close[0].ToString()

                  );
                  EnterLong();

                  }

                  if (SMA(Fast)[0] < SMA(Slow)[0] && SMA(Fast)[1] >= SMA(Slow)[1])
                  {
                  Print(">>>>> GOSHORT "
                  + (State == State.Historical ? " H " : "R ")
                  + " " + Time[0].ToString()
                  + " Close[0]:" + Close[0].ToString()

                  );
                  EnterShort();

                  }



                  }

                  #region Properties
                  [Range(1, int.MaxValue), NinjaScriptProperty]
                  [Display(ResourceType = typeof(Custom.Resource), Name = "Fast", GroupName = "NinjaScriptStrategyParameters", Order = 0)]
                  public int Fast
                  { get; set; }

                  [Range(1, int.MaxValue), NinjaScriptProperty]
                  [Display(ResourceType = typeof(Custom.Resource), Name = "Slow", GroupName = "NinjaScriptStrategyParameters", Order = 1)]
                  public int Slow
                  { get; set; }
                  #endregion
                  }
                  }

                  Comment


                    #10
                    Hello astef,

                    Thank you for your patience.

                    I have been testing and seeing the same results you have. I tested another script and saw what should occur, went back and tested yours to see it work properly. I am still testing with different versions of the beta to try to narrow this down.
                    Essentially, what you are seeing is unexpected and I was able to reproduce at one point. Thank you for reporting this item.

                    Comment


                      #11
                      any updates?

                      Comment


                        #12
                        Hello astef,

                        Thank you for your patience.

                        No updates at this time.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Rapine Heihei, Yesterday, 07:51 PM
                        1 response
                        12 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Started by kaywai, Today, 06:26 AM
                        1 response
                        6 views
                        0 likes
                        Last Post kaywai
                        by kaywai
                         
                        Started by ct, 05-07-2023, 12:31 PM
                        6 responses
                        205 views
                        0 likes
                        Last Post wisconsinpat  
                        Started by kevinenergy, 02-17-2023, 12:42 PM
                        118 responses
                        2,780 views
                        1 like
                        Last Post kevinenergy  
                        Started by briansaul, Today, 05:31 AM
                        0 responses
                        10 views
                        0 likes
                        Last Post briansaul  
                        Working...
                        X