Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, VoroneTZ), 831 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
System´"jumps over" trades #416015
01/27/13 07:59
01/27/13 07:59
Joined: Jan 2013
Posts: 5
B
beerz Offline OP
Newbie
beerz  Offline OP
Newbie
B

Joined: Jan 2013
Posts: 5
Hi,

So, ive been playing around with different types of script in purpose to get mor exeperienced in programming. Right now, im doing this following script when I saw a problem occured:

function run ()


{

StartDate = 20110601;
EndDate = 20130120;
BarPeriod = 1440;

Stop = 50*PIP;
Trail = 40*PIP;
TrailLock = 1;


vars day_low = series(priceLow());
vars day_high = series(priceHigh());
vars day_close = series(priceClose());
vars EMA50 = series(EMA(day_close, 50));




if (day_close[0] < day_low[1] && day_close[0] < EMA50[1])
enterShort();


plot ("EMA50", EMA50[0], 0, RED);

}

It looks like it "jumps over" some trades, where (as i can see) it should've executed a trade since all conditions where true. Look at following link where I marked to see what I mean. http://postimage.org/image/kp13ttrmz/

Can someone explain why this is happening?

Thanks

Beerz

Re: System´"jumps over" trades [Re: beerz] #416026
01/27/13 12:31
01/27/13 12:31
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
Weekend, probably?

Re: System´"jumps over" trades [Re: Petra] #416143
01/28/13 10:18
01/28/13 10:18
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
It happens often that a trade does not execute as you expect - either due to a bug in your code, or because trading is not allowed due to weekend or other reasons. Your code, as far as I see, is ok.

You can often quickly find the reason when you activate LOGFILE, and/or use the printf function so that you see if you attempted to open a position on a Saturday, or if the if(..) condition was true or not.

Re: System´"jumps over" trades [Re: jcl] #416148
01/28/13 11:26
01/28/13 11:26
Joined: Sep 2012
Posts: 99
T
TankWolf Offline
Junior Member
TankWolf  Offline
Junior Member
T

Joined: Sep 2012
Posts: 99
Maybe due to lack of a long enough lookback period thats been the cause of problem trades for me before. Not only that but your code compares EMA(1) which is the value for yesterday's EMA and won't be the exact value as shown on your plot line I don't believe. Check your printf values as Jcl says to be sure though.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1