The following excel file is an example of how to calculate the MACD indicator. This example shows the 5, 13, 6, setting. the MACD is in column N.  Over time I may add more excel indicator examples. As I do they will be most easily found in the right sidebar under the “How to” – “Indicators” category.

MACD example in excel.

How to post your ATS trades in twitter using Excel

As an example, the following Excel script can be used to post your automated trading system trades into twitter via API.  This code can easily be changed to do whatever you want. But in this example it will just be for sending a trade.

Dim symbol As String
Dim Price As String
Dim xml, Username, Password, tweet
Set xml = CreateObject(“MSXML2.XMLHTTP”)
change this to your username in quotes
Username = “yourusername”
‘change this to your password in quotes
Password = “yourpassword”
‘let the symbol variable have the symbol name from your excel sheet
symbol = Workbooks(“yourworkbook.xls”).Worksheets(“yoursheetname”).Range(“a1 or your range”)
‘let the Price variable have the symbol name from your excel sheet
Price = Workbooks(“yourworkbook.xls”).Worksheets(“yoursheetname”).Range(“a2 or your range”)
‘contruct the “tweet” this would create “Just bought a gazillion shares of (whatever $SYMBOL you have in A1) @ (whatever price you have in A2)
tweet = “Just bought a gazillion shares of ” & “$” & symbol & ” @ ” & Price
‘post the tweet
xml.Open “POST”, “http://” & Username & “:” & Password & “” & tweet, False
xml.setRequestHeader “Content-Type”, “content=text/html; charset=iso-8859-1”
Set xml = Nothing
End Sub

If added to an existing excel trading system it may be best to set this to run 20 seconds or so after your actual trade is sent to avoid any interference which can be done as follows

Application.Ontime Now() + timeserial(0, 0, 20), “TWITTER”

Excel Books I recommend

Best Beginner books

1. Excel 2007 Bible – It is important to have one book that just covers excel (not Visual Basic and Macros) so that you don’t unnecessarily use VBA for performing calculations better handled by formulas. The channels and trend lines in my videos of sim trading the ES are formula based not VBA based like most people seem to think. I probably could not have figured it all out without this book.

2. Excel 2007 VBA Programming For Dummies

3. Excel VBA in easy steps by Ed Robinson – By far the best beginner book but often out of stock. It’s only 188 pages but covers a lot of material in a very clear and concise manner. The examples are easy to understand even with no prior programming experience. If you have no prior VBA experience this is a great first book. Barnes and Noble is the publisher. The price on the cover is 9.95, but since it is out of print people are currently selling it used for $50 to $100 :(

4. Excel VBA Macro Programming – If Excel VBA in easy steps is out of stock, this may be a good alternative judging from the reviews. I have not personally used this one though.

Best Intermediate and Advanced books

1. Excel Hacks is filled with original content and examples. I have a lot of Excel books and thought I knew about pretty much everything until I bought this book.

2. Excel 2007 VBA Programmer’s Reference This enormous book should be used for reference. It has a great index so you don’t have to waste time trying to figure out how to do some simple task. If you have used my earnings.xls workbook that automatically downloads stock’s earnings dates, then you have already benefited from this book. I used an example from the 2003 version of this book to learn from!

*Be careful about buying multiple books by the same author because there is a lot of repetition and they often put out practically the same book but with a different co author, book name and Cover!

Excel Based Automated Channels

This is a channel based ES trading system that I programmed in Excel. The channels are drawn using VBA and array forumulas. This is an example of a somewhat complicated system created in excel.