Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,498 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Hucks Trend Catcher from another forum #431252
10/12/13 02:11
10/12/13 02:11
Joined: Aug 2013
Posts: 124
D
DMB Offline OP
Member
DMB  Offline OP
Member
D

Joined: Aug 2013
Posts: 124
Hi All

I came across the below linked post on babypips.com. I have been testing and adjusting the code but I am unable to get results that are similar to the original poster's. I have a few thoughts on why, but my Zorro programming skills are limited. I have been unable to contact the original poster. So I was hoping the group could help me fix the code.

Link to original post:
http://forums.babypips.com/expert-advisors-automated-trading/47462-my-zorro-adventure.html

I think there might be two problems. The first is that the code is for an earlier version of Zorro and some syntax needs to be updated. The second is that it seems to be very sensitive to the WFO parameters. So I need to understand how to set these both for testing and ongoing development and trading. I assume that since time moves forward and new data is downloaded, the WFO start date should be fixed. However the cycles will get longer if number of cycles is fixed. hmmmm uncertain about this in practice.

I had a go at fixing it, but I think it is best to get comments based on the original code. The original poster worked with EURUSD. If successful, I will add the loops to cover more symbols, and position size code, and repost.

Thanks

Quote:

function run()
{
BarPeriod = 240;
StartDate = 2006;
NumYears = 7;
NumWFOCycles = 12;
Mode = PARAMETERS+TESTNOW;

var *Price = series(price());
var *LP5 = series(LowPass(Price,5));
var *LP10 = series(LowPass(Price,optimize(10,6,20)));
var *RSI10 = series(RSI(Price,10));
Stop = optimize(5,1,10)*ATR(30);

static int crossed = 0;
if(crossOver(LP5,LP10))
crossed = 3;

else if(crossUnder(LP5,LP10))
crossed = -3;
if(crossed > 0 && crossOver(RSI10,50))
{
enterLong();
crossed = 0;
}
else if(crossed < 0 && crossUnder(RSI10,50))
{
enterShort();
crossed = 0;
}
else crossed -= sign(crossed);
}


Re: Hucks Trend Catcher from another forum [Re: DMB] #431288
10/13/13 05:18
10/13/13 05:18
Joined: Aug 2013
Posts: 124
D
DMB Offline OP
Member
DMB  Offline OP
Member
D

Joined: Aug 2013
Posts: 124
I set the end date to be about the same time as the original post, 28-09-2012. Then using the same number of years and WFO cycles I trained and tested the script. Attached is the equity chart I got and the original posters chart. Despite the code being the same, it is clear that Zorro is trading differently. You can see this during the period around the start of 2010. The OPs chart shows a group of trades held until near the end of the trend in about June. My charts exits them all about a month earlier. Is anyone aware of changes to Zorro that would make such a difference? Is there a mode I need to set?

Original:


My chart:


I changed the series variable declarations to reflect the manual, i.e. vars VariableName rather than var *VariableName. This had no affect, so I assume either is correct syntax. Also I changed the mode line to just set(PARAMETERS); I have also tried training with TICKS flag set. No difference, just took longer.

Attached Files
Original.jpg (117 downloads)
MyChart.png (118 downloads)
Last edited by DMB; 10/13/13 05:28.
Re: Hucks Trend Catcher from another forum [Re: DMB] #431289
10/13/13 05:49
10/13/13 05:49
Joined: Aug 2013
Posts: 124
D
DMB Offline OP
Member
DMB  Offline OP
Member
D

Joined: Aug 2013
Posts: 124
I just ran the script with the BarPeriod set to 241 instead of 240, just for interest. This is the chart I got. Much healthier looking. Ok....I will wait for comments now.


Attached Files
MyChart2.png (120 downloads)
Last edited by DMB; 10/13/13 05:50.
Re: Hucks Trend Catcher from another forum [Re: DMB] #431290
10/13/13 08:09
10/13/13 08:09
Joined: Apr 2008
Posts: 586
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 586
Austria

Re: Hucks Trend Catcher from another forum [Re: Petra] #431291
10/13/13 08:47
10/13/13 08:47
Joined: Aug 2013
Posts: 124
D
DMB Offline OP
Member
DMB  Offline OP
Member
D

Joined: Aug 2013
Posts: 124
Oh...thanks. I had no idea this had already been discussed extensively on this forum.

Re: Hucks Trend Catcher from another forum [Re: DMB] #431763
10/23/13 14:22
10/23/13 14:22
Joined: May 2013
Posts: 627
Bonn
Sundance Offline
User
Sundance  Offline
User

Joined: May 2013
Posts: 627
Bonn
Hi DMB,

did you make any progress when using the Weekend parameter?

Re: Hucks Trend Catcher from another forum [Re: Sundance] #431771
10/23/13 14:44
10/23/13 14:44
Joined: Aug 2013
Posts: 124
D
DMB Offline OP
Member
DMB  Offline OP
Member
D

Joined: Aug 2013
Posts: 124
I was able to find the Weekend setting (=1) that replicated the OPs result. I then looked at other symbols and found it didn't work at all. I was able to contact the OP, who is also a member of this forum. He confirmed that he was unable to get it to work on any other symbol besides EURUSD.

Interesting situation. Since the equity curve has a lot of flat periods, I hoped a portfolio would smooth it out. I haven't tried to figure out if there is some adjustment that will make it profitable on more than the EURUSD. That will be a side project.

Re: Hucks Trend Catcher from another forum [Re: DMB] #431773
10/23/13 14:55
10/23/13 14:55
Joined: May 2013
Posts: 627
Bonn
Sundance Offline
User
Sundance  Offline
User

Joined: May 2013
Posts: 627
Bonn
Thanks for the update DMB. What a pity that it won't work on other currency pairs.

Re: Hucks Trend Catcher from another forum [Re: Sundance] #431774
10/23/13 15:05
10/23/13 15:05
Joined: Aug 2013
Posts: 124
D
DMB Offline OP
Member
DMB  Offline OP
Member
D

Joined: Aug 2013
Posts: 124
Yeah. I will look at optimising other inputs and try different exit strategies. But first, is there a signal processing equivalent for the RSI indicator? I get the feeling that HighPass is not equivalent, but I don't know much about the signal processing functions.

Re: Hucks Trend Catcher from another forum [Re: DMB] #431775
10/23/13 15:15
10/23/13 15:15
Joined: May 2013
Posts: 627
Bonn
Sundance Offline
User
Sundance  Offline
User

Joined: May 2013
Posts: 627
Bonn
I can't answer your question. Sorry. But I can take a look at it. But there are other indicator which will show you when the market is overbought /oversold ...

Page 1 of 2 1 2

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