Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
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
1 registered members (AndrewAMD), 636 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
CDLHammer #423382
05/28/13 22:42
05/28/13 22:42
Joined: Apr 2013
Posts: 107
UK
G
Geek Offline OP
Member
Geek  Offline OP
Member
G

Joined: Apr 2013
Posts: 107
UK
Just been playing around with the Hammer Candle pattern and just want to verify that my code is correct as i am still learning...It seems to be working correctly when back-testing etc.

Is this the way to go for entering trades via candle patterns?

Quote:
function run()
{

BarPeriod = 1440;
Margin = 50;
NumWFOCycles = 10;
NumBarCycles = 5;
StartDate = 2002;

vars Price = series(price());

Stop = 2*ATR(30);
TakeProfit = 2*ATR(30);

while(asset(loop("EUR/USD")))

if (CDLHammer())
enterLong();

plot("CDLHammer",CDLHammer(),NEW,BLUE);

}


Thank You!

Re: CDLHammer [Re: Geek] #423393
05/29/13 07:59
05/29/13 07:59
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Yes, that's correct. I would always use { } brackets for the while() loop though - not needed here as you have only one command in the loop, but when you add more, missing brackets could be a possible error source.

Re: CDLHammer [Re: jcl] #423403
05/29/13 11:39
05/29/13 11:39
Joined: Apr 2013
Posts: 107
UK
G
Geek Offline OP
Member
Geek  Offline OP
Member
G

Joined: Apr 2013
Posts: 107
UK
Many thanks.

Last edited by Geek; 05/29/13 11:54.

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