Thank you, appreciated.

Yes i understand this now,

The 0 = current?

The Start and End Market give me from 8 till 9am.

So, If the current hour is more than 9am the high and low from 8-9am will be Yes or No..

I noticed when the { } have been added it removes the negative price offset error.

I've run the script but no trades are entered, just wondering what could be causing this....I think it relates to these lines
Quote:
&& NumOpenLong <1 && Now > StartTrade && Now < Close)
..
Will try and sort this out now.

Quote:
function run()
{

BarPeriod = 15;
LookBack = 100;
set(TICKS);

vars Price = series(price());

StartMarket = 800;
EndMarket = 900;

var DH = 0, DL = 0;

if(lhour(UTC) > EndMarket) {
DH = dayHigh (UTC,0);
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 (Now > Close)
exitLong();

if (Now > Close)
exitShort();

asset("UK100");

Stop = Range;

TakeProfit = Range;

if (Range > 40*PIP)
Margin = 0;

if (*Price > DH && NumOpenLong <1 && Now > StartTrade && Now < Close)
enterLong(1);

else if (*Price < DL && NumOpenShort <1 && Now > StartTrade && Now < Close)
enterShort(1);

}

Last edited by Geek; 11/18/13 10:50.