Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I put a new system of mine (60 minute chart, non intraday) through market replay after testing it via strategy analyzer, and had differing results.
I undertand this is not uncommon with Ninjatrader crapware, however generally backtesting minute bars with 1 tick of slippage is accurate enough.
What is really confusing is that the results of replay (live) versus backtesting are the same, minus the number of trades. The profit and consistency rates are the same, however the live trading is generating fewer trades. In fact, the live trading's overall results are better; generally it's the other way around
I'll go back to the charts and analyze each individual trades, but I was wondering if anyone has any thoughts. Here are some points on what I'm doing:
Using non-blackboxed Jurik tools (i.e. 100% ninjascript indicators) from jurikres.com - I've used them before in backtest versus live with no trouble
60 minute bars, exit on close = false
Trading the ES
Uses a leading indicator (made this week)
Completely independent from other platforms, i.e. matlab is not connected
As a final bit, I only optimized three coefficients/inputs. All but three of the combinations had positive results... very confident that the system works. I'm going to investigate if there is a discrepancy between my Ninjascript in backtest versus live. If NT developers ask for the system... the answer is no, and you'd probably blame me anyways if I did.
Does anyone know of alternative software platforms that will run C# (NOT easylanguage) with similar functionality as NT? I've heard Xtrader and T4 are pretty popular... I got into NT because of recommendations and liked the up sides of it very much, at least at the time.
"A Jedi's strength flows from the force."
-Yoda
Can you help answer these questions from other members on NexusFi?
please say your used ordertypes... Without self coding, NT7 don't can backtest stop&limit orders with correct intrabar fills.
Your without more own coding, please use only marketorders and CalcBarOnClose=TRUE
-> market entry orders now filled "OnOpen"
-> please write little own code for your exit conditions and use "CloseMarket" (also filled on next Open)
With this simple OrderLogic, Backtest and Replay run nearly equal. The last difference: Replay use only TickData files from NinjaServer, BackTest use the from real DataProvider requested data's. If time bars greater than 1min used, then NT7 dont used tick data for backtest.
For the next month i hope to publish my (tickbased) history solution for the LOM project. This well realize a accurat Fill incl. IntraBar Exit/ReEntry for the BackTest mode. The concept is simple current you deglare myStrategy:Strategy, then you change only this to myStrategy:LOMtickStrategy.
Your current problem can base on NinjaServer ReplayTicks <-> MinData of your DataProvider or your strategy use OrderTypes with needed correct Intrabar handling of Hi/Lo sequence and/or IntrabarExit/ReEntry or you use partial scale In/Out.
Okay. A little confused by what you said frankly, however in backtesting I ran market orders only, and in live I ran limit AND market orders. Both generated similar results (live).
Update... my algo is showing different values. Attached is a screen shot of backtest versus replay output for the same time period. Combined with the information that both scenarios are producing similar performance results, I'm going to look at how far the system examines past data. I already tried this once by setting the look back period for my replay data at 6 days, which should be plenty for the maximum period in my system.
Anyone run into a similar problem? Any ideas? Is JMA in fact not backtestable, despite possible similarities in the past?
When I adjust the "min bars required" field in strat analyzer, the results vary hugely. They all have similar performance data, however the trades are very different. I suppose I should of picked up on this for a leading indicator. There appears to be no correlation between the look back period and number of trades. It also appears that the lookback period in back testing does NOT produce similar results when the same lookback period is set in market replay.
To make things even more amazingly confusing, here is what happened...
I ran the system on a different contract, this time the Dow (YM). The backtest and the replay are 99.999% identical.
I don't know what to make of this, other than there is something in fact going on with the ES contract in replay or backtest. I'll have to investigate tomorrow, it's bedtime now. The NT team probably thinks I'm making this all up to sabotage them... I'm not!
Anytime you are using non-tick bars (like 60 minute bars), you need to be aware of how NinjaTrader processes orders. It knows only the OHLC of the bar, and it does not know the order of those. Did the L happen before the H, or vice versa? It does not know when you use non-tick data.
From memory, it assumes the best. Unfortunately. This means if you have a 1 tick stop and a 20 tick target, if the H of the bar has exceeded your target, it will count as a winner, even if the L of the bar has exceeded your stop.
The easiest way to see how this effects you is to look at the individual list of trades from the backtest report. Sort by number of bars in trade. All trades that show '1 bar' should be swapped from winners to losers. You can do this by exporting to Excel pretty easily.
The other option is to add a secondary dataseries to your strategy, of 1-range. Then send all orders to the secondary series, so it has a 1-range (1-tick) accuracy.
If I see the different results between the replay and backtest, there are two possible explanations
-> either you used two different strategies
-> or your strategy as coded is flawed
If your strategy is coded correctly, you will never see differences as between the two charts above.
The only differences you will see are
-> data related, replay data is built from many ticks, historical data is single tick data
-> fill related, the backtest will usually enter at the open of the next bar
If you want to do proper backtesting with intra-bar fills, you need to add a one-tick series to the strategy for you backtest.