Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
4 registered members (fogman, Grant, AndrewAMD, juanex), 989 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 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,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
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