All renko incarnations (NT Renko, MedianRenko, SBSRenko, WickedRenko) are unreliable for backtesting due to few issues. One of these issues is redrawing the "open" of the bar after the bar has formed.
In order to avoid the complications of the redraw:
Refrain from using Market Orders for backtesting purposes and replace all MARKET orders with LIMIT orders with LimitPrice = Close
(this will simulate standard behaviour of market orders for CalculateOnBarClose = true)
Good luck backtesting!
The following 4 users say Thank You to gregid for this post:
I have read other threads about why backtesting on renko is not a good idea, but I thought the code above should function as close to reality as possible, since it make decisions only when the bar closes.
Could you give me a little more detailed explanation about why it won't?
I can't vouch for it but I believe it makes a difference. Please see the attached image and guess which chart uses Market orders and which uses Limit orders (everything else is the same in the simple strategy).
I highlighted just one fragment where you could see it straight away
The following user says Thank You to gregid for this post:
There is differences in the charts you show, that's sure, and does it make sense ?
Limit orders are limit orders, so:
- you can't be sure they will be filled, so some additional logic is needed in the strategy itself:
-> the limit order is sent, but is it filled ?
-> if it's filled, at which price, so what are the consequences for the target/stop ?
-> if it's not filled x minutes/ticks/bar, what do to ? Cancel the order, change the limit price, ... ?
So the backtests results may look more accurate, but that doesn't mean you can have accurate results (or results similar to the backtests) when the strategy runs live.
The good test, imvho, is to run such strategy with a live feed, and see how it looks after few days, and then compared the live resulsts with the backtests results. And before this, add the MM parts described below, needed by limit orders.
Usually in trading, those who know don't talk, and those who talk don't know. (Al Brooks)
success requires no deodorant! (Sun Tzu)
The following 3 users say Thank You to sam028 for this post:
Sam, I agree with 100% of what you wrote, but I think you are arguing against something I never claimed… but maybe I didn’t make it clear initially.
My original point was (and still is) “for backtesting purposes”. I never said I recommend using limit orders in live strategies as like with every type of order there are some pros and cons of every one of them and the decision which one to use should be made taking into consideration all possible ramifications (and you pointed out very well what would have to be considered for using Limit Orders while trading live)
So to rephrase and specify my initial point:
The way that market orders work for historical trades (and backtesting) is the order is placed at the Open of new bar. But because the Open of a new bar for renko bars is redrawn – the final Open is drawn only after the Close of the new bar is known, my proposed solution is to use Close instead of Open[NewBar] for entry (when historical or backtesting).
In order to achieve it I suggest simulating MarketOrders with LimitOrders as in the post #1.
* The original NT6.5 SbSRenko (with long bars on reversal) doesn’t need this solution as the Open[NewBar]=Close (I haven’t checked this yet – just an assumption)
* The suggested solution doesn’t take into consideration the slippage. If you decide to include slippage in your strategy, you would probably need to amend the limitprice to something like:
And to recap: You don’t need to do simulate MarketOrders in live strategy – it is helpful only for historical trades and bactesting!!!
And: No backtest is comparable to live feed test!!!
The following 3 users say Thank You to gregid for this post:
You can't do the slippage like that, in my opinion. Instead, use the NT menu itself and input at least 1 tick of slippage for the limit order.
The problem is, NT doesn't handle limit orders very well (in my experience). Just be sure you do a lot of 'live' trading (on sim) with the strategy. Trade it 'live' for a day or two, then go back and run a backtest for identical period. Do the results match, or are there "unexplainable" differences. That will be your sign
Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.
Need help? 1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first. 2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses. 3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make. 4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance. 5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers. 6) Help using the forum? Watch this video to learn general tips on using the site.
If you want to support our community, become an Elite Member.
The following 5 users say Thank You to Big Mike for this post:
It wasn't my intention to add slippage this way, but to show how one would have to amend LimitOrder to simulate MarketOrder once the slippage is added (from NT menu or in the code in Initialize section).
I will write it again:
It is only about simulating MarketOrder for backtesting purposes
[sigh].... I feel like I will spend the rest of the day explaining what I wrote
Last edited by gregid; July 23rd, 2010 at 08:49 AM.