Gamestudio Links
Zorro Links
Newest Posts
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
Release 2.68 replacement of the .par format
by Martin_HH. 09/23/25 20:48
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (dBc), 17,435 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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: 28,022
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,022
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 | 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