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
2 registered members (AndrewAMD, Ayumi), 838 guests, and 2 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
Simple Breakout Strategy #408105
09/25/12 11:58
09/25/12 11:58
Joined: Sep 2012
Posts: 99
T
TankWolf Offline OP
Junior Member
TankWolf  Offline OP
Junior Member
T

Joined: Sep 2012
Posts: 99
Hi jcl,

Ive been busy trying to write some very simple trading practice code and I was wondering if you might be able to help me out here. All Im trying to achieve is a simple strategy that looks at the day high and the day low from yesterday and if the price breaks the high then enterlong, with the vice versa for the short with simple profit and stop rules.

Quote:

#include "include\indicators.c"
function run()
{
var *Price = series(price());
var High = dayHigh(UTC,1);
var Low = dayLow(UTC,1);

if(*Price > (High + 3*PIP))
enterLong();
Stop = Low - 1*PIP;
Profit = 20*PIP;
else if (*Price < (Low - 1*PIP))
enterShort();
Stop = High + 3*PIP;
Profit = 20*PIP;
}


My first problem is that the complier says that dayHigh is an undeclared identifier. I got the dayHigh function from the manual and there is actually an example there too that uses it so I dont quite understand what Ive done wrong here any help would be appreciated.

Edit: Reading the manual again it says I can find the day functions in the indicators.c file took me a while but Im not getting an error trying to load it but I still get the identifier error for dayHigh.

Re: Simple Breakout Strategy [Re: TankWolf] #408118
09/25/12 18:41
09/25/12 18:41
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
You've looked into the wrong manual: you're not yet supposed to have a dayHigh function. This function is available in the next release only. Your manual opens when you click [Help]: only the functions described there are available in the current release.

If the High and Low don't need a certain time zone, just use the LL() and HH() indicators instead. And don't include indicators.c - it is automatically included.


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