djplastic Posted November 13, 2014 Report Share Posted November 13, 2014 Hi, is there a possibility to accurately backtest renko charts in ninja? I know about market replay, but there is no way to optimize. thanks for info Quote Link to comment Share on other sites More sharing options...
yamantaka Posted November 13, 2014 Report Share Posted November 13, 2014 Hi, is there a possibility to accurately backtest renko charts in ninja? I know about market replay, but there is no way to optimize. thanks for info You'll have to write special code for historical fill processing to have a shot at accurate backtesting. No point in optimizing if you don't do that. djplastic 1 Quote Link to comment Share on other sites More sharing options...
Trading1903 Posted November 13, 2014 Report Share Posted November 13, 2014 I Agree with yamantaka, but even then back testing is not 100% reliable with Ninja Trader. Another thing to worry about it is the bask testing data you use unless you are back testing big time frames ( 15, 30 min or more ). I wish I could get hold of a descent back testing program Quote Link to comment Share on other sites More sharing options...
admis Posted November 14, 2014 Report Share Posted November 14, 2014 is there a possibility to accurately backtest renko charts in ninja?... You'll have to write special code for historical fill processing to have a shot at accurate backtesting. No point in optimizing if you don't do that. All you have to do is making some adjustments in the file: C:\Users\...\Documents\NinjaTrader 7\bin\Custom\Type\@default.cs Find the following part of code: if (order.OrderType == OrderType.Market) { if (order.OrderAction == Cbi.OrderAction.Buy || order.OrderAction == Cbi.OrderAction.BuyToCover) FillPrice = Math.Min(NextHigh, NextOpen + SlippagePoints); else FillPrice = Math.Max(NextLow, NextOpen - SlippagePoints); } and change it to this form: if (order.OrderType == OrderType.Market) { if (order.OrderAction == Cbi.OrderAction.Buy || order.OrderAction == Cbi.OrderAction.BuyToCover) { Bars bar = Strategy.BarsArray[strategy.BarsInProgress]; FillPrice = Math.Min(NextHigh, bar.GetClose(bar.CurrentBar) + SlippagePoints); } else FillPrice = Math.Max(NextLow, NextOpen - SlippagePoints); } than save the file with another name (for example: mydefault.cs). From inside of NT open to edit any indicator you have in the source form and compile it. Reload NT and next time, when you will make your backtests, change backtest option: <FillType> mydefault ⭐ ESVepara, iksak, wizard101 and 5 others 8 Quote Link to comment Share on other sites More sharing options...
djplastic Posted November 14, 2014 Author Report Share Posted November 14, 2014 Thanks all, admis you are the best :) Quote Link to comment Share on other sites More sharing options...
wizard101 Posted November 14, 2014 Report Share Posted November 14, 2014 Incidientally for those that may have encountered this error message the namespace 'Ninjatrader.Strategy' already contains a definition for 'DefaultFillType' will need to just redefine the "Display Name and FillType part of the code to match their chosen name" and then recompile and go to the "Fill type" input tab under "historical fill processing to double check that you have the amended addition of the modified part of the code as expertly outlined by Admis" This is how I have had to correct mine "Admis and Atd" welcome to critique me lol as I am not a programmer "design engineer" by profession and just had to logistically work it out.... Anyhow here is the namespace amendment part of the code to remove that error: // This namespace holds all strategies and is required. Do not change it. namespace NinjaTrader.Strategy { /// <summary> /// </summary> [Gui.Design.DisplayName("mydefault")] public class mydefaultFillType : FillType take care all ! Darktrader, djplastic, newbie0101 and 1 other 4 Quote Link to comment Share on other sites More sharing options...
admis Posted November 14, 2014 Report Share Posted November 14, 2014 .... Anyhow here is the namespace amendment part of the code to remove that error: // This namespace holds all strategies and is required. Do not change it. namespace NinjaTrader.Strategy { /// <summary> /// </summary> [Gui.Design.DisplayName("mydefault")] public class mydefaultFillType : FillType Very proper action! It's my fault. I've forgotten to mention about it. wizard101 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.