Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (SBGuy), 712 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
The7 strategy #408401
09/30/12 16:04
09/30/12 16:04
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
I just found this simple strategy on another forum, posted by someone with the name "The7". With some small modifications it was quite successful in a WFO test and gets > 7000 pips annual profit:

Code:
function run()
{
  set(TESTNOW|PLOTNOW|PARAMETERS);
  NumWFOCycles = 8;
  BarPeriod = 1440;

  while(asset(loop("EUR/USD","AUD/USD","USD/CAD"))) 
  {
     var Period = optimize(5,3,15);
     var EMA5H = LowPass(series(priceHigh()),3*Period);
     var EMA5L = LowPass(series(priceLow()),3*Period);

     Stop = (HH(2) - LL(2)) * optimize(1,0.5,5);

    if(priceOpen() > EMA5H && priceClose() < EMA5H && priceLow() > EMA5L)
      enterShort();
    else if(priceOpen() < EMA5L && priceClose() > EMA5L && priceHigh() < EMA5H)
      enterLong();
  }
}



The performance is quite remarkable for such a simple system. Here's the equity curve on a microlot account:



Re: The7 strategy [Re: jcl] #408428
10/01/12 04:21
10/01/12 04:21
Joined: Sep 2012
Posts: 99
T
TankWolf Offline
Junior Member
TankWolf  Offline
Junior Member
T

Joined: Sep 2012
Posts: 99
I copied your code and run the script just to give it a test, but my equity curve and results look nothing like yours.

Re: The7 strategy [Re: TankWolf] #408438
10/01/12 09:38
10/01/12 09:38
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Yes, the reason is the parameter bug mentioned on the website. Workshops 5_3 and 6 won't work either, for the same reason - I wonder why people not already have complained about that. The bug only affected 0.99.4, no earlier or later versions. Zorro 1.01 is planned for release tomorrow.

Re: The7 strategy [Re: jcl] #408451
10/01/12 15:00
10/01/12 15:00

L
liftoff
Unregistered
liftoff
Unregistered
L



I hope Zorro 1.01 will come with forex only versions of Z1 and Z2 so we can test them properly on micro-accounts

Re: The7 strategy [Re: ] #408594
10/04/12 10:47
10/04/12 10:47
Joined: Sep 2012
Posts: 99
T
TankWolf Offline
Junior Member
TankWolf  Offline
Junior Member
T

Joined: Sep 2012
Posts: 99
Originally Posted By: "Code"

function run()
{
set(TESTNOW|PLOTNOW|PARAMETERS);
NumWFOCycles = 8;
BarPeriod = 1440;

while(asset(loop("EUR/USD","AUD/USD","USD/CHF")))
{
var Period = optimize(5,3,15);
var EMA5H = LowPass(series(priceHigh()),3*Period);
var EMA5L = LowPass(series(priceLow()),3*Period);

Stop = (HH(2) - LL(2)) * optimize(1,0.5,5);

if(priceOpen() > EMA5H && priceClose() < EMA5H && priceLow() > EMA5L)
enterShort();
else if(priceOpen() < EMA5L && priceClose() > EMA5L && priceHigh() < EMA5H)
enterLong();
}
}


Originally Posted By: "Result"

Annual return 471%
Profit factor 2.69 (PRR 2.08)
Sharpe ratio 1.53
Kelly criterion 0.51
OptimalF .082
Ulcer index 7%
Prediction error 44%


Change USD/CAD to USD/CHF and the results get even better. jcl I was wondering if we could do another example of setting up the optimal margin and lots on this because I seem to be having alot of trouble getting it to work because in this example we are only using one strategy instead of multiple as like in Workshop 6_2.

One last thing is it possible to set the lots so they increase depending on account size. Say for an random example you want to risk 3% of your current balance on every new trade which sets 30 pip stops. Starting with say 1,000 capital I would normally work out ((Capital/100*Risk%)/Stop) = $ per contract
((1000/100*3)/30 = $1.00 per contract = 0.1 lot. OR


Re: The7 strategy [Re: TankWolf] #408600
10/04/12 12:33
10/04/12 12:33
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Set FACTORS also, and use the "Margin" variable (not "Lots") for adjusting the trade volume. This is an example of adjusting Margin to the account size:

Code:
//Margin for enterLong()
if(Train)
  Lots = 1;
else if(OptimalFLong > 0) {
  Lots = 1;
  Margin = clamp(Balance * OptimalFLong * 0.1, 5, 1000);
} else 
  Lots = 0;

...

// Margin for enterShort() 
if(Train)
  Lots = 1;
else if(OptimalFShort > 0) {
  Lots = 1;
  Margin = clamp(Balance * OptimalFShort * 0.1, 5, 1000);
} else 
  Lots = 0;



Play with the factor 0.1. The higher it is, the higher is both the profit and the drawdown. Be aware that the annual return percentage always goes down when you reinvest profits, because the drawdowns are higher.

Re: The7 strategy [Re: jcl] #408644
10/05/12 06:30
10/05/12 06:30
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
If you want to experiment with this strategy, here's another suggestion:

You see that the strategy uses unfiltered prices of a candle for comparison. This is called "Price Action Trading" and is the usual beginners' method for quickly losing money. Unfiltered prices are mostly random and can normally not be used for a trading system.

Yet this works here, and this hints to a seasonal effect. Try to run the system with different BarOffset values. With no BarOffset, Zorro starts daily bars at GMT midnight, so with BarOffset you can determine the minute into the day when the candle opens. If it's a seasonal effect, the system will only work within a certain BarOffset range that should be different for every currency. F.i. AUD/USD is mostly traded in the Sydney season and USD/CAD mostly in the New York season.

By using individual bar offsets per currency you can most likely get even more profit out of the system. Keep in mind to set BarOffset first before calling asset().

Re: The7 strategy [Re: jcl] #408807
10/07/12 21:17
10/07/12 21:17
Joined: Oct 2012
Posts: 10
Mexico
S
sabgto Offline
Newbie
sabgto  Offline
Newbie
S

Joined: Oct 2012
Posts: 10
Mexico
If my time frame is daily, does HH(2) return the highest price in the last 2 days? Thanks for you reply.

Re: The7 strategy [Re: sabgto] #408821
10/08/12 07:23
10/08/12 07:23
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Yes. Here's the description of the traditional indicators:

http://zorro-trader.com/manual/en/ta.htm

Re: The7 strategy [Re: jcl] #410521
11/04/12 19:25
11/04/12 19:25
Joined: Nov 2012
Posts: 19
Texas, US
D
deweymcg Offline
Newbie
deweymcg  Offline
Newbie
D

Joined: Nov 2012
Posts: 19
Texas, US
Do you have an mql equivalent for the lowPass filter? Thanks

Page 1 of 3 1 2 3

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