London Breakout Strategy (Amibroker Code)

The original article can be found here.

The strategy in plain English:

  • We use the high and low from 0300 to 0800 London time.
  • When the price breaks above the high, we go long (between 0800 and 1100 London time).
  • When the price breaks below the low, we go long (between 0800 and 1100 London time).
  • We use a time exit (no stops or profit targets) at 1200, 1300, 1400, 1500, 1600, and 1700 London time.

Amibroker code:

(The backtest is based on Chicago time)

//backtest 2: when prices break above the low

oddis =  Optimize("Hour",100000,060000,110000,10000);

MyLow=ValueWhen(TimeNum()==020000,lowestsince(TimeNum()==210000,Close));
MyHigh=ValueWhen(TimeNum()==020000,highestsince(TimeNum()==210000,Close));

Buy = Cross(Close,myhigh) AND TimeNum()>020000 AND TimeNum() <050000 ;
buyprice= Close; 
Sell= TimeNum()==oddis ;
SellPrice=Close; 

-----------------------------------------------------------------------------
//backtest 2: when prices break below the low 

oddis =  Optimize("Hour",100000,060000,110000,10000);

MyLow=ValueWhen(TimeNum()==020000,lowestsince(TimeNum()==210000,Close));
MyHigh=ValueWhen(TimeNum()==020000,highestsince(TimeNum()==210000,Close));

Buy = Cross(mylow,Close) AND TimeNum()>020000 AND TimeNum() <050000 ;
buyprice= Close; 
Sell= TimeNum()==oddis ;
SellPrice=Close;