Nifty - Trading the Opening Gap

trader.trends

Well-Known Member
#1
Many take positions just before market closes with the intention of making money in the opening gap. This more or less becomes a gamble as they don't "know" the direction of open. If it opens against their position, they may close in panic incurring a loss.

Would it better to trade the opening gap after the market opens? The gap theory is that all gaps are closed. The shortcoming of that theory is that it does not say when the gap will close. For the intraday trader if he can have probability on his side that the gap will close the same day, then he can take a position.

I looked at a very minuscule data sample of just one month. September 2009.
We had 20 trading days. On 5 days the opening gap was insignificant.( I considered gaps of less than 15 points as not worth trading.) On 15 days we had gaps we could trade.

On 6 days there was a negative gap (range 20 to 38) and on 9 days positive gaps (range 17.5 to 47). On 4 of the 15 days, the gap was never covered; the opening was almost the day's low/high. After opening, the market of course moved in both directions. Suppose we had taken a trade at opening what would have been the result? Remember that on 11 out of 15 days, the gap was covered. I have taken the gap as covered if the price dropped to +/-5 points towards the previous close.
Enter at the opening gap. Short if the gaps is positive and long if gap is negative.
Stops: 25 points from entry.
Exit: For shorts: Previous close+5, For longs: Previous close-5
Example:
Trade of September 03. Open=4639
Previous close on 02 Sep = 4614.35
On 3rd NF opening gap of 24.55.
Entry: Short at 4639, stops @ 4664. Exit at 4619.35
I have taken the gap as closed if the price dropped to 4619.35 giving profit points of 19.55. This is basically a filter. Same way for gap down opening; 5 points below the previous close. On many days trade could have been taken closer to stops, thus increasing the profits and reducing the losses as NF continued to move in the direction of open.

If we had taken a position at opening (theoretical price) and closed it when it touched our filter level and used a stop loss of 20 or 25 points this would have been the result

Adding the opening gap points for 11 profitable days gives 275 points.
25 points stops 4 days gaps did not close =100points
Net points= 175 on 15 trades. Taking 5 points per trade for cost would have left us with a net point of 100 points.

20 point stops: 6 days. Stops 120 points. Net points = 275-120=155 points. After cost would have left us with 80 points for the month.

Traders taking overnight positions can also perhaps have a stops of 20-25 if their trade has gone against them and wait for the gap filling.
I have attached the excel sheet giving the details.

Caution: Insignificant sample size. This is just an idea floated for the involvement of others.
Do not take the EOD data of OHLC to test this strategy. OHLC does not say when High/Low was achieved and whether High came before the low or vice-versa. It also does not say if the gap was closed before achieving the high/low. I have looked at the tick data for all calculation.

Data Source: Close: NSE, Tickdata: chatreader.co.in

TT
 

augubhai

Well-Known Member
#2
Hi TT,

Please also consider the practical aspects.

Paper trading is not then right approach for this strategy. At open, price fluctuates widely, and you may just have microseconds to place your order. Gaps can get closed out in seconds. Superfast reaction, network, broker everything - that may not be really practical.

Trade with real money to check if this strategy can be actually executed.
 
#3
Many take positions just before market closes with the intention of making money in the opening gap. This more or less becomes a gamble as they don't "know" the direction of open. If it opens against their position, they may close in panic incurring a loss.

Would it better to trade the opening gap after the market opens? The gap theory is that all gaps are closed. The shortcoming of that theory is that it does not say when the gap will close. For the intraday trader if he can have probability on his side that the gap will close the same day, then he can take a position.

I looked at a very minuscule data sample of just one month. September 2009.
We had 20 trading days. On 5 days the opening gap was insignificant.( I considered gaps of less than 15 points as not worth trading.) On 15 days we had gaps we could trade.

On 6 days there was a negative gap (range 20 to 38) and on 9 days positive gaps (range 17.5 to 47). On 4 of the 15 days, the gap was never covered; the opening was almost the day's low/high. After opening, the market of course moved in both directions. Suppose we had taken a trade at opening what would have been the result? Remember that on 11 out of 15 days, the gap was covered. I have taken the gap as covered if the price dropped to +/-5 points towards the previous close.
Enter at the opening gap. Short if the gaps is positive and long if gap is negative.
Stops: 25 points from entry.
Exit: For shorts: Previous close+5, For longs: Previous close-5
Example:
Trade of September 03. Open=4639
Previous close on 02 Sep = 4614.35
On 3rd NF opening gap of 24.55.
Entry: Short at 4639, stops @ 4664. Exit at 4619.35
I have taken the gap as closed if the price dropped to 4619.35 giving profit points of 19.55. This is basically a filter. Same way for gap down opening; 5 points below the previous close. On many days trade could have been taken closer to stops, thus increasing the profits and reducing the losses as NF continued to move in the direction of open.

If we had taken a position at opening (theoretical price) and closed it when it touched our filter level and used a stop loss of 20 or 25 points this would have been the result

Adding the opening gap points for 11 profitable days gives 275 points.
25 points stops 4 days gaps did not close =100points
Net points= 175 on 15 trades. Taking 5 points per trade for cost would have left us with a net point of 100 points.

20 point stops: 6 days. Stops 120 points. Net points = 275-120=155 points. After cost would have left us with 80 points for the month.

Traders taking overnight positions can also perhaps have a stops of 20-25 if their trade has gone against them and wait for the gap filling.
I have attached the excel sheet giving the details.

Caution: Insignificant sample size. This is just an idea floated for the involvement of others.
Do not take the EOD data of OHLC to test this strategy. OHLC does not say when High/Low was achieved and whether High came before the low or vice-versa. It also does not say if the gap was closed before achieving the high/low. I have looked at the tick data for all calculation.

Data Source: Close: NSE, Tickdata: chatreader.co.in

TT
Good to see you are working towards finding a good strategy and sharing your ideas :).If i find time i will backtest this strategy for you and post the result tomorrow.
Happy trading
 
#4
Hi TT,

Trade with real money to check if this strategy can be actually executed.
Hi do u mean we should just trade blindly without having any plan or testing?
Practial trading is ok but if a strategy which does not work in testing how will it work in real trading? and to find which works or which doesnt work we need backtesting or what u call papertrading.
 

trader.trends

Well-Known Member
#5
Hi TT,

Please also consider the practical aspects.

Paper trading is not then right approach for this strategy. At open, price fluctuates widely, and you may just have microseconds to place your order. Gaps can get closed out in seconds. Superfast reaction, network, broker everything - that may not be really practical.

Trade with real money to check if this strategy can be actually executed.
If the strategy works, execution should not be a big problem. Trade at open does not mean trade at 955. In the small sample tested, there has been enough time to initiate and close the trade.
Like Raja has mentioned, if it does not work on paper and we still trade it, we are kidding ourselves.

The idea is to see if people have better ideas, if they have already done this with success/failure.
 

surya_sun

Active Member
#7
The decision to go long and short is directionaly inverse to the gap opening-correct.. If you could also add the time of your eexecution wold be helpful to understand better. I guess, this seems really interesting (means good).
Will try out and see how it works.
tnx and keep posting .
do you have similar records for oct??.. a 3 monthly average would seems good enough.

Thanks Raja for the effort. I am going through your backtest of the Red line strategy. Will respond to that.
 

AW10

Well-Known Member
#8
TT Good to see you working on another simple but most effective gap trading strategy.
This strategy does work, and I know few traders who just make their living by this strategy (ofcourse they play with >1 contracts) due to the demand/supply imbalance found at opening. As a universal, it is just matter of time, when this imbalance disappears.

I was working on it few days back but left it after initial analysis.
I have tested the setup idea on EOD data of NF for over 16 months. My approach was
to first assess the behaviour of Gaps v/s the performance in terms of "gap closed or not".
In my view, all gaps are not equal so I classified them in various category based on
size of the gap. My whole calculation was based on gap as % of close price to make it sensitive to CMP. Gap direction doesn't matter at all, so I have taken absolute size of gap.

Some of the findings are
1) 66% of opening gaps are closed in the same days
2) 93% of gaps of size <= 0.5% are filled on the same day
3) 70% of gaps of size <= 1% are filled on the same day
4) the success rate drops to <44% for remaining size. .i.e. trading gaps more then 1% of size with this approach does not give any edge..but for <=1% size, it is quite strong setup with > 70% success rate (there are very few setups that could meet such win rate).

Here I have just used the relationship of Prev C, Today O, Today's H and L to decide whether the gaps is closed or not. That means, there was no question of stoploss.

If I look at the sample of 20 days that u have provided, then it is more or less in line with this. As per my data, including all those small gaps days as well..
1) Out of Sept's 20 days, on 15 days, gap was filled. i.e. 75% of the time.
2) Max gap was 47 pts, and min gap was 3 pts.. which makes all gaps well will within 1% range of CMP.
3) If we had just taken no stoploss strategy and closed on the close of the day, the cummulative loss on those 5 days would have been 158 pts (max 57 pts, and min 4 pts)
4) This when u compare look at from the simple strategy of long/short at open, with target at prev days close, would have accumulated 368 pts in other 15 days of the month i.e. giving 200 pts of clean gain.

In July / August we had >1% gaps hence overall success rate numbers are different. I have not done exact calcuation yet, but if I remove >1% gap days, then still it is about net gain of 150+ points.

Raja - if you are backtesting it, then can u plz put a condition to check taking all gap trades and taking trades only with gap <=1% of CMP.
Maybe depending on cost of trading say 10 pts, you can also skip gaps with absolutely gap size of <= 10 pts.

Hope this helps. Looking forward for more from this thread.
Happy Trading
 
#9
Raja - if you are backtesting it, then can u plz put a condition to check taking all gap trades and taking trades only with gap <=1% of CMP.
Maybe depending on cost of trading say 10 pts, you can also skip gaps with absolutely gap size of <= 10 pts.

Hope this helps. Looking forward for more from this thread.
Happy Trading
I could not use the first condition of cashmarket gap since i dont have correct cash data :( but i have taken the second rule and still the results are not encouraging i think the rules are not sound often market goes in the direction of the gap then it may reverse anytime but we dont know when it will reverse so it seems doesnt work.I also tried to optimize values for stoploss and gap size even then not much change it performance.

report link : http://www.4shared.com/account/file/149174328/1af93371/trader_trends_gap.html

PS:I have used investbulls data.
 

Similar threads