Analysis of GAP Risk

Before progressing with any algorithmic trading strategy, I wanted to make a reasonable effort at evaluating a suitable strategy to limit my GAP risk should something go wrong.

Firstly, I downloaded 1 minute candle data for each of the following currencies from the www.histdata.com website and uploaded it into the MetaTrader history centre.

I wanted to get a feel for what the maximum percentage movement was over a 1 minute, 5 minute and 15 minute timeframe.   To evaluate this I created three scripts.   The first one uses an adjusted version of the True Range formula to try to evaluate the maximum percentage change.   The remaining two scripts then measure the maximum percentage change by looking at the highest high over 5 or 15 candles and lowest low over 5 or 15 candles:

1 Candle Analysis:  1MinuteTrueRangeAsPercentage
5 Candle Analysis:  1MinuteVariationOver5Candles
15 Candle Analysis:  1MinuteVariationOver15Candles

The results of this analysis for a number of different symbols is shown below:

Symbol

1 Minute

5 Minute

15 Minute

EURGBP   

3.082576%

3.480297%

3.497894%

GBPAUD

2.181736%

3.027844%

3.084922%

GBPNZD

3.183468%

3.801674%

4.489529%

GBPUSD

3.288705%

4.817875%

4.851956%

GBPCAD

2.141329%

3.278557%

3.351980%

GBPCHF

14.414261%

15.055905%

15.213782%

GBPJPY

2.824119%

6.259916%

7.134861%

Measured from 2007 to 2017, except for NZD, which started in 2008.

As can be seen from these results, the majority of the largest movements are below 3.5% in the 1 minute timeframe, except for the GBPCHF symbol, which experienced a massive GAP event when the currency peg was removed in January 2015.   When I considered these figures, I asked myself, what would be the maximum lot size that I could trade to limit my maximum loss incase of a GAP event to say £1,000, £5,000 and £10,000.   To achieve this, I created a simple script to approximate this loss based upon a GAP event of 3.5%, 5% and 15%.   The results are shown in the following 3 tables:

Maximum Loss: GBP 1,000

   

Symbol

Lot 15% GAP

Lot 5% GAP. 

Lot 3.5% GAP  

EURGBP

0.07

0.22

0.32

GBPAUD

0.06

0.19

0.28

GBPNZD

0.06

0.19

0.28

GBPUSD

0.06

0.19

0.28

GBPCAD

0.06

0.19

0.28

GBPCHF

0.06

0.19

0.28

GBPJPY

0.06

0.19

0.28

Maximum Loss: GBP 5,000

   

Symbol

Lot 15% GAP

Lot 5% GAP. 

Lot 3.5% GAP. 

EURGBP

0.37

1.12

1.60

GBPAUD

0.33

0.99

1.42

GBPNZD

0.33

0.99

1.42

GBPUSD

0.33

0.99

1.42

GBPCAD

0.33

0.99

1.42

GBPCHF

0.33

0.99

1.42

GBPJPY

0.33

0.99

1.42

 

Maximum Loss: GBP 10,000

   

Symbol

Lot 15% GAP

Lot 5% GAP  

Lot 3.5% GAP. 

EURGBP

0.74

2.24

3.20

GBPAUD

0.66

1.99

2.85

GBPNZD

0.66

1.99

2.85

GBPUSD

0.66

1.99

2.85

GBPCAD

0.66

1.99

2.85

GBPCHF

0.66

1.99

2.85

GBPJPY

0.66

1.99

2.85

The script used to estimate the Lot size for this level of GAP risk is listed below.   I am sure that it is not a perfect calculation, and there is a risk that other brokers may be setup in a different way to the one that I am using, however I believe that it is very useful to get a feeling for what my maximum lot size should be.

MQL Code:  LotSizeForGAPEvent

My current thoughts on GAP analysis are:

  • I could choose to only trade 1 symbol at a time and limit it to 0.06 or 0.07 lots.   This would be relatively safe, but I don’t think that I will be making any vast profit using this strategy.
  • I could choose to trade 5 or 6 symbols at a time using a lot size of 2 or 3, i.e. the High Risk strategy.   This is great, unless I get a huge GAP event in one of the symbols, which would probably bankrupt me.
  • I could attempt to build a diversified strategy.   Currently I think the following would be reasonable:
    • First:   I currently associate large currency GAP events with currency pegs.   With respect to my account currency, if my government decided to peg the currency, it may be wise to shut down the account and open a new account in a different currency.   I would then probably want to either completely avoid trading in any currencies that have a peg or limit the exposure to say 0.05 lots.
    • Second:   I could afford to lose 5 to 10k if one symbol had a large GAP event, so perhaps I could limit my exposure to any one symbol to say 0.5 lots.
    • Third:   I could also limit my total absolute exposure to 2 or 3 lots, i.e. I would only ever have between 4 and 6 trades open with a lot size of 0.5.
    • Fourth:   I also associate large GAP events (and spread increases) with high risk calendar events.   Perhaps I should close out or significantly reduce the risk of any trades 5 to 20 minutes before the calendar event and then open the trade 5 to 20 minutes after. 
    • Fifth:   Avoid trading at times where the liquidity is low, such as Bank Holidays and during the night.
    • Last:   Ensure that I am trading with a broker that has Negative Balance Protection.

Point 4 and 5 have are also relevant to the following post.   Record Spread, Stop and Freeze Level

Add a Comment