2 registered members (PeroPero, 1 invisible),
858
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Median Renko bars for Zorro
[Re: ]
#435392
01/07/14 10:51
01/07/14 10:51
|
acidburn
OP
Unregistered
|
acidburn
OP
Unregistered
|
About time I wake up this old thread. 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. 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.zipAnd 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
|
acidburn
OP
Unregistered
|
acidburn
OP
Unregistered
|
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). 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
|
acidburn
OP
Unregistered
|
acidburn
OP
Unregistered
|
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.
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: jcl]
#435447
01/08/14 09:38
01/08/14 09:38
|
acidburn
OP
Unregistered
|
acidburn
OP
Unregistered
|
Although, I have to warn right away before anyone starts celebrating 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. 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: dusktrader]
#435514
01/08/14 16:31
01/08/14 16:31
|
acidburn
OP
Unregistered
|
acidburn
OP
Unregistered
|
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. 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: dusktrader]
#435525
01/08/14 18:26
01/08/14 18:26
|
acidburn
OP
Unregistered
|
acidburn
OP
Unregistered
|
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. So far I felt pretty lonesome, at least on this forum. 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. 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 etc, etc... 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.
|
|
|
|