SlideShare una empresa de Scribd logo
1 de 11
Descargar para leer sin conexión
Intraday Trading Systems With End Of Day Data:
Pivot Points Study
jbmarwood.com/intraday-trading-systems
May 9, 2015 by JB Marwood
This article looks at a couple of intraday trading system ideas using End-of-Day price data
and pivot points.
Readers will be aware that I use Amibroker and Norgate Premium Data to construct trading systems
and test trading ideas. This data is EOD (end-of-day) which means it contains just the open, high, low,
and close prices for each full trading day.
In other words, the data does not include any intraday price quotes, not even at the hourly level.
This data is thus perfect for medium-long term trading systems but it is perfectly useless for short-term
trading.
…Or is it?
You see, even though we don’t have any intraday price quotes, it is still possible to test some
interesting short-term trading ideas. Let’s see how.
Intraday Trading Systems With EOD Data
For quite a long time, I failed to realise that just because we don’t have intraday quotes doesn’t mean
we can’t test some short-term ideas.
We have the open, high, low, and close prices available. We are therefore able to buy on the open and
sell on the close; a short-term trading idea in itself. We are also able to trade on the close and sell on
the open, an overnight trading idea.
So let’s look at some more creative ideas for intraday trading.
Pivot Points
Pivot points are pre-determined levels that many day traders look at to help make trade decisions.
They are calculated using the previous day’s price range and consist of the main pivot level, then three
support and three resistance levels, placed below and above the pivot respectively.
You can read more about pivots and how they are calculated here. But essentially, pivots are key
intraday levels that many traders take notice of. Since pivots are calculated using the previous day’s
price action we can use them to test some interesting ideas.
Test One
In test one, we take EOD data for the E-mini S&P 500 futures contract (referred to as ‘&ES’
by Premium Data) and we buy the market whenever it opens below it’s pivot. We sell on the close.
To keep things simple we will use a fixed position size of 1 contract. Point value is set at $50,
commission is set at $15 per trade and starting capital is $100,000. (For more information about setting
up back-tests for futures using Amibroker see here).
Test one rules:
• If @ES opens below it’s pivot, buy on the open & sell on the close
• Position size = 1 contract, fixed
Following is the code used to calculate the pivot levels:
P = Pivot = Ref((High+Low+Close)/3,-
1);
P1 = Ref(H,-1);
L1 = Ref(L,-1);
R1 = P + (p-L1);
S1 = P - (H1-p);
R2 = P + (H1 - L1);
S2 = P - (H1-L1);
R3 = H1 + 2*(P-L1);
S3 = L1 - 2*(H1-P);
Test one results:
As you can see, running this system between 1/1/2002 and 1/1/2014 produced a compounded annual
return of 1.98% with a maximum drawdown of -18.87% over 1329 trades.
The win ratio is adequate but the CAR/MDD ratio is not particularly attractive. I then decided to test
some other variations of pivots using the same settings. The results are shown below:
For example, line three buys the E-Mini when it opens below the second support and produced a CAR
of 0.21%. As you can see, the best performance came from the original test (open < pivot). So I ran
the system in the out-of-sample period between 1/1/2014 and 5/1/2015. The results are shown in the
final line of the table above and the equity curve is shown below:
Comments
Buying the market when the market opens under the pivot and selling on the close was the best
performing variable. There may be some potential for development by introducing longer holding times,
a market filter, or adding extra rules and complexity.
Using (optimistic) commissions of $15 per trade, it is hard to find a simple trading system that works
well for the E-Mini future. The E-Mini is a particularly tight market to trade and traders might have more
success with more volatile instruments such as the Dow Jones Average, Nasdaq, FTSE 100 or DAX.
Test Two
In test two, we are going to use the same settings as test one and stick with the E-Mini.
This time we are going to buy the index on the open, so long as the open is lower than the pivot AND
higher than the second support. If the market touches the third support we will sell at that level, if not,
we will sell on the close.
Test two rules:
• If @ES opens between the pivot and second support buy on the open
• If the market trades at or below S3, exit at S3. Otherwise exit on the close
• Position size = 1 contract, fixed
To set this up correctly I used the below formula. The S3 sell price was rounded to the nearest integer
since the E-Mini has a tick size of 0.25. There is probably a better way to do it.
Buy = O<P AND O>S2;
Sell = C;
S3price = round(S3);
BuyPrice = O;
SellPrice =
IIf(L<=S3,S3price,C);
Test two results
Running the test on the E-Mini between 1/1/2002 and 1/1/2014 returned a CAR of 1.63% with a
maximum drawdown of -21.79%% from 1318 trades.
The system was run out-of-sample and produced a CAR of 3.98% with a maximum drawdown of -
6.84% from 122 trades. The equity curve for the OOS period is shown below:
Comments
Test two performed better in the out-of-sample period than in the in-sample period albeit with fewer
trades. There may be some potential for development by adding extra rules and experimenting with
different levels of risk. Again, the E-Mini might not be the best contract to test. Maybe a
commodity such as gold or crude oil would do better.
Test Three
In our final test, we are going to return to the rules shown in test one but we are going to test them on
stocks from the S&P 100 universe and we will not be using any margin. Instead, we will use a starting
capital of $100,000 and allocate 20% of capital to each trade.
This time, whenever a stock opens below the first support, we will buy on the open with 20% of our
capital and sell on the close. Commissions are set at $0.01 per share and only 1 trade can be made at
a time. Some extra conditions are used for liquidity purposes.
Test three rules:
• If a stock opens below it’s pivot buy on the open and sell on the close
• Universe: S&P 100 including historical constituents
• Position size = 20%
• Starting capital = $100,000
• Portfolio size = 1
• Liquidity rule = open price is greater than $1
• Liquidity rule = 25-day average volume is greater than 100000
• Commissions = $0.01 per share
Test three results:
Running the test between 1/1/2002 and 1/1/2014, returned the following results and equity curve:
Here is the out-of-sample equity curve for 1/1/2014 – 5/1/2015:
The best performing trade in-sample was Amazon $AMZN which was bought on the 23rd October
2008 (trade shown by the green arrow):
Comments
The results from test three show potential for further development, which could come in the form of
longer holding periods, improved ranking mechanism, adding a market timing filter, additional
complexity and different position sizing.
The results suggest that trading individual stocks might be easier than trading futures contracts such
as the E-Mini and this could be because individual stocks are likely to be less efficient than high
volume futures markets.
Conclusion & Criticisms
So far, there has been limited stress-testing applied to these trading ideas. Monte-carlo analysis would
be beneficial and we should also test more stringent slippage.
A Warning!
By making some adjustments to position sizing on strategy three it is possible to get some
extraordinary returns (50%-70% CAR with only minor drawdown) but be warned.
The problem with test three is that it relies on getting accurate price fills on the open, which is not
always an easy task. Bid/Ask spreads often widen on the open so (depending on the liquidity of the
stock) it is necessary to increase slippage estimates. In order to do so, I recommend setting
commissions from 0.2% or 0.5% up to 1% per trade and re-running the system.
Unfortunately, estimating the correct amount of slippage to use is not an easy task since bid/ask
spreads change throughout the day, as liquidity increases and decreases. For some high volume
stocks, the spread can be as low as 0.05% each way but for others (such as penny stocks) it can be as
high as 20%!
So when you test strategies like this, make a note of the bid/ask spreads and make sure you have
realistic assumptions about the stocks you plan to trade and the likely slippage you will face.
My advice would be to be conservative with slippage estimates and also, use some discretion when
taking signals. If a stock opens below S2 on some very bad news, then you’re probably better off
ignoring the signal. On the upper hand, if it opens lower than S2 for no apparent reason, that might be
a good signal to take.
Scan pre-market
Also, where test three is concerned, you need to be able to scan for entries from a broad number of
stocks, right on the open. Looking for setups in the pre-market and executing them with a MOO order
is a consideration which might be worth further investigation and this is something that may be possible
with the scanning tools at Interactive Brokers.
Rounding up
Overall, the main point of this article was to introduce some ideas about how to trade intraday using
EOD data and I hope I have stirred your imagination a little.
There are hundreds more ideas that could be tested. Such as using the previous day’s bottom
Bollinger Band as a level to buy. Or perhaps the previous day’s moving average level.
Or, we could try a trend following system by specifying our intraday buy price as the high of x number
of bars ago. If you happen to try any such ideas yourself, please let me know in the comments.
Disclaimer: Past performance is no guarantee of future returns, you should do
your own due diligence. No responsibility shall be taken for errors,
miscalculations or trading losses. Please read the full disclaimer.
System Code:
// Strategy 2
// Remember to set realistic commissions in the Automatic Analysis
window // For &ES set tick size as 0.25 and point value as $50 in symbol
information ////////////////////////////////////////// © jbmarwood.com //
// pivot levels //
//////////////////////////////////////////
SetOption( "InitialEquity", 100000); // Start with USD 100000//
SetTradeDelays( 0, 0, 0, 0 ); // Trade delays applied with REF function//
MarginDeposit = 8375;
NumContracts = 1;
PositionSize = NumContracts * MarginDeposit;
SetOption( "AllowSameBarExit", true );
//* Trading rules
p = pivot = Ref((High+Low+Close)/3,-1);
h1 = Ref(H,-1);
l1 = Ref(L,-1);
r1 = p + (p-L1);
s1 = p - (H1-p);
r2 = p + (H1 - L1);
s2 = p - (H1-L1);
r3 = H1 + 2*(p-L1);
s3 = L1 - 2*(H1-p);
Buy = O<p AND O>s2;
Sell = C;
S3price = round(s3);
BuyPrice = O;
SellPrice = IIf(L<=s3,s3price,c);
// Strategy 3
// Remember to set realistic commissions in the Automatic Analysis window (eg. 0.2%, 0.5%/
trade)
////////////////////////////////////////// © jbmarwood.com //
// pivot levels //
SetOption( "InitialEquity", 100000);
SetOption( "MinShares", 0.01 );
SetOption( "MarginRequirement", 100);
Numberpositions = 5;
SetOption("Maxopenpositions",numberpositions);
SetPositionSize( 1, spsShares );
PositionSize = -100/5;
PositionScore= 100*Ref(RSI(14),-1);
SetOption( "AllowSameBarExit", true );
//* Amendment for delisted securities
Delisting = GetFnData("DelistingDate");
ThisIsLastBar = BarIndex() == LastValue( BarIndex() );
ExitLastBar = datetime() >= GetFnData("DelistingDate");
Cond = IIf( IsNull(delisting), 1, DateTime() < delisting);
//* Liquidity
Liquid = Openint>1 AND Open >1 AND Ref(MA(V,25)>100000,-1);
//* Trading rules
P = pivot = Ref((High+Low+Close)/3,-1);
h1 = Ref(H,-1);
l1 = Ref(L,-1);
c1 = Ref(C,-1);
r1 = p + (p-L1);
s1 = p - (H1-p);
r2 = p + (H1 - L1);
s2 = p - (H1-L1);
r3 = H1 + 2*(p-L1);
s3 = L1 - 2*(H1-p);
//* Trading rules
Buy = O<S2 AND liquid AND cond;
Sell = C OR thisislastbar OR exitlastbar;
BuyPrice = o;
SellPrice = c;

Más contenido relacionado

Último

Último (20)

Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...
Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...
Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...
 
Significant AI Trends for the Financial Industry in 2024 and How to Utilize Them
Significant AI Trends for the Financial Industry in 2024 and How to Utilize ThemSignificant AI Trends for the Financial Industry in 2024 and How to Utilize Them
Significant AI Trends for the Financial Industry in 2024 and How to Utilize Them
 
7 tips trading Deriv Accumulator Options
7 tips trading Deriv Accumulator Options7 tips trading Deriv Accumulator Options
7 tips trading Deriv Accumulator Options
 
Call Girls in Benson Town / 8250092165 Genuine Call girls with real Photos an...
Call Girls in Benson Town / 8250092165 Genuine Call girls with real Photos an...Call Girls in Benson Town / 8250092165 Genuine Call girls with real Photos an...
Call Girls in Benson Town / 8250092165 Genuine Call girls with real Photos an...
 
Certified Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil ba...
Certified Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil ba...Certified Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil ba...
Certified Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil ba...
 
W.D. Gann Theory Complete Information.pdf
W.D. Gann Theory Complete Information.pdfW.D. Gann Theory Complete Information.pdf
W.D. Gann Theory Complete Information.pdf
 
Benefits & Risk Of Stock Loans
Benefits & Risk Of Stock LoansBenefits & Risk Of Stock Loans
Benefits & Risk Of Stock Loans
 
Mahendragarh Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
Mahendragarh Escorts 🥰 8617370543 Call Girls Offer VIP Hot GirlsMahendragarh Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
Mahendragarh Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
 
In Sharjah ௵(+971)558539980 *_௵abortion pills now available.
In Sharjah ௵(+971)558539980 *_௵abortion pills now available.In Sharjah ௵(+971)558539980 *_௵abortion pills now available.
In Sharjah ௵(+971)558539980 *_௵abortion pills now available.
 
20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...
20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...
20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...
 
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...
 
Explore Dual Citizenship in Africa | Citizenship Benefits & Requirements
Explore Dual Citizenship in Africa | Citizenship Benefits & RequirementsExplore Dual Citizenship in Africa | Citizenship Benefits & Requirements
Explore Dual Citizenship in Africa | Citizenship Benefits & Requirements
 
Kurla Capable Call Girls ,07506202331, Sion Affordable Call Girls
Kurla Capable Call Girls ,07506202331, Sion Affordable Call GirlsKurla Capable Call Girls ,07506202331, Sion Affordable Call Girls
Kurla Capable Call Girls ,07506202331, Sion Affordable Call Girls
 
Webinar on E-Invoicing for Fintech Belgium
Webinar on E-Invoicing for Fintech BelgiumWebinar on E-Invoicing for Fintech Belgium
Webinar on E-Invoicing for Fintech Belgium
 
falcon-invoice-discounting-unlocking-prime-investment-opportunities
falcon-invoice-discounting-unlocking-prime-investment-opportunitiesfalcon-invoice-discounting-unlocking-prime-investment-opportunities
falcon-invoice-discounting-unlocking-prime-investment-opportunities
 
Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...
Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...
Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...
 
Q1 2024 Conference Call Presentation vF.pdf
Q1 2024 Conference Call Presentation vF.pdfQ1 2024 Conference Call Presentation vF.pdf
Q1 2024 Conference Call Presentation vF.pdf
 
GIFT City Overview India's Gateway to Global Finance
GIFT City Overview  India's Gateway to Global FinanceGIFT City Overview  India's Gateway to Global Finance
GIFT City Overview India's Gateway to Global Finance
 
Technology industry / Finnish economic outlook
Technology industry / Finnish economic outlookTechnology industry / Finnish economic outlook
Technology industry / Finnish economic outlook
 
2999,Vashi Fantastic Ellete Call Girls📞📞9833754194 CBD Belapur Genuine Call G...
2999,Vashi Fantastic Ellete Call Girls📞📞9833754194 CBD Belapur Genuine Call G...2999,Vashi Fantastic Ellete Call Girls📞📞9833754194 CBD Belapur Genuine Call G...
2999,Vashi Fantastic Ellete Call Girls📞📞9833754194 CBD Belapur Genuine Call G...
 

Destacado

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 

Destacado (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Intraday Trading Systems & Pivot Points From jbmarwood.com

  • 1. Intraday Trading Systems With End Of Day Data: Pivot Points Study jbmarwood.com/intraday-trading-systems May 9, 2015 by JB Marwood This article looks at a couple of intraday trading system ideas using End-of-Day price data and pivot points. Readers will be aware that I use Amibroker and Norgate Premium Data to construct trading systems and test trading ideas. This data is EOD (end-of-day) which means it contains just the open, high, low, and close prices for each full trading day. In other words, the data does not include any intraday price quotes, not even at the hourly level. This data is thus perfect for medium-long term trading systems but it is perfectly useless for short-term trading. …Or is it? You see, even though we don’t have any intraday price quotes, it is still possible to test some interesting short-term trading ideas. Let’s see how. Intraday Trading Systems With EOD Data For quite a long time, I failed to realise that just because we don’t have intraday quotes doesn’t mean we can’t test some short-term ideas. We have the open, high, low, and close prices available. We are therefore able to buy on the open and sell on the close; a short-term trading idea in itself. We are also able to trade on the close and sell on the open, an overnight trading idea. So let’s look at some more creative ideas for intraday trading. Pivot Points Pivot points are pre-determined levels that many day traders look at to help make trade decisions. They are calculated using the previous day’s price range and consist of the main pivot level, then three support and three resistance levels, placed below and above the pivot respectively.
  • 2. You can read more about pivots and how they are calculated here. But essentially, pivots are key intraday levels that many traders take notice of. Since pivots are calculated using the previous day’s price action we can use them to test some interesting ideas. Test One In test one, we take EOD data for the E-mini S&P 500 futures contract (referred to as ‘&ES’ by Premium Data) and we buy the market whenever it opens below it’s pivot. We sell on the close. To keep things simple we will use a fixed position size of 1 contract. Point value is set at $50, commission is set at $15 per trade and starting capital is $100,000. (For more information about setting up back-tests for futures using Amibroker see here). Test one rules: • If @ES opens below it’s pivot, buy on the open & sell on the close • Position size = 1 contract, fixed Following is the code used to calculate the pivot levels: P = Pivot = Ref((High+Low+Close)/3,- 1); P1 = Ref(H,-1); L1 = Ref(L,-1); R1 = P + (p-L1); S1 = P - (H1-p); R2 = P + (H1 - L1); S2 = P - (H1-L1); R3 = H1 + 2*(P-L1); S3 = L1 - 2*(H1-P); Test one results: As you can see, running this system between 1/1/2002 and 1/1/2014 produced a compounded annual return of 1.98% with a maximum drawdown of -18.87% over 1329 trades.
  • 3. The win ratio is adequate but the CAR/MDD ratio is not particularly attractive. I then decided to test some other variations of pivots using the same settings. The results are shown below: For example, line three buys the E-Mini when it opens below the second support and produced a CAR of 0.21%. As you can see, the best performance came from the original test (open < pivot). So I ran the system in the out-of-sample period between 1/1/2014 and 5/1/2015. The results are shown in the final line of the table above and the equity curve is shown below:
  • 4. Comments Buying the market when the market opens under the pivot and selling on the close was the best performing variable. There may be some potential for development by introducing longer holding times, a market filter, or adding extra rules and complexity. Using (optimistic) commissions of $15 per trade, it is hard to find a simple trading system that works well for the E-Mini future. The E-Mini is a particularly tight market to trade and traders might have more success with more volatile instruments such as the Dow Jones Average, Nasdaq, FTSE 100 or DAX. Test Two In test two, we are going to use the same settings as test one and stick with the E-Mini. This time we are going to buy the index on the open, so long as the open is lower than the pivot AND higher than the second support. If the market touches the third support we will sell at that level, if not, we will sell on the close. Test two rules: • If @ES opens between the pivot and second support buy on the open • If the market trades at or below S3, exit at S3. Otherwise exit on the close • Position size = 1 contract, fixed To set this up correctly I used the below formula. The S3 sell price was rounded to the nearest integer since the E-Mini has a tick size of 0.25. There is probably a better way to do it. Buy = O<P AND O>S2; Sell = C; S3price = round(S3); BuyPrice = O; SellPrice = IIf(L<=S3,S3price,C); Test two results Running the test on the E-Mini between 1/1/2002 and 1/1/2014 returned a CAR of 1.63% with a maximum drawdown of -21.79%% from 1318 trades.
  • 5. The system was run out-of-sample and produced a CAR of 3.98% with a maximum drawdown of - 6.84% from 122 trades. The equity curve for the OOS period is shown below: Comments Test two performed better in the out-of-sample period than in the in-sample period albeit with fewer trades. There may be some potential for development by adding extra rules and experimenting with different levels of risk. Again, the E-Mini might not be the best contract to test. Maybe a commodity such as gold or crude oil would do better. Test Three In our final test, we are going to return to the rules shown in test one but we are going to test them on stocks from the S&P 100 universe and we will not be using any margin. Instead, we will use a starting
  • 6. capital of $100,000 and allocate 20% of capital to each trade. This time, whenever a stock opens below the first support, we will buy on the open with 20% of our capital and sell on the close. Commissions are set at $0.01 per share and only 1 trade can be made at a time. Some extra conditions are used for liquidity purposes. Test three rules: • If a stock opens below it’s pivot buy on the open and sell on the close • Universe: S&P 100 including historical constituents • Position size = 20% • Starting capital = $100,000 • Portfolio size = 1 • Liquidity rule = open price is greater than $1 • Liquidity rule = 25-day average volume is greater than 100000 • Commissions = $0.01 per share Test three results: Running the test between 1/1/2002 and 1/1/2014, returned the following results and equity curve: Here is the out-of-sample equity curve for 1/1/2014 – 5/1/2015:
  • 7. The best performing trade in-sample was Amazon $AMZN which was bought on the 23rd October 2008 (trade shown by the green arrow): Comments The results from test three show potential for further development, which could come in the form of longer holding periods, improved ranking mechanism, adding a market timing filter, additional complexity and different position sizing. The results suggest that trading individual stocks might be easier than trading futures contracts such as the E-Mini and this could be because individual stocks are likely to be less efficient than high volume futures markets. Conclusion & Criticisms So far, there has been limited stress-testing applied to these trading ideas. Monte-carlo analysis would be beneficial and we should also test more stringent slippage. A Warning! By making some adjustments to position sizing on strategy three it is possible to get some
  • 8. extraordinary returns (50%-70% CAR with only minor drawdown) but be warned. The problem with test three is that it relies on getting accurate price fills on the open, which is not always an easy task. Bid/Ask spreads often widen on the open so (depending on the liquidity of the stock) it is necessary to increase slippage estimates. In order to do so, I recommend setting commissions from 0.2% or 0.5% up to 1% per trade and re-running the system. Unfortunately, estimating the correct amount of slippage to use is not an easy task since bid/ask spreads change throughout the day, as liquidity increases and decreases. For some high volume stocks, the spread can be as low as 0.05% each way but for others (such as penny stocks) it can be as high as 20%! So when you test strategies like this, make a note of the bid/ask spreads and make sure you have realistic assumptions about the stocks you plan to trade and the likely slippage you will face. My advice would be to be conservative with slippage estimates and also, use some discretion when taking signals. If a stock opens below S2 on some very bad news, then you’re probably better off ignoring the signal. On the upper hand, if it opens lower than S2 for no apparent reason, that might be a good signal to take. Scan pre-market Also, where test three is concerned, you need to be able to scan for entries from a broad number of stocks, right on the open. Looking for setups in the pre-market and executing them with a MOO order is a consideration which might be worth further investigation and this is something that may be possible with the scanning tools at Interactive Brokers. Rounding up Overall, the main point of this article was to introduce some ideas about how to trade intraday using EOD data and I hope I have stirred your imagination a little. There are hundreds more ideas that could be tested. Such as using the previous day’s bottom Bollinger Band as a level to buy. Or perhaps the previous day’s moving average level. Or, we could try a trend following system by specifying our intraday buy price as the high of x number of bars ago. If you happen to try any such ideas yourself, please let me know in the comments. Disclaimer: Past performance is no guarantee of future returns, you should do your own due diligence. No responsibility shall be taken for errors, miscalculations or trading losses. Please read the full disclaimer.
  • 9. System Code: // Strategy 2 // Remember to set realistic commissions in the Automatic Analysis window // For &ES set tick size as 0.25 and point value as $50 in symbol information ////////////////////////////////////////// © jbmarwood.com // // pivot levels // ////////////////////////////////////////// SetOption( "InitialEquity", 100000); // Start with USD 100000// SetTradeDelays( 0, 0, 0, 0 ); // Trade delays applied with REF function// MarginDeposit = 8375; NumContracts = 1; PositionSize = NumContracts * MarginDeposit; SetOption( "AllowSameBarExit", true ); //* Trading rules p = pivot = Ref((High+Low+Close)/3,-1); h1 = Ref(H,-1); l1 = Ref(L,-1); r1 = p + (p-L1); s1 = p - (H1-p); r2 = p + (H1 - L1); s2 = p - (H1-L1); r3 = H1 + 2*(p-L1); s3 = L1 - 2*(H1-p); Buy = O<p AND O>s2; Sell = C; S3price = round(s3); BuyPrice = O; SellPrice = IIf(L<=s3,s3price,c);
  • 10. // Strategy 3 // Remember to set realistic commissions in the Automatic Analysis window (eg. 0.2%, 0.5%/ trade) ////////////////////////////////////////// © jbmarwood.com // // pivot levels // SetOption( "InitialEquity", 100000); SetOption( "MinShares", 0.01 ); SetOption( "MarginRequirement", 100); Numberpositions = 5; SetOption("Maxopenpositions",numberpositions); SetPositionSize( 1, spsShares ); PositionSize = -100/5; PositionScore= 100*Ref(RSI(14),-1); SetOption( "AllowSameBarExit", true ); //* Amendment for delisted securities Delisting = GetFnData("DelistingDate"); ThisIsLastBar = BarIndex() == LastValue( BarIndex() ); ExitLastBar = datetime() >= GetFnData("DelistingDate"); Cond = IIf( IsNull(delisting), 1, DateTime() < delisting); //* Liquidity Liquid = Openint>1 AND Open >1 AND Ref(MA(V,25)>100000,-1); //* Trading rules P = pivot = Ref((High+Low+Close)/3,-1); h1 = Ref(H,-1); l1 = Ref(L,-1); c1 = Ref(C,-1); r1 = p + (p-L1); s1 = p - (H1-p); r2 = p + (H1 - L1); s2 = p - (H1-L1); r3 = H1 + 2*(p-L1); s3 = L1 - 2*(H1-p);
  • 11. //* Trading rules Buy = O<S2 AND liquid AND cond; Sell = C OR thisislastbar OR exitlastbar; BuyPrice = o; SellPrice = c;