Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (degenerate_762, AndrewAMD), 877 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 5 1 2 3 4 5
Re: Median Renko bars for Zorro [Re: ] #435392
01/07/14 10:51
01/07/14 10:51

A
acidburn OP
Unregistered
acidburn OP
Unregistered
A



About time I wake up this old thread. grin Take three!

The title of the thread isn't valid anymore, as I had to drop median renko idea because of the inherent problems while backtesting those beasts. Zorro executes run() function after every bar, then if you decide to open the position, it uses the open price from the next bar. Unfortunately, the open in the median renko is in the past, which allows for much better execution than would be possible in reality. If nothing else, it reveals how our trading would become extra profitable if we could add just a few pips to every trade we do. tongue

So, having all that in mind, my new bar abomination is quite simple and allows for proper backtesting. If the price moves 5 pips in whatever direction, a bar is printed. There are wicks, but they should not be important. Bars are similar to renko, but different, because renko requires twice as much movement in the opposite direction before printing brick. I'll call this thing a grid bar. If I can make any progress with it. Also I reintroduced phantom bars. For example if there was a 20 pips gap in the original price data, there will be 4 bars (20/5) printed. It's good for indicators, but could also inflate backtest results. We can sort this out later, once again if the bars prove useful.

So far I have tested only a few simple things, without any results to show. But I haven't yet got even to the ever popular MA crossover, so there's still work to be done.

If you're going to play with this, I suggest:
  • reading this whole thread to understand what all this is about
  • renaming EURUSD_2011.bar, too, so you know when Lookback tries to go to 2011 data
  • set Weekend = 0
  • set Slippage = 0

Bars are based on 5 pips movement, synthesized from about last 5 years of Dukascopy EURUSD tick data.

http://www.perltrader.com/zorro/EURUSD_2012.bar-grid.zip

And I wanted to attach the screenshot, so you can see how the bars look, but this subforum doesn't allow attachments.

Re: Median Renko bars for Zorro [Re: ] #435414
01/07/14 20:13
01/07/14 20:13

A
acidburn OP
Unregistered
acidburn OP
Unregistered
A



Very funny. Luxor trading system can be very easily "persuaded" to be profitable, but only after summer 2010. (before that it's flat). That's about where it became unprofitable on time-based candlesticks. I'll take this as evidence that big money switched to volatility bars few years ago. No wonder professional system traders have been losing money last few years (known fact). grin

AR is 308%, but it should be smaller in reality because backtest is over 3.5 years, but Zorro doesn't know that. Sharpe is 3.20 and that is really excellent. I don't know how to scale it (complex math). Still can't attach chart to show how it looks.

Anyway, this started looking promising. I need to study Luxor in depth, still don't understand all it's details. But, something in there is very very promising...

Re: Median Renko bars for Zorro [Re: ] #435416
01/07/14 20:18
01/07/14 20:18

A
acidburn OP
Unregistered
acidburn OP
Unregistered
A



Oh, BTW, here's the script. Notice that it has Spread/Slippage/Roll at 0, I copied that from jcl's Luxor script. So eventually results will be worse. But as it took 15 minutes to get these, it's still impressive.

Code:
function run()
{
	set(PLOTNOW | PLOTPRICE);
	BarPeriod = 1;
	StartDate = 20120501;
	EndDate = 20121231;
	Spread = 0;
	Slippage = 0;
	RollLong = 0;
	RollShort = 0;
	Weekend = 0;
 	LookBack = 60;
	PlotWidth = 800;
	PlotHeight1 = 640;

	asset("EUR/USD");

	vars Price = series(priceClose());
	vars Fast = series(SMA(Price, 8));
	vars Slow = series(SMA(Price, 44));

	static var BuyLimit, SellLimit, BuyStop, SellStop;

	if (crossOver(Fast, Slow)) {
		BuyStop = priceHigh() + 1 * PIP;
		BuyLimit = priceHigh() + 5 * PIP;
	}

	if (crossUnder(Fast, Slow)) {
		SellStop = priceLow() - 1 * PIP;
		SellLimit = priceLow() - 5 * PIP;
	}
		
	if (!NumOpenLong && Fast[0] > Slow[0] && Price[0] < BuyLimit)
		enterLong(1, BuyStop);

	if (!NumOpenShort && Fast[0] < Slow[0] && Price[0] > SellLimit)
		enterShort(1, SellStop);
}



Re: Median Renko bars for Zorro [Re: ] #435435
01/08/14 08:44
01/08/14 08:44
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Thanks for the script - it's certainly an additional motivation to implement the user-defined bars soon.

Re: Median Renko bars for Zorro [Re: jcl] #435447
01/08/14 09:38
01/08/14 09:38

A
acidburn OP
Unregistered
acidburn OP
Unregistered
A



Although, I have to warn right away before anyone starts celebrating wink that setting Spread = 0 will turn almost any strategy profitable with beautiful equity curves. Once again, if one can add only about 2 pips to every trade (i.e just remove the broker fee), suddenly every ugly duckling strategy becomes a swan. grin

The average win per trade was 1.1p without the spread. Add about 2 pips spread and suddenly it ends up at -1.1p. Winning strategy instantly turned losing by accounting for broker fees.

Mental note: to ignore the results unless average trade expectancy is at least a few pips, best if at least 5.

Important: as I've stuffed about last 5 years in 1 year worth of 1min records, synthesized bars could be roughly compared to standard 5min data.

Re: Median Renko bars for Zorro [Re: ] #435509
01/08/14 16:05
01/08/14 16:05
Joined: Jul 2013
Posts: 522
D
dusktrader Offline
User
dusktrader  Offline
User
D

Joined: Jul 2013
Posts: 522
I really like your findings so far with Renko bars acidburn. Please clarify... since you are using a synthetic .bar file, that means we cannot really use this in live trading yet until Zorro would implement Renko natively and on-the-fly, correct?

I think it will be very useful to separate price movement from time.

Re: Median Renko bars for Zorro [Re: dusktrader] #435514
01/08/14 16:31
01/08/14 16:31

A
acidburn OP
Unregistered
acidburn OP
Unregistered
A



Originally Posted By: dusktrader
I really like your findings so far with Renko bars acidburn. Please clarify... since you are using a synthetic .bar file, that means we cannot really use this in live trading yet until Zorro would implement Renko natively and on-the-fly, correct?


Yes, that is correct. This history is just for strategy research, nothing else. Before going live with this stuff, we'd need native support in Zorro or some other platform.

Originally Posted By: dusktrader

I think it will be very useful to separate price movement from time.


So far my feelings are mixed. It's true that bars like this reveal some oportunities that would be hard or impossible to exploit with time-based bars. But some of my expectations so far failed horribly. Time will show...

Re: Median Renko bars for Zorro [Re: ] #435519
01/08/14 17:29
01/08/14 17:29
Joined: Jul 2013
Posts: 522
D
dusktrader Offline
User
dusktrader  Offline
User
D

Joined: Jul 2013
Posts: 522
I've done a fair amount of research with price movement independent of time, albeit not in an automated trading environment. It was also not with Renko bars, although the concept of Renko is something that I think can accomplish that goal of price/time separation.

I think the concept of merging price and time could be fundamentally flawed, but it is used as a basis for almost all modern trading. Any time you force market price to be attached to a time boundary, you have created an artificial representation that could be misleading, or at least misinterpreted. That is my theory anyway.

The combination of Renko + Zorro could open a lot of doors. Price is all that really should matter, but due to limitations in most modern trading software, we don't have a good way to visualize the supply/demand independent of the time constraint.

Re: Median Renko bars for Zorro [Re: dusktrader] #435525
01/08/14 18:26
01/08/14 18:26

A
acidburn OP
Unregistered
acidburn OP
Unregistered
A



Originally Posted By: dusktrader
I've done a fair amount of research with price movement independent of time, albeit not in an automated trading environment. It was also not with Renko bars, although the concept of Renko is something that I think can accomplish that goal of price/time separation.


It's nice to know that I'm not the only one that is wasting time on these things. wink So far I felt pretty lonesome, at least on this forum. cry First exotic bar type I played with were constant range bars (I still remember the excitement when I first discovered them), quickly followed by Renko, Median Renko, and finally with these latest one that I don't even know how to call.

Originally Posted By: dusktrader

I think the concept of merging price and time could be fundamentally flawed, but it is used as a basis for almost all modern trading. Any time you force market price to be attached to a time boundary, you have created an artificial representation that could be misleading, or at least misinterpreted. That is my theory anyway.


And my theory exactly. Whenever I see 100 pips bar, surrounded by tens of 5 pips bars on both sides, I know it was a trading opportunity lost because all that happened on inadequate time scale. And 5 pips bars are better not traded, chop chop. When I try to remedy that by going down on the timescale, I immediately get drowned by sea of randomness, commissions eat all the profits and so on. Basically these discoveries are what fueled my research into exotic bar types so far. Bars now tick at my profit/loss frequency, they're in perfect sync. ATR is constantly constant grin etc, etc...

Originally Posted By: dusktrader

The combination of Renko + Zorro could open a lot of doors. Price is all that really should matter, but due to limitations in most modern trading software, we don't have a good way to visualize the supply/demand independent of the time constraint.


Doors are ajar with the data I provided. Not all is perfect, but chase for an elusive edge is already possible. Because, Zorro like most of other platforms is heavily time based, I guess it's not possible to implement support for timeless bars without a lot of effort. So I can understand that it could take a lot of time and/or lot more interest before it happens.

Speaking of supply/demand, basically we're in the wrong market (forex - no central volume) to be expecting that. We could switch to trading futures, but then some other problems emerge, like less liquidity, bigger capital requirements etc.. Don't know, seen many supply/demand theories, still nothing attracted me to dig deeper. Seems too complicated, no evidence of usefulness, etc... Unfortunately this industry is plagued with con artists, sometimes lots of time is wasted trying to pick sense, where there's none.

Re: Median Renko bars for Zorro [Re: ] #435527
01/08/14 19:50
01/08/14 19:50
Joined: Jul 2013
Posts: 522
D
dusktrader Offline
User
dusktrader  Offline
User
D

Joined: Jul 2013
Posts: 522
I think that it should not be "too difficult" to implement Renko bars in Zorro, though maybe I'm over-simplifying quite a lot here.

I *think* traditional indicators and performance metrics could survive and still work (because they are only looking at the price/trade series data). But I think you'd want to have additional indicators added to specifically support Renko.

For example, on a candle chart we may plot an MA crossover and say that when the short MA crosses the long MA, then that is a buy signal. However, since the MA function is based on price series, it would then not line-up correctly when overlayed on a Renko chart.

Instead, it seems like some sort of filter would need to be applied to the series, to group it into Renko bars instead of traditional candle bars. This filter would need to be applied *before* calculating the MA data point. Is that correct? You are still using the same signal to identify the trend change, but now you've abstracted time and have filtered price through the Renko rules. The effect is that you cluster prices together irregardless of time.

If you stop to think about it: Renko (or other time-independent methods) makes perfect sense. I think everyone would agree that the market moves on *its own* time schedule and will not allow itself to be boxed in like that. That is why I think time-based methods are flawed.

By the way, I'm only speaking about Renko in a general sense. I briefly studied Range Bars and determined that Renko was better. I have not heard of Median Renko yet.

Page 3 of 5 1 2 3 4 5

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1