1 registered members (AndrewAMD),
1,306
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Is this renko implementation an error?
#469656
11/28/17 19:33
11/28/17 19:33
|
Joined: Oct 2017
Posts: 10
Oligon
OP
Newbie
|
OP
Newbie
Joined: Oct 2017
Posts: 10
|
Hi guys! I tried to experiment these last few days with the renko bars example found on the zorro manual:
var BarRange = 0.0005;
int bar(vars Open,vars High,vars Low,vars Close)
{
Open[0] = round(Close[1],BarRange);
if(Close[0]-Open[0] >= BarRange) {
Close[0] = Open[0]+BarRange;
High[0] = Close[0];
Low[0] = Open[0];
return 1;
}
if(Open[0]-Close[0] >= BarRange) {
Close[0] = Open[0]-BarRange;
High[0] = Open[0];
Low[0] = Close[0];
return 1;
}
return 4;
}
Then I coded a very simple strategy to buy after two consecutive bullish bars and sell after two consecutive renko bars. The results were too good to be true, so I thought that there must be something wrong. The logic seems fine and when I zoomed on the resulting chart, it seemed ok and to be executing the trades correctly. My last experiment was to trade it live on a demo account yesterday and today I did the simulation for yesterday just to compare. When I did that, I found that Zorro is not doing the same on the demo account as it did on the simulation. Of course, the demo test was a complete fail, with trades resulting in fractions of a cent and doing a ton more trades than the simulation on the same period of time. Can anyone help me understand what is going on here? Is there a bug on the backtesting of renko bars? Do I have to set up something additional to make it work in live or demo trading? Any help would be very helpful, thank you!!
|
|
|
Re: Is this renko implementation an error?
[Re: jcl]
#469667
11/30/17 05:48
11/30/17 05:48
|
Joined: Oct 2017
Posts: 10
Oligon
OP
Newbie
|
OP
Newbie
Joined: Oct 2017
Posts: 10
|
Yes, I have set the TICKS flag, that's another thing that should be working fine, but on the live test, it was not the same. Here is the rest of the code, it's very simple:
function run()
{
set(PLOTNOW+TICKS);
StartDate = 2005;
BarPeriod = 60;
if(priceClose(0) > priceClose(1) and priceClose(1) > priceClose(2)){
reverseLong(1);
}
if(priceClose(0) < priceClose(1) and priceClose(1) < priceClose(2)){
reverseShort(1);
}
}
What could be going wrong? Thanks jcl!!
|
|
|
|