Hello all, for reasons which aren't worth going into my trading has taken a bit of a back seat lately and i haven't been able to trade as actively as usual. Which got me thinking about an EA that could be left to it's own devices without any input from the user and still return a profit in the long run.
The only method that i can think of that i'd feel happy about leaving as a set-and-forget bot would be a market opening gap closer bot, the details of which i'll outline below in case it tickles anybody's fancy. I'm most definitely not a coder yet so my appologies for providing this as a strategy rather than a bot.
According to some things i've read which seem to be backed up by my experiences, gaps close on the day of the gap about 70% of the time, although often with a bit of wiggle in direction of the gap first. Quite how much wiggle before the gap closes i haven't analysed in any detail but to be on the safe side ive assumed that the larger the gap, the more volatile the market which follows that stop losses should be proportional to the size of the gap.
- when the market opens on sunday evening, any gaps greater than min_gap_pips places an order in the opposite direction to the gap.
- the stop loss for the order is the size of the gap divided by Risk_reward_ratio% (if set to 200% then a 50pip gap would have a 25 pip SL)
- the order size is determined so that only Risk% amount of equity is on the table per trade (eg if SL is hit only 1% of equity is lost)
- break even is set at Break_even%. (when set to 50%, the trade moves to BE at the half way point of the gap).
- close_partial% at break even (eg. closes 33% when the BE price is hit. 0% is off)
- PAIRS allows you enter which pairs the bot trades so that the EA only has to go onto one chart
this probably won't make anybody vastly wealthy since gaps aren't common enough or large enough to get enormous rewards but it still seems like a worthwhile bot for those times that you really don't have any time to do proper analysis of the market.
Mark
Gap Closer Strategy
-
garyfritz
Re: Gap Closer Strategy
No worries, but we have a better spot for that, so I moved this topic to the "Ideas for Possible Automation" forum.mlewis wrote:I'm most definitely not a coder yet so my appologies for providing this as a strategy rather than a bot.
-
Fx93
- Trader
- Posts: 83
- Joined: Mon Apr 09, 2012 6:32 pm
Re: Gap Closer Strategy
I was trying to find historical data on how many pips the weekend gap is each week, which I haven't found yet, but I did find a nice 10 year study here:
http://www.forex-tribe.com/Learn-About-Gaps.php
From this data, the green pairs on the second chart would be the best to trade. The data only includes gaps of more than 20 pips, so this could be set as a filter.
The stop loss is the issue, but one could simply not have a stop and close positions that didn't reach the TP at the end of D+2 (Tuesday at 11:59 p.m. when the gap starts Sunday at 5 p.m.). Also, since the difference between D+1 and D+2 is minimal, once could close at Monday night instead.
Also, if there were trades within 50 pips of the TP, one could try to open up a straddle grid recovery like G+, but the bigger losers would likely need closed.
http://www.forex-tribe.com/Learn-About-Gaps.php
From this data, the green pairs on the second chart would be the best to trade. The data only includes gaps of more than 20 pips, so this could be set as a filter.
The stop loss is the issue, but one could simply not have a stop and close positions that didn't reach the TP at the end of D+2 (Tuesday at 11:59 p.m. when the gap starts Sunday at 5 p.m.). Also, since the difference between D+1 and D+2 is minimal, once could close at Monday night instead.
Also, if there were trades within 50 pips of the TP, one could try to open up a straddle grid recovery like G+, but the bigger losers would likely need closed.
- mlewis
- Trader
- Posts: 76
- Joined: Wed Mar 21, 2012 1:51 pm
- Location: London
Re: Gap Closer Strategy
interesting study, i hadn't seen that - thanks for posting it. It seems to agree with the concept though. I may go over the same data and get some information on drift amount and time period before the gap is closed so that some kind of normal distribution can be calculated to include a probability aspect to setting the stop losses. i'll be doing it manually though due to crap coding skills so this may take a while!!
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Re: Gap Closer Strategy
I am posting here more to remind myself to do something about this than anything else.
About 4 years ago, or maybe more, a pal of mine (Currymonster) asked if I could code this. At the time, I lacked the experience and coding expertise.
I am a tad better at coding these days, and quite fancy having a crack at this.
So, does anyone here have any conclusions regarding the minimum tradable gap size.
Ignore this if your crim does not have a Sunday candle; The Gap does not apply to you.

About 4 years ago, or maybe more, a pal of mine (Currymonster) asked if I could code this. At the time, I lacked the experience and coding expertise.
I am a tad better at coding these days, and quite fancy having a crack at this.
So, does anyone here have any conclusions regarding the minimum tradable gap size.
Ignore this if your crim does not have a Sunday candle; The Gap does not apply to you.
Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
- Alpenkorps
- Trader
- Posts: 213
- Joined: Thu Dec 15, 2011 4:03 am
Re: Gap Closer Strategy
Correct me if I am wrong, but isn't gap is something we see because our lazy crims doesn't provide us feeds on weekends? Forex market is running 24/7, if there was no trading on weekends, we won't see those gaps at all. So in reality, there is no gap, the gap we see is just missing of few price bars.
Take my love, take my land, Take me where I cannot stand
I don't care, I'm still free, You can't take the sky from me
I don't care, I'm still free, You can't take the sky from me
-
mrpipstrader
- Trader
- Posts: 23
- Joined: Wed Nov 16, 2011 3:42 pm
Re: Gap Closer Strategy
Alpenkorps wrote:Correct me if I am wrong, but isn't gap is something we see because our lazy crims doesn't provide us feeds on weekends? Forex market is running 24/7, if there was no trading on weekends, we won't see those gaps at all. So in reality, there is no gap, the gap we see is just missing of few price bars.
I always thought that the gaps are created by "the market" reacting to weekend rumours and news (when trading isn't possible) and expressing their initial views as soon as a trading opportunity was available. When the rumours/news are digested in the first few hours of trading a proper balance is struck and frequently the gaps are closed.
Are you saying that there's off-market trading still occurring during the weekend (perhaps between the major institutions)?
- Alpenkorps
- Trader
- Posts: 213
- Joined: Thu Dec 15, 2011 4:03 am
Re: Gap Closer Strategy
Hello Pipstrader,mrpipstrader wrote: Are you saying that there's off-market trading still occurring during the weekend (perhaps between the major institutions)?
In Forex market, price can not change all by itself unless someone trades it. EurUsd quote would only increase if someone buy Euro spending US Dollar and vice versa.
Take my love, take my land, Take me where I cannot stand
I don't care, I'm still free, You can't take the sky from me
I don't care, I'm still free, You can't take the sky from me
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Re: Gap Closer Strategy
Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
- mlewis
- Trader
- Posts: 76
- Joined: Wed Mar 21, 2012 1:51 pm
- Location: London
Re: Gap Closer Strategy
Oh wow... I hadn't noticed all of this activity over here! Time to get testing!!