SImple profit system
#461560
08/11/16 08:11
08/11/16 08:11
Joined: May 2015
Posts: 390Czech Republic
Grat
OP
Senior Member
OP
Senior Member
Joined: May 2015
Posts: 390
Czech Republic
Hi,
for the EUR/USD is also profitable system based with open in the exact time. Must be diferent for the LONG and SHORT.
Here is my code for playing:
function run()
{
BarPeriod = 60; // 1 hour bars
LookBack = 20;
StartDate = 2010;
EndDate = 20160804;
//NumWFOCycles = 6;
//set(LOGFILE);
//Capital = 5000;
//Margin = 0.001* OptimalF * Capital * sqrt(1 + ProfitClosed/Capital);
Hedge = 2;
Lots=1;
NumOptCycles = 2;
NumSampleCycles = 2;
set(PARAMETERS+FACTORS);
var StopL = optimize(3,1,10) * ATRS(optimize(3,1,10));
var TakeProfitL=optimize(3,1,10) * ATRS(optimize(3,1,10));
var StopS = optimize(3,1,10) * ATRS(optimize(3,1,10));
var TakeProfitS=optimize(3,1,10) * ATRS(optimize(3,1,10));
if (hour() == 13){
Stop=StopL;
TakeProfit=TakeProfitL;
enterLong();
}
if (hour() == 21 ){
Stop=StopL;
TakeProfit=TakeProfitL;
enterShort();
}
}
If you try find best hour in the other symbols:
#define SYMBOLS "EUR/USD","USD/JPY","GBP/JPY","GBP/USD","EUR/GBP"
....
....
while(asset(loop(SYMBOLS))){
if (hour() == optimize(1,0,23,1)){
Stop=4*ATRS(8);
TakeProfit=Stop=4*ATRS(8);
enterLong();
}
if (hour() == optimize(1,0,23,1) ){
Stop=Stop=4*ATRS(8);
TakeProfit=Stop=4*ATRS(8);
enterShort();
}
}
...
Attached Files
Last edited by Grat; 08/11/16 09:39 .
Re: SImple profit system
[Re: Grat ]
#461579
08/12/16 00:02
08/12/16 00:02
Joined: Apr 2014
Posts: 482Sydney, Australia
boatman
Senior Member
Senior Member
Joined: Apr 2014
Posts: 482
Sydney, Australia
Thanks for sharing, Grat. There's a nice tip in the manual about optimizing on integer values that might be useful here:
int Hours[24] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 };
int Hour = Hours[round(optimize(1,0,23,1),1)];
Re: SImple profit system
[Re: boatman ]
#461580
08/12/16 07:28
08/12/16 07:28
Joined: May 2015
Posts: 390Czech Republic
Grat
OP
Senior Member
OP
Senior Member
Joined: May 2015
Posts: 390
Czech Republic
So,
this find best hour for SHORT, LONG
but question is, howto find the same in the M15 frame? How to optimize?
.......for me is best way to learn Zorro....
Testing from 2004/EURUSD Test: xcor4_SIG_A EUR/USD 2004..2016 Read xcor4_SIG_A_EURUSD.par Monte Carlo Analysis... Median AR 24% Profit 8142$ MI 54$ DD 4599$ Capital 3224$ Trades 3268 Win 52.8% Avg +2.9p Bars 106 CAGR 8% PF 1.06 SR 0.31 UI 19% R2 0.77