Hold over the weekend or not test
Forums › ProRealTime English forum › ProOrder support › Hold over the weekend or not test
- This topic has 3 replies, 1 voice, and was last updated 6 years ago by Vonasi.
-
-
07/24/2018 at 4:31 PM #76632
I have been working on weekly strategies recently and with the new MTF feature it is now possible to open a trade on a weekly chart but close it at a time that might be more beneficial using MTF. So I decided to try to quantify it by writing a ‘fake’ strategy that checks the difference between a closing time on Friday and a selling time on Monday. For example you may decide at the close of Friday that you want to close your position but hold on to it until the markets open on Monday morning and the spread drops to a more sensible level before closing it. Obviously price can move for or against you in this time so I thought it would be nice to see what it does on average. I also then added in a calculation for over night fees for the weekend days. This can be turned on or off in the code.
It is for long positions on indices only. Apply it to hourly charts or 30 minute charts if your market closes or opens on the half hour.
123456789101112131415161718192021222324252627282930313233343536373839lasttime = 230000 //Last candle time of the week minus 010000openingtime = 080000 //Opening time of the market on Mondayfees = 1 //Weekend fees included in calculation. 1 = on and 0 = offPositionSize = 1BrokerFee = 2.5 //Broker Fee for overnight calculationLibor = 0.4728 //Current overnight Libor rate//LongFee = Round(((PositionSize * close) * (((BrokerFee/100) + (Libor/100))/365))*100)/100if lasttime > 210000 thenTotalLongFee = (LongFee * 2)elseTotalLongFee = (LongFee * 3)endifif opentime = lasttime and opendayofweek = 5 thenclosingprice = closeflag = 1endifif opentime = openingtime and opendayofweek >= 1 and flag = 1 thenopenprice = opendifference = (openprice - closingprice)total = total + differenceif fees thentotal = total - (TotalLongFee)endifnumber = number + 1endifif average[2] = -200 thenbuy 1 contract at marketendifave = total/numbergraph total as "Total Difference"graph ave as "Average"The above is for the FTSE100 selling at 0800 on Monday with weekend fees included compared to selling at midnight on Friday. It can be seen that you would be on average 4.2139 pips worse off by waiting till the Monday open to sell but the spread would be 1 instead of the 4 that it is on Friday night so you would gain 3 of those pips back. Still you would be better on average to just close the trade on Friday at midnight with the larger spread.
My brief check of popular markets seems to indicate that we worry about the spread and overnight fees too much and the difference is minimal and it is usually beneficial just to close the trade earlier and take the hit on the larger spread and save any extra fees too.
1 user thanked author for this post.
07/24/2018 at 4:52 PM #76638Here is the same FTSE100 but with the Friday night get out time moved to before the 2200 fees charge cut off time. At this time the spread should be the same as at the Monday open at 0800 so that can be discounted from our calculations. On average there has been a tiny advantage to selling early but it has not always been the case over the last few years and for a while it was a big disadvantage to sell early. I think this clearly shows that exit times and overnight fees are not very relevant to our decision to exit a trade before or after a weekend. I guess if you are in a profit on a Friday then you might as well get out and lock in the profit just before the 2200 cut off – on average you will come out the same but it is risk off the table over the weekend – that is for the FTSE100 at least based on the last few years data.
07/24/2018 at 6:50 PM #76642The DAX is an interesting market for this test. Here is the results of closing a trade before the Friday 2200 cut off compared to selling at 0800 on Monday morning.
Clearly over the last couple of years and on average it has been better to hold over the weekend and pay the 3 days fees and sell on Monday morning. The Dax has a spread of 5.0 between 2100 and 0700 and on Monday at 0800 just 1.0 so you also gain an extra 4 pips there too.
07/26/2018 at 4:59 PM #76829Today I found a strategy that I wrote ages ago and left to one side for some reason. I don’t remember what market or what time frame I wrote it for but today I accidentally started it on a weekly time frame chart of the DJI and it worked really well! So I’ve spent the day testing it and simplifying it and convinced myself that I should forward test it. I then decided to see what would happen if instead of selling at the close of the weekly candle I made the decision to sell at the close of the weekly candle but actually held off and sold during the following week during trading hours when the spread was lower (as long as it was still in profit).
Here are the images:
No MTF in the code – just sell at close of weekly candle:
..and MTF sell during trading hours:
It actually proved better to hold and sell at the open.
I then decided to move the first entry time to 30 minutes after the market open so that I could use the hourly charts and have a bit more data to test on. This then changed the results so that it was better to sell at the end of the week and not wait for the lower spread.
Sell at end of week image:
…and sell at lower spread intraday image:
This seems to confirm my earlier theory that there really isn’t much difference between holding or selling immediately. I shall run the MTF version alongside the end of week version on forward test for comparison.
-
AuthorPosts
Find exclusive trading pro-tools on