Thanks guys, appreciate you pointing these things out!
When I do not set the PEEK flag, i get "error 045: Negative price offset at bar 1" ?
I know this is due to the following: It goes away when Peek is set.
var DH = dayHigh (UTC,0);
var DL = dayLow (UTC,0);
I have set StartMarket and EndMarket - from 8am-9am.. As that's the first hours trading that this script is based on that the dayHigh and dayLow should work from. i do not want to set dayLow (UTC,1); for instance as this will based on yesterdays low..?
Anyway, I made some more changes to the code, i'd be interested to see how incorrect this is. I know it will be, but all this help me and any other learners to get to grips with the code.
Edit: i just noticed another error, I'm not sure what this error means exactly?
"Error in 'line 26:
Syntax error: Can't go to FALSEGOTO:DOUBLE::.
< if (Close) >
Thanks for your patience and for pointing out any inaccuracies.
function run()
{
BarPeriod = 15;
LookBack = 1000;
set(TICKS);
StartDate = 2010;
vars Price = series(price());
StartMarket = 800;
EndMarket = 900;
var DH = dayHigh (UTC,0);
var DL = dayLow (UTC,0);
var Range = DH-DL;
var Close = timeOffset(UTC,0,16,30);
var Open = timeOffset(UTC,0,8,00);
var StartTrade = timeOffset(UTC,0,9,00);
var Now = timeOffset(UTC,0,0,00);
if (Close)
exitLong();
if (Close)
exitShort();
asset("UK100");
Stop = Range;
TakeProfit = Range;
if (Range > 40*PIP)
Lots = 0;
if (*Price > DH && NumOpenLong <1 && Now > StartTrade && Now < Close)
enterLong();
else if (*Price < DL && NumOpenShort <1 && Now > StartTrade && Now < Close)
enterShort();
}