Tip for backtesting on Renko charts - NinjaTrader Programming | futures io social day trading
futures io futures trading


Tip for backtesting on Renko charts
Updated: Views / Replies:17,236 / 42
Created: by gregid Attachments:1

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 1  
 
Thread Tools Search this Thread
 

Tip for backtesting on Renko charts

  #1 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received

Tip for backtesting on Renko charts

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:

Tip

Refrain from using Market Orders for backtesting purposes and replace all MARKET orders with LIMIT orders with LimitPrice = Close[0]
(this will simulate standard behaviour of market orders for CalculateOnBarClose = true)



Sample code:

 
Code
                            
//instead of using:
EnterLong("entry1");
//use:
EnterLongLimit(Close[0],"entry1");
 
 
//instead of using:
EnterShort("entry1");
//use:
EnterShortLimit(Close[0],"entry1"); 
Good luck backtesting!

Reply With Quote
The following 4 users say Thank You to gregid for this post:
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Just starting out...
ca
 
Futures Experience: Intermediate
Platform: NinjaTrader
 
Posts: 2 since Jul 2010
Thanks: 3 given, 0 received


Thank you for the tip!

Does it mean the following simple strategy will work as it supposed to on Wicked Renko charts?

HTML Code:
 protected override void Initialize()
        {
            SetProfitTarget("", CalculationMode.Ticks, 10);
            SetStopLoss("", CalculationMode.Ticks, 40, false);
            CalculateOnBarClose = true;
            EntriesPerDirection = 50; 
            EntryHandling = EntryHandling.UniqueEntries; 
        }

 protected override void OnBarUpdate()
        {
            if (Close[0] > Open[0])
            {
                EnterLongLimit(DefaultQuantity, Close[0], "L");
            }

            if (Close[0] < Open[0])
            {
                EnterShortLimit(DefaultQuantity, Close[0], "S");
            }
        }

Reply With Quote
 
  #4 (permalink)
Membership Revoked
United States of America
 
Futures Experience: Advanced
Platform: NT
 
Posts: 1,149 since Aug 2009
Thanks: 262 given, 471 received


ntmt View Post
Thank you for the tip!

Does it mean the following simple strategy will work as it supposed to on Wicked Renko charts?

HTML Code:
 protected override void Initialize()
        {
            SetProfitTarget("", CalculationMode.Ticks, 10);
            SetStopLoss("", CalculationMode.Ticks, 40, false);
            CalculateOnBarClose = true;
            EntriesPerDirection = 50; 
            EntryHandling = EntryHandling.UniqueEntries; 
        }
 
 protected override void OnBarUpdate()
        {
            if (Close[0] > Open[0])
            {
                EnterLongLimit(DefaultQuantity, Close[0], "L");
            }
 
            if (Close[0] < Open[0])
            {
                EnterShortLimit(DefaultQuantity, Close[0], "S");
            }
        }

Highly unlikely.

Reply With Quote
 
  #5 (permalink)
Just starting out...
ca
 
Futures Experience: Intermediate
Platform: NinjaTrader
 
Posts: 2 since Jul 2010
Thanks: 3 given, 0 received


Zoethecus View Post
Highly unlikely.

Thank you for the reply.

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?

Thanks again.

Reply With Quote
 
  #6 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received

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

Attached Thumbnails
Tip for backtesting on Renko charts-nowguess.png  
Reply With Quote
The following user says Thank You to gregid for this post:
 
  #7 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,574 given, 3,982 received


gregid View Post
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

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.

Success requires no deodorant! (Sun Tzu)
Reply With Quote
The following 3 users say Thank You to sam028 for this post:
 
  #8 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received

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[0] 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.

Few notes:
* The original NT6.5 SbSRenko (with long bars on reversal) doesn’t need this solution as the Open[NewBar]=Close[0] (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:
 
Code
                            
EnterLongLimit(Close[0]-(Slippage*TickSize),"entry1");
EnterShortLimit(Close[0]+(Slippage*TickSize),"entry1"); 


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!!!

Reply With Quote
The following 3 users say Thank You to gregid for this post:
 
  #9 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,354 given, 83,237 received

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

Mike

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.

Reply With Quote
The following 5 users say Thank You to Big Mike for this post:
 
  #10 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received



Big Mike View 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.

Mike

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 09:49 AM.
Reply With Quote

Reply



futures io > > > > > Tip for backtesting on Renko charts

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Backtesting on Renko Charts diverdan MultiCharts 25 October 29th, 2017 07:12 PM
What is the difference in the regular Renko charts and the Median Renko charts PamH NinjaTrader 17 February 21st, 2012 08:16 PM
Better Renko Charts fballesteros NinjaTrader 2 April 12th, 2011 04:00 PM
Renko Tick Backtesting cpi65 Traders Hideout 8 August 5th, 2010 08:41 PM


All times are GMT -4. The time now is 06:29 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-17 in 0.15 seconds with 20 queries on phoenix via your IP 54.82.81.154