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 am confused about this statement "Fills are determined based on 4 data points, OHLC of a bar since that is the only information that is known during a backtest."
I trade on the CL and ES 5 min candle chart
Questions:
1. How can I back test my strategy if my stops and targets prices are calculated/predefined? For instance, if bar close above resistance level 53.50, enter limit order 53.52. What happens if the OHLC of the next bar is 53.59, 53.61,53.48, and 53.56, respectively ?
Does this mean I will not be filled at 53.52?
Any recommendations or options I can consider for getting all the tick data for a back test?
Thank you in advance.
Can you help answer these questions from other members on NexusFi?
Answer : in general, then if the price goes higher, than your price, in our back testing, you can assume you would get a fill in real-life, unless what you are trying to buy, is a number of contracts that would have acted as an iceberg, also important is the type of order. If you put limit orders, and volume is reasonable, then you are ok, if you put market order, back test could be (significantly) different from real-life (because volume, the bigger it is) impacts the price
Recommendation : once you have something that works, let it run in forward
and once it works in forward, let it run on a real account with real money with one contract scale from there..
I am not sure I follow you to full understanding. I assume the Strategy Analyzer in Ninja Trader give me some probability (with some precision of accuracy) of something that works. But if my price entries will not be filled during back testing, then how I know if something works.
What does everyone here do about back testing only providing the 4 data points of OHLC? Forgive me if question is somewhat easy to most.
You have two possibilities to fire your order
1) on bar close, based on certain condition (OnBarUpdate event in NT
2) during the bar, based on certain condition (OnMarketUpdate even in NT
What i'm saying is, that your fill depends on where you fire the order ...
I think that means that from your example OHLC you can only be certain that during these 5 min there were transactions made at prices 5.48 and 5.56. You do not know if anyone was offering the price 5.52 besides you.
The quotes could go up slowly 5.48 , 5.50 ,5.52, 5.50 ,5.52, 5.54, 5.56
or just jump from 5.48 to 5.56
You do not know also about the volume of transactions made at these prices.
That is correct, the fill is hypothetical
one can assume (if volume is not huge), that if you limit is before a higher (for sell) and above (fore buy) other
historical execution, the is reasonable basis to assume a fill would have been likely... (not 100% sure) hence
difference between backtest and forward test
Yes, I understand that part and that is good point.
Problem:
NT7 only provides the Open, High, Close, and Low prices for each 5 min bar, if my limit entry price is not one of the 4 prices, that trade may will not execute, which will lead to incorrect back testing.
For my strategy, this is a problem because I use calculated entry, stops and targets that may not be the Open, High, Close, and Low price.
Is there any solution you have for my problem other then forward testing and market replay?
You order gets filled (with theoretical chance) if
- for a sell, the price went to that price (not sure) and preferable above
- for a buy, the price went to that price (not sure) and preferable below
In reality the fills may be different based on the liquidity (not enough buyers/sellers)
It is important to see how you trigger your order, as said before :
on bar close -> your order is ready for a fill in the next bar
on market update -> your order can still get a fill in the current bar, if the price fills your order
best close results are with market replay, and just let your strategy run on a tick by tick basis
I'd also add that it is always a good idea to review a sample of the backtest manually to ensure it works as intended.
What this means is that you select a certain period and manually "walk-forward" through your charts to ensure that a) trades that should execute were executed in your backtest, and b) trades execute at realistic fills.
You can't merely review trades that executed, because you will never know if there are any trades that should have executed that did not.
The realistic fills comment applies to all trading, but once you are aware of how NT approximates its fills, you may need to adjust the slippage. For instance, their fill algorithm will always give unrealistic fills if you are using Uni-Renko bars and entering on breakouts of the Uni-Renko. The manual review will highlight these type of issues. It will also help you to get comfortable with the logic NT uses in determining whether trades should execute.
To tie in with your original question, I have always used OHLC when backtesting. When using 1 minute candles there is not much to be gained by going to tick data unless you wish to trade or hold through news events. Even then, I don't think there would be much benefit due to the random and often violent nature of these moves.
Thank you so much for clarifying and correcting me.
Appreciate the help.
Market Replay Comments:
This make good sense as well to just let the automated strategy run on market replay for 120 days and confirm the system is trading per design and the review the trading performance as time goes by. Also, i read the market replay can be done for multiple markets at the same time. I will have to research the difference between NT Historical Data used for market replay vs recording the live data for 120 days.
Then just for experiment sake it would be a decent idea to back test the strategy for these same 120 days using the Strategy Analyzer and compare the results.