Gamestudio Links
Zorro Links
Newest Posts
SGT_FW
by Aku_Aku. 11/30/26 08:19
Removing outliers from files
by JeyKey II. 11/29/26 10:01
Experiences with cTrader
by JeyKey II. 11/27/26 09:04
make a complaint
by EW_bytes. 11/26/26 23:00
FXCM => AVA Trade Plugin???
by Martin_HH. 11/25/26 21:59
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 12,552 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Help with a script #409133
10/11/12 23:49
10/11/12 23:49
Joined: Oct 2012
Posts: 10
Mexico
S
sabgto Offline OP
Newbie
sabgto  Offline OP
Newbie
S

Joined: Oct 2012
Posts: 10
Mexico
I’m just trying to understand the mechanics of “Zorro”. I took “the7 strategy” http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=408401#Post408401 and simplifying de code I have this:

function run(){
BarPeriod = 1440;
StartDate = 20120701;
NumDays = 60; // only two months in order to limit the output

var *pH = series(priceHigh());
var *pL = series(priceLow());
var *EMA5H = series(EMA(pH,5));
var *EMA5L = series(EMA(pL,5));

Stop = (HH(2) - LL(2));

if(priceOpen() > *EMA5H && priceClose() < *EMA5H && priceLow() > *EMA5L){
Entry = priceLow(0) - (5*PIP);
enterShort();
} else if(priceOpen() < *EMA5L && priceClose() > *EMA5L && priceHigh() < *EMA5H){
Entry = priceHigh(0) + (5*PIP);
enterLong();
}

plot("EMA5H", *EMA5H, 0, BLUE);
plot("EMA5L", *EMA5L, 0, BLUE);
}

When priceOpen < EMA5L and priceClose > EMA5L and priceHigh < EMA5H it should enterLong(). In the result chart I found this.



It seems to be that the condition to enterLong is satisfied however no enterLong order is executed. Could someone tell me if I have a mistake in the code or what is going on ?.

What should I do to post my code in a "code box" ?

Thanks.

Re: Help with a script [Re: sabgto] #409140
10/12/12 07:16
10/12/12 07:16
Joined: Sep 2012
Posts: 24
G
Gattaca Offline
Newbie
Gattaca  Offline
Newbie
G

Joined: Sep 2012
Posts: 24
That's interesting. I took your script and put in some printfs for debugging, and I think too, it should trigger at this bar.

Code:
function run(){
BarPeriod = 1440;
StartDate = 20120701;
NumDays = 60; // only two months in order to limit the output
set(LOGFILE);
var *pH = series(priceHigh());
var *pL = series(priceLow());
var *EMA5H = series(EMA(pH,5));
var *EMA5L = series(EMA(pL,5));

Stop = (HH(2) - LL(2));

printf("#\n%d %d   %f %f %f  %f  %f\n",day(0),month(0),priceOpen(),priceClose(),priceHigh(),*EMA5L,*EMA5H);
if(priceOpen() > *EMA5H && priceClose() < *EMA5H && priceLow() > *EMA5L){
printf("#\n %s" ,"EnterShort");
Entry = priceLow(0) - (5*PIP);

enterShort();
}
 if((priceOpen() < *EMA5L) && (priceClose() > *EMA5L) && (priceHigh() < *EMA5H)){
printf("#\n %s ","EnterLong");
Entry = priceHigh(0) + (5*PIP);

enterLong();
}

plot("EMA5H", *EMA5H, 0, BLUE);
plot("EMA5L", *EMA5L, 0, BLUE);
}


Last edited by Gattaca; 10/12/12 08:42.
Re: Help with a script [Re: Gattaca] #409148
10/12/12 11:04
10/12/12 11:04
Joined: Jul 2000
Posts: 28,149
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,149
Frankfurt
July 14 was a saturday. The FXCM simulation does not accept trades on weekends, so no trade was executed.

Add the line

g->nWeekend = 0;

for executing trades also on weekends.

BTW, for a code box click on "Switch to full reply screen", then you have all the format options.

Re: Help with a script [Re: sabgto] #409157
10/12/12 16:02
10/12/12 16:02
Joined: Oct 2012
Posts: 10
Mexico
S
sabgto Offline OP
Newbie
sabgto  Offline OP
Newbie
S

Joined: Oct 2012
Posts: 10
Mexico
Thanks for your fast answer. No trades on weekand is fine. Congratulations JCL I think Zorro is a very very good job.


Moderated by  Petra 

Gamestudio download | 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