Deadline June

Re: Gap Filler

Hi Brett

it's really simple! Goes to show how convoluted my journal entries must be if you can't figure out what I'm on about.

It really is just about putting on a position at the end of the weekend when the market opens with a gap from the Friday close.

The technical details are laid down by my broker, IB: they stop sending price data at 22:00 GMT+0 on Friday, and recommence at 22:15 GMT+0 on Sunday.

I assume there is only one definition of a gap: clear space between the top or bottom of the previous bar and the new open.

Since I'm trading it mechanically (21 forex pairs - try doing that manually) I have to code it and it's not straight forward to code it for backtesting. I could code it with tick data from Disktrading, but I want to test it on the Interactive Brokers data which is closest to the live feed it will trade - and I don't have tick data for that.

I only have minute data.

While writing this it occurs to me that I should just ask NinjaTrader support straight out how best to code a market order to fire off when the open is above or below a certain price. I just think NinjaTrader won't let me do that.

It also occurs to me that backtesting with 1 minute data will mean all my entries will be 1 minute after the open. I guess I can compare the results on 1 minute data with the same data set to tick resolution and find out what difference it makes. Maybe it all works out the same.

Ok thats how i thought it works. I trade it at 9pm on sunday though. Sometimes the gap closes by 10pm and by 10:15pm the price could be the other way round. My friend backtested this and it seems to work better at 9pm as opposed to 10pm. I also stick to EURUSD, GBPUSD and AUDUSD. He also tested it over news when the price gaps. I think column 3.
 
Last edited:
Ok thats how i thought it works. I trade it at 9pm on sunday though. Sometimes the gap closes by 10pm and by 10:15pm the price could be the other way round. My friend backtested this and it seems to work better at 9pm as opposed to 10pm. I also stick to EURUSD, GBPUSD and AUDUSD. He also tested it over news when the price gaps. I think column 3.

Which broker opens at 9pm Sunday? I'm with IB as stated and 10:15pm is when they start sending quotes and accepting orders. These results are based on these IB times, although using Disktrading tick data where I have to ignore the data earlier than 10:15pm.

Can you give me an idea how big the spreads get for you at 9pm Sunday? I should imagine they are even bigger than I see on IB at 10:15pm, and there they can get pretty huge. I'm not going to trade a system that only makes $30 a trade @$100,000 lot size if I have to cross a $50 spread!

Adam, what's the rationale for thinking this should work? Is it exploiting an inefficiency with IB?

The rationale is that the markets retrace over the gap back to the price at the close before moving off in their own direction.

It's not an inefficiency with IB, more an inefficiency with the whole human week-end. Whatever the broker - and Brettus seems to have a broker who would allow more profit from this - the market often opens at a price outside the last bar on Friday night.
 
Which broker opens at 9pm Sunday? I'm with IB as stated and 10:15pm is when they start sending quotes and accepting orders. These results are based on these IB times, although using Disktrading tick data where I have to ignore the data earlier than 10:15pm.




The rationale is that the markets retrace over the gap back to the price at the close before moving off in their own direction.

It's not an inefficiency with IB, more an inefficiency with the whole human week-end. Whatever the broker - and Brettus seems to have a broker who would allow more profit from this - the market often opens at a price outside the last bar on Friday night.

Well someone like Oanda opens earlier, but i just use IG. Do you every watch the price before 9pm? from 6pm to 9pm, because the market is officially open from 6pm Sunday night. It might influence you slightly. That's a good point. I think the model averaged 13 pips per trade.
 
Re: Gap Filler

Well someone like Oanda opens earlier, but i just use IG. Do you every watch the price before 9pm? from 6pm to 9pm, because the market is officially open from 6pm Sunday night. It might influence you slightly. That's a good point. I think the model averaged 13 pips per trade.


No. I have a connection to IQFeed as well as IB - for historical data - and they open at 10:00pm but that's as early as I've seen it.

I'd need a broker that I can connect up to NinjaTrader otherwise I'm looking at scripting it in yet another language for yet another platform.

I think with IB it might be possible but it does depend on the slippage which I can't really be sure about at that time of day.
 
Adam, what's the rationale for thinking this should work? Is it exploiting an inefficiency with IB?

Have you seen the gap trade before on a sunday night? It seems to work. It's not exploiting the Ib. Its the bankers stop hunting.
 
Have you seen the gap trade before on a sunday night? It seems to work. It's not exploiting the Ib. Its the bankers stop hunting.

The bankers? Which ones? The ones in New Zealand? I never believe these reasons. Nobody is really bigger than the market. I've seen some stuff where you can see their actions in the level 2 book, but I think a more rational explanation is that a huge number of traders believe that the gap should be closed, and trade accordingly, which duly leads to the gap closing.
 
The bankers? Which ones? The ones in New Zealand? I never believe these reasons. Nobody is really bigger than the market. I've seen some stuff where you can see their actions in the level 2 book, but I think a more rational explanation is that a huge number of traders believe that the gap should be closed, and trade accordingly, which duly leads to the gap closing.

Yea but the order board for the uk for example will go to the traders in asia overnight. Think about the logic. EURUSD and GBPUSD at the moment have been on a bullish run, and there might be a few long into the weekend and i doubt many will be short with that bullish close. So How can you make a quick buck? Well surely these longs will have stops below the current market price at the close of friday. So how do we stop these guys out? We sell down to that price and move the market so they are stopped out and we have effectively closed our position against a client position. Why does the price then go back up? Well like you said everyone is buying it back to the close. Other than a few are trying to pick up a few cheap GBP and EUR, unrelated to the gap idea.
 
I have to say, this sounds very tenuous. When do you trade, at the close on Friday? How do you decide which way to trade?

IG provide normal prices from 9pm, but your system is in suspension until 10.15pm. It seems a little bizarre.. just because you've found a pattern, what's the justification for it continuing? This reminds me a little of people who go hunting for patterns, e.g. EUR/USD spot rallies first week of September for the last 14 years out of 15, thus go long EUR/USD 1st September..

Or is there something else? I can see that prices often gap on Monday, but how are you calling the direction?
 
I have to say, this sounds very tenuous. When do you trade, at the close on Friday? How do you decide which way to trade?

IG provide normal prices from 9pm, but your system is in suspension until 10.15pm. It seems a little bizarre.. just because you've found a pattern, what's the justification for it continuing? This reminds me a little of people who go hunting for patterns, e.g. EUR/USD spot rallies first week of September for the last 14 years out of 15, thus go long EUR/USD 1st September..

Or is there something else? I can see that prices often gap on Monday, but how are you calling the direction?

Nah. I trade at 9pm tonight. In about 30mins. If it gaps down more than 25 points i'll buy from fridays price and if its 25 above, i'll sell.
 
Fundamental reasons

I have to say, this sounds very tenuous. When do you trade, at the close on Friday? How do you decide which way to trade?

IG provide normal prices from 9pm, but your system is in suspension until 10.15pm. It seems a little bizarre.. just because you've found a pattern, what's the justification for it continuing? This reminds me a little of people who go hunting for patterns, e.g. EUR/USD spot rallies first week of September for the last 14 years out of 15, thus go long EUR/USD 1st September..

Or is there something else? I can see that prices often gap on Monday, but how are you calling the direction?

Personally I would love to have a fundamental reason why a system worked, something that explained it in real life.

But I don't require it and I don't even benefit from it if I do have it.

So yes I am one of these people who look for patterns that repeat themselves.

Perhaps this illustrates my point - or perhaps it's lateral thinking that's too lateral - but recent research has shown that patients in medical trials who are given the placebo are almost as likely to be cured as those receiving the real medicine. Further research showed that even those test patients who knew they were being given the placebo were almost as likely to be cured.

Markets are only human.
 
re: Gap Filler - out-of-sample comes good

Optimised result - 2001 - 2008 disktrading data:

HTML:
Instrument	Total Net Profit	Average Trade	Total # of Trades
$AUDJPY_DTC	22660.00	70.37	322
$AUDUSD_DTC	12080.00	36.06	335
$CHFJPY_DTC	15930.00	48.72	327
$EURCHF_DTC	13385.00	52.08	257
$EURGBP_DTC	7475.00	25.78	290
$EURJPY_DTC	22795.00	70.57	323
$EURUSD_DTC	11045.00	32.97	335
$GBPCHF_DTC	26655.00	87.97	303
$GBPJPY_DTC	27770.00	84.41	329
$GBPUSD_DTC	10850.00	34.01	319
$USDCAD_DTC	10495.00	34.30	306
$USDCHF_DTC	12140.00	36.46	333
$USDJPY_DTC	17685.00	50.67	349
COMBINED RESULTS	210965.00	51.11	4128

Out-of-sample, 2009 - 2010

HTML:
Instrument	Total Net Profit	Average Trade	Total # of Trades
$AUDJPY_DTC	-1355.00	-33.88	40
$AUDUSD_DTC	2305.00	52.39	44
$CHFJPY_DTC	1340.00	34.36	39
$EURCHF_DTC	3530.00	84.05	42
$EURGBP_DTC	2130.00	50.71	42
$EURJPY_DTC	1150.00	27.38	42
$EURUSD_DTC	835.00	18.15	46
$GBPCHF_DTC	11315.00	257.16	44
$GBPJPY_DTC	10320.00	234.55	44
$GBPUSD_DTC	2055.00	66.29	31
$USDCAD_DTC	380.00	10.86	35
$USDCHF_DTC	2275.00	54.17	42
$USDJPY_DTC	1600.00	37.21	43
COMBINED RESULTS	37880.00	70.94	534

Apparently the only way to improve the implementation in the script is to use a 1 tick series for the backtest so I might do that later.

Brettus said:
If it gaps down more than 25 points i'll buy from fridays price and if its 25 above, i'll sell.

Of course! I Stupido! My system takes every gap, even the 1 point gaps. I need to filter out the tiny gaps that don't even offer enough reward to cover the commission and slippage.

In the meantime I'm going to set these off tonight on the simulation account to see whether the NinjaTrader code I wrote works live.
 
There's a problem with causality here.

First of all, there are an infinite number of patterns. You don't need to look very hard to find one. I've seen an entire presentation from a trader who spends his entire day looking for patterns, and then assumes they'll repeat.

For example, over the last 10 years, the FTSE has rallied on the second Tuesday of March 85% of the time (I just made that up, but it might be true).

So, next time it's the second Tuesday of March, he'll buy the at-the-money binary at 55% at the start of the day (or whatever the offer is), GENUINELY believing that it is "undervalued". Of course it is not undervalued, as the seller can quite easily hedge it and perhaps lock in the 5% from the true mid, which is 50%.

Read "Fooled by randomness" for a more mathematical explanation of this. You're seeing a pattern, but true randomness itself does not look random, it will have patterns within it that look non-random.

Now, brettus offers another explanation, namely that these gaps are the result of stop hunting and other such activity. I have no idea if this is true, but even if it is, it doesn't tell you where to stop loss or take profit (you'll get this from optimizing, probably). I would imagine the person with the real edge here is the trader in Aus/NZ who can see where the stops are, and just jam them before Tokyo gets in.
 
There's a problem with causality here.

First of all, there are an infinite number of patterns. You don't need to look very hard to find one. I've seen an entire presentation from a trader who spends his entire day looking for patterns, and then assumes they'll repeat.

For example, over the last 10 years, the FTSE has rallied on the second Tuesday of March 85% of the time (I just made that up, but it might be true).

So, next time it's the second Tuesday of March, he'll buy the at-the-money binary at 55% at the start of the day (or whatever the offer is), GENUINELY believing that it is "undervalued". Of course it is not undervalued, as the seller can quite easily hedge it and perhaps lock in the 5% from the true mid, which is 50%.

Read "Fooled by randomness" for a more mathematical explanation of this. You're seeing a pattern, but true randomness itself does not look random, it will have patterns within it that look non-random.

Now, brettus offers another explanation, namely that these gaps are the result of stop hunting and other such activity. I have no idea if this is true, but even if it is, it doesn't tell you where to stop loss or take profit (you'll get this from optimizing, probably). I would imagine the person with the real edge here is the trader in Aus/NZ who can see where the stops are, and just jam them before Tokyo gets in.

Yea. It's an ege that i have used for the last 6 months without a loss, and as soon as it does lose, i will probably stop using it. The same as trading momentum into the close. Some small edges i have picked up from some ex floor traders and clients.
 
Actually, that link is pretty good. Here's one extract -

The more firemen fighting a fire, the bigger the fire is going to be.
Therefore firemen cause fire.
 
Actually, that link is pretty good. Here's one extract -

The more firemen fighting a fire, the bigger the fire is going to be.
Therefore firemen cause fire.

Have you read Freakonomics or Super Freakonomics? It covers the below.

Which is more dangerous, a gun or a swimming pool? What do schoolteachers and sumo wrestlers have in common? Why do drug dealers still live with their moms? How much do parents really matter? How did the legalization of abortion affect the rate of violent crime?
 
Re: causality

Yes, I understand that, but I'm not worried, after all, I'm a kangaroo. I mean, kangaroos have 2 legs.

But seriously, although Taleb is brilliant, in some places he does have blind spots. This being one of them. Travis is worth quoting on this one. Regarding implementing systems based on patterns:

Travis said:
The way to do this is years and years of work and also accepting that 75% of your systems, after all this hard work, will still not be good enough to be traded.

That for me is the bottom line. Some patterns will, some patterns won't.

Do you still have a problem with that?

I know what you're thinking. Did I make 5 logical steps there, or 6?

By the way, which is more important: whether you can detect the causality in your pattern, or whether the system makes money?
 
Last edited:
Re: causality

Yes, I understand that, but I'm not worried, after all, I'm a kangaroo. I mean, kangaroos have 2 legs.

But seriously, although Taleb is brilliant, in some places he does have blind spots. This being one of them. Travis is worth quoting on this one. Regarding implementing systems based on patterns:



That for me is the bottom line. Some patterns will, some patterns won't.

Do you still have a problem with that?

I know what you're thinking. Did I make 5 logical steps there, or 6?

By the way, which is more important: whether you can detect the causality in your pattern, or whether the system makes money?

I only believe in patterns if i can understand the trading mentality behind them. I could easily make up a pattern that works, only for price to do the exact opposite the next year. I think the problem with systems that most people dont realise is that there is probably 1million systems that have worked backtested.
 
Top