Backtesting on Renko Charts - MultiCharts | futures io social day trading
futures io futures trading


Backtesting on Renko Charts
Updated: Views / Replies:13,243 / 25
Created: by diverdan Attachments:4

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
 4  
 
Thread Tools Search this Thread
 

Backtesting on Renko Charts

  #11 (permalink)
Fortitudo et Honor
Austin, TX
 
Futures Experience: Advanced
Platform: TradeStation
Favorite Futures: Futures
 
Posts: 882 since Mar 2011
Thanks: 128 given, 703 received


Jura View Post
This question is just showing my ignorance on this subject matter, but I don't follow this. If I plot Renko bars in MultiCharts, each has the same range and the open is at most one "box size" away from the preceding close. Also when using "PlayBack" mode, I don't see this behaviour that a new bar can be three "box sizes" away from the preceding bar.

Or are you saying that real-time Renko charts have different 'plotting rules' than the one based on historical tick data?

Thanks for any insights,

let's say your box size is 10 ticks. And the last bar is a down bar that closes at 100.00

The new bar "opens" at 100.00, if that new bar runs to 99.91, it still has not created a new down box, additionally, it can then go all the way from 99.91 back North, all the way until it reaches 100.19, because at 100.20 is when it will make a new green/higher bar.

So the range for the bar is really 30 ticks (100.20 down to 99.90)

So if you backtested and had a trailing stop of 2 box increments, it's possible, that in our example, the trail was activated if the price then retraced BACk to the downside and made a new bar opening at 99.90.

What BigMike was saying, that the openings don't line up, is because if the last bar was a down bar and to stick with our example...closed at 100.00

if the bar retraces and begins to climb and hits 100.20 and closes a "green" or up bar, the historical chart will actually show the open at 100.10 (not 100.00) NOR will it show if the price actually went lower than the true open of the bar.

If you actually run a live strategy on renko, with tick/tick entries or exits, you'll begin to notice transactions that ocurr OUTSIDE the actual bars...because the bar only plots new bricks up or downs, it doesn't plot the rest of the story.

That's the original intent of a renko chart, that it removes all the "noise" of the price action and that's why you see these nice, beautiful strings of same colored bars in trends....

When in actuality, there was most likely, a lot of price movement around some of the bars during a trend...you just don't see it, because renko removes all the excess information.

Like I said, Renko is useful (in it's original form) for identifying overall/higher time frame trends and also it's very useful for visualizing support/resistance points (if you see a double top where the brick highs are equal, or a triple top).

You actually have the ability to run 2 data streams. (with MC). TS has the ability to use workarounds such as globaldictionary and globalvariables...but you still cannot backtest (even end of bar, no IOG). I'd be satisfied simply backtesting with the true ranges/tails/wicks included.

Renko is also very useful for identifying trend reversals/pivot points.

IF you can plot the improved Renko with tails/wicks, you can notice some pretty strong entry points where there are a reversal bar with a very long tail/wick. You'll begin to notice that reversals always feature a wick that's the length of a bar (at least) but sometimes, the wick can be almost 2x the brick increment...those are stronger entry and exit points.

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote
The following 5 users say Thank You to RM99 for this post:
 
  #12 (permalink)
Fortitudo et Honor
Austin, TX
 
Futures Experience: Advanced
Platform: TradeStation
Favorite Futures: Futures
 
Posts: 882 since Mar 2011
Thanks: 128 given, 703 received

One thing I forgot to add is that the inherent nature of Renko is to remove the time aspect....so a bar might form in any time frame imagineable...might be 1 minute, 1 hour, 1 day, etc.

THAT is why the range is so prolific.

With regular time based bars, you see an "inversion" where the bar is an up bar, but instead of the normal OLHC order, you see an inversion order of OHLHC (which gets plotted as OLHC). This doesn't happen very often, but it does happen (because the time is limited, it's not as often). With Renko, there's no time limit, so price wonders however it wants, for as long as it wants before moving far enough to create a new bar.

This type of "inversion" bar really throws trailing stops and anything that's tick/tick or IOG for a loop, because unless the stop and profit limits are larger than the bar, the backtest engine either has to assume "best case" or "worst case" with respect to OHLC.

Obviously the remedy to this is to backtest "look inside" or tick/tick, but with TS, that's not always available. (IOG strategies, DLL strategies, etc).

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote
The following user says Thank You to RM99 for this post:
 
  #13 (permalink)
Elite Member
Singapore
 
Futures Experience: Beginner
Platform: Multicharts, R
Favorite Futures: EUR / USD
 
Posts: 185 since Feb 2010
Thanks: 106 given, 98 received


Hi RM99

Thanks for the explanation.

I can understand the points about wicks not showing, and I have now plotted a 5Range chart and 5 Renko chart together and can very clearly see some of the price action you are talking about.


RM99 View Post
What BigMike was saying, that the openings don't line up, is because if the last bar was a down bar and to stick with our example...closed at 100.00

if the bar retraces and begins to climb and hits 100.20 and closes a "green" or up bar, the historical chart will actually show the open at 100.10 (not 100.00) NOR will it show if the price actually went lower than the true open of the bar.

However I still don't get the point above. If the Renko plots like you explain, surely you would see a gap from the bar that closed at 100.00 and the one which opened at 100.20.

Cheers,

Dan

Reply With Quote
 
  #14 (permalink)
Elite Member
Singapore
 
Futures Experience: Beginner
Platform: Multicharts, R
Favorite Futures: EUR / USD
 
Posts: 185 since Feb 2010
Thanks: 106 given, 98 received

My cool Renko Strat...

I thought I would post my cool strategy which started me off on this thread and see if I can improve as per the suggestions.

I ran it on the eur/usd 5 Renko and seemed to test very well.

 
Code
                            
Inputs:
    
ccilength 14 ), turningpoint 100 ), strength ),
    
Lookback(2), BarSize(5),
    
TimeOffset(100), MaxLosingTrades(4), DailyProfitTargetPips(50), TimeStop(20),
    
ProfitTarget1(20), BreakEven(20), Offset(2), AccountSize(10000), RiskPerTrade(0.01);
Vars:
    
cciv(0), up(0), down(0), 
    
SessionTime (0), TimeToTrade(0), Triggered(0),
    
ind(1), SessionHi(-999999), SessionLo (+999999), 
    
TradeChart(1), TrendChart(2), Penetrated(false), LongTrigger(False), ShortTrigger(false),
    
AvgMaxExtension(0), MaxExtension(0), MaxHiLo(0),
    
NoLosingTrades(0), Pips4Day (0), PipsThisTrade(0), 
    
enterprice(0), stoploss(0), stopsize(0), BE(0), PT(0), ts(0), 
    
RiskAmount(0), Quantity(0), oneTick(0), OffsetTick(0), trend(0);

if 
CurrentBar 1 Then begin    
    cleardebug
;
    
oneTick MinMove PriceScale;
    
OffsetTick = (BarSize Offset) * oneTick;
    
AvgMaxExtension 0;
end;

trend 0;

cciv CCI(ccilength);

if 
cciv crosses below turningpoint and L then up Highest(Highstrength);
if 
cciv crosses above -turningpoint and H then down Lowest(Lowstrength);

//Work out session time
SessionTime CalcSessionTime;
TimeToTrade CalcLondonOpen;

If 
time >= SessionTime and SessionTime time[1then begin     
    NoLosingTrades 
0;
    
Pips4Day 0;
end;

//Session Performance Analysis
if marketposition and Triggered 1 then begin
    Triggered 
0;
    if 
positionprofit(1) < 0 then NoLosingTrades NoLosingTrades 1;
    
PipsThisTrade positionprofit(1) / maxcontracts(1) / oneTick;
    
Pips4Day Pips4Day PipsThisTrade;
    if 
Pips4Day DailyProfitTargetPips then messagelog(NumToStr(date,0) + " # Pips 4 Day: " NumToStr(pips4day0) + " # Losing Trades: " NumToStr(NoLosingTrades0));
    
MaxExtension MaxExtension oneTick;
    
AvgMaxExtension MaxExtension AvgMaxExtension;
end;

LongTrigger close[1]  > open[1];
ShortTrigger close[1] < open[1];

if 
marketposition and NoLosingTrades MaxLosingTrades and time TimeToTrade and 
     
Pips4Day DailyProfitTargetPips then begin
    
if LongTrigger and close up then begin
        enterprice 
up OffsetTick;
        
stoploss up OffsetTick;
        
ts stoploss OffsetTick;
        
MaxExtension enterprice;
        
MaxHiLo enterprice;
        
stopsize = (enterprice stoploss) / oneTick;    
        
RiskAmount = (AccountSize i_ClosedEquity) * RiskPerTrade;
        
Quantity RiskAmount stopsize 10000;
        
Buy Quantity contracts Next Bar at enterprice stop;
    
end 
    
else if ShortTrigger  and close down then begin
        enterprice 
down OffsetTick;
        
stoploss down OffsetTick;    
        
ts stoploss OffsetTick;    
        
MaxExtension enterprice;    
        
MaxHiLo enterprice;
        
stopsize = (stoploss enterprice) / oneTick;
        
RiskAmount = (AccountSize i_ClosedEquity) * RiskPerTrade;
        
Quantity RiskAmount stopsize 10000;
        
sellshort Quantity Contracts Next Bar At enterprice stop;    
    
end;
end;


if 
marketposition 1 then begin
    Triggered 
1;
    
PT entryprice ProfitTarget1 oneTick;
    
BE entryprice BreakEven oneTick;
    
    
ts iff(ts close  offsettickclose  offsettickts);
    
Sell ("Long Target 1"Quantity contracts next bar At PT limit// Profit Target 1 

    
SetStopPosition// Forces the built-in stop functions to be applied on the entire position basis (all open contracts) 
    
Sell ("StopLoss L"All Contracts next Bar At stoploss Stop// initial stop 
    
Sell ("Trailing L")All Contracts next Bar At ts Stop// trailing stop 
    //Sell ("Trailing Stop") All Contracts next Bar At ts Stop; // trailing stop 
    
    
if high MaxHiLo then MaxHiLo high;
    
MaxExtension maxhilo enterprice;    
end
else if marketposition = -1 then begin
    Triggered 
1;
    
    
PT entryprice ProfitTarget1 oneTick;
    
BE entryprice BreakEven oneTick;

    
ts iff(ts close  offsettickclose offsettickts);

    
Buytocover ("Short Target 1"Quantity contracts next bar At PT limit// Profit Target 1

    
SetStopPosition// Forces the built-in stop functions to be applied on the entire position basis (all open contracts) 
    
Buytocover ("StopLoss S"All Contracts next Bar At stoploss Stop// initial stop
    
Buytocover ("Trailing S"All Contracts next Bar At ts Stop// trailing stop
    
    
if low MaxHiLo then MaxHiLo low;
    
MaxExtension enterprice maxhilo;
end

Reply With Quote
The following 5 users say Thank You to diverdan for this post:
 
  #15 (permalink)
Fortitudo et Honor
Austin, TX
 
Futures Experience: Advanced
Platform: TradeStation
Favorite Futures: Futures
 
Posts: 882 since Mar 2011
Thanks: 128 given, 703 received


diverdan View Post
Hi RM99

Thanks for the explanation.

I can understand the points about wicks not showing, and I have now plotted a 5Range chart and 5 Renko chart together and can very clearly see some of the price action you are talking about.



However I still don't get the point above. If the Renko plots like you explain, surely you would see a gap from the bar that closed at 100.00 and the one which opened at 100.20.

Cheers,

Dan

If bar[1] is red (or a down bar) and the current bar closes up (green bar) yes, you see a void gap, but the open/close values do not account for this.

If you click on the green bar (that's preceded by a red) the open for the green bar is reported as the actual price of the bottom of the green bar (not the close of the red bar or the bottom of the red bar).

Historically, those values throw everything off.

When TS is plotting renkos in real time, they turn different colors when they're in "no man's land" i.e. the range of the bar preceding.

when a new bar reverses from previous, it doesn't take into account the close of the last bar as it's open. the open/close value for renko bricks is always a fixed preset amount.

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote
 
  #16 (permalink)
Elite Member
Singapore
 
Futures Experience: Beginner
Platform: Multicharts, R
Favorite Futures: EUR / USD
 
Posts: 185 since Feb 2010
Thanks: 106 given, 98 received

Modified Strategy

In the middle of updating the strategy to have Renko on chart 2 and Range as the trading chart 1.

Have to go out with wife, will post later on...

Reply With Quote
 
  #17 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received


RM99 View Post
let's say your box size is 10 ticks. And the last bar is a down bar that closes at 100.00

The new bar "opens" at 100.00, if that new bar runs to 99.91, it still has not created a new down box, additionally, it can then go all the way from 99.91 back North, all the way until it reaches 100.19, because at 100.20 is when it will make a new green/higher bar.

So the range for the bar is really 30 ticks (100.20 down to 99.90)

So if you backtested and had a trailing stop of 2 box increments, it's possible, that in our example, the trail was activated if the price then retraced BACk to the downside and made a new bar opening at 99.90.


RM99 View Post
With regular time based bars, you see an "inversion" where the bar is an up bar, but instead of the normal OLHC order, you see an inversion order of OHLHC (which gets plotted as OLHC). This doesn't happen very often, but it does happen (because the time is limited, it's not as often). With Renko, there's no time limit, so price wonders however it wants, for as long as it wants before moving far enough to create a new bar.

Ah I see, thanks a lot RM99 for your thorough reply. I haven't been able to locate examples of this '3x range occurrence', but did find in my data/instrument examples when the price when 1 tick higher or lower than the Renko bar, which with a box size of 2 would be half of the box range, which is already big and that's even with a "slow" instrument with low ATR. Thanks again for bringing up this important point RM99. I've attached a screenshot for other readers which show 2 of these cases (see red arrow).


RM99 View Post
IF you can plot the improved Renko with tails/wicks, you can notice some pretty strong entry points where there are a reversal bar with a very long tail/wick. You'll begin to notice that reversals always feature a wick that's the length of a bar (at least) but sometimes, the wick can be almost 2x the brick increment...those are stronger entry and exit points.

MultiCharts currently can't plot the wicks of Renko bars (right?). At first thought I assumed this could be coded in a custom indicator, by plotting vertical lines which would be the wicks for the Renko bar, based on a lower resolution time frame. But, to accurately plot these wicks, they'd had to be matched with a 1 Tick resolution. However, that screws up the distance between the Renko bars (missing feature MultiCharts Project Management - Issue MC-377 - Keep X Scale of Data1 when 'hidden' Data2 is in different time frame [Feature Request]). Perhaps someone knows a way how to keep the Renko bars usable when adding a 1 Tick data series as Data2? Then we can code an indicator which draws these custom wicks, which would be a great help to visually see the "quality" of the Renk chart and the chosen 'box size'-settings for a particular instrument.

Attached Thumbnails
Backtesting on Renko Charts-renkodifference.png  
Reply With Quote
 
  #18 (permalink)
Fortitudo et Honor
Austin, TX
 
Futures Experience: Advanced
Platform: TradeStation
Favorite Futures: Futures
 
Posts: 882 since Mar 2011
Thanks: 128 given, 703 received

 
Code
//=================================================================================================================
 Input: HighWickColor   (Green);
 Input: LowWickColor       (Red);
 var: IntraBarPersist True_High (0);
 var: IntraBarPersist True_Low  (0);
 var: IntraBarPersist T_High_L (0);
 var: IntraBarPersist T_Low_H  (0);
 var:      Brick_Dir  (0);
 
// BRICK DIRECTION
 If BarStatus(1) = 2 then begin
  If High > Open then Brick_Dir =  1;
  If Low  < Open then Brick_Dir = -1;
 End;
// TRACK THE BRICK HIGH AND THE BRICK LOW
 If Brick_Dir = -1 then begin 
  If Close <= Open[1] and Close >= Open then begin  T_High_L = Close; T_Low_H = Close; End;
  If Close <  Open    then begin T_Low_H = Close;   T_High_L = Open;  End;
  If Close >  Open[1] then begin T_Low_H = Open[1]; T_High_L = Close; End;
 End; 
 If Brick_Dir = 1 then begin 
  If Close >= Open[1] and Close <= Open then begin   T_High_L = Close;T_Low_H = Close; End;
  If Close >  Open    then begin T_High_L = Close;   T_Low_H = Open;  End;
  If Close <  Open[1] then begin T_High_L = Open[1]; T_Low_H = Close; End;
 End;
// TRACK THE TRUE HIGH AND THE YRUE LOW
 If True_High < High then True_High = High;
 If True_Low  > Low  then True_Low  = Low;
 
   Plot1(True_High, "BarHigh",HighWickColor ,0,0);
   Plot2(T_High_L , "BarLow ",HighWickColor ,0,0);
   Plot3(T_Low_H  , "BarHigh",LowWickColor  ,0,0);
   Plot4(True_Low , "BarLow ",LowWickColor  ,0,0);
 
// RESET
 If BarStatus(1) = 2 then begin
  True_High = Close;
  True_Low  = Close;
  T_High_L  = Close;
  T_Low_H   = Close;
 End;
//=================================================================================================================

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote
The following 2 users say Thank You to RM99 for this post:
 
  #19 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received


diverdan View Post
I thought I would post my cool strategy which started me off on this thread and see if I can improve as per the suggestions.

I ran it on the eur/usd 5 Renko and seemed to test very well.

 
Code
                            
[....] 


Thanks for sharing Diverdan. Is it correct that this strategy generates roughly one trade per day in EUR/USD? Can you tell what ...
 
Code
                            
//Work out session time
SessionTime CalcSessionTime;;
TimeToTrade CalcLondonOpen
are? (Since I don't have those functions).


diverdan View Post
In the middle of updating the strategy to have Renko on chart 2 and Range as the trading chart 1.

Will be interesting to hear what your further studies uncovered.

Attached Thumbnails
Backtesting on Renko Charts-renkoexample.png  
Reply With Quote
 
  #20 (permalink)
Elite Member
Singapore
 
Futures Experience: Beginner
Platform: Multicharts, R
Favorite Futures: EUR / USD
 
Posts: 185 since Feb 2010
Thanks: 106 given, 98 received



Jura View Post
Can you tell what ...
 
Code
                            
//Work out session time
SessionTime CalcSessionTime;;
TimeToTrade CalcLondonOpen
are? (Since I don't have those functions).

Hi Jura

Sorry for the delay in responding, but I have been in Switzerland all week for work and have just got back.

Those two functions are ones I developed. My data is in local PC time and as I switch around time zones (Australia and Singapore) I developed those functions to work out when the London Session opened according to my time zone (taking into account Day Light Saving) and when the FX Session Time started.

You can remove these functions and set them to whatever time you want.

Cheers,

Daniel

Reply With Quote

Reply



futures io > > > > Backtesting on Renko Charts

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tip for backtesting on Renko charts gregid NinjaTrader Programming 42 April 15th, 2015 05:07 AM
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 01:57 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-11 in 0.08 seconds with 19 queries on phoenix via your IP 54.226.34.209