The benefits of creating an automated trading system are huge. With a profitable trading robot you can spend more time doing what you enjoy and less time watching screens. You can trade quicker, smarter and without emotion.Unfortunately, the pathway to creating an automated trading robot is a long one. Despite creating a number of useful trading systems in the past I have repeatedly hit a brick wall when it comes to implementing automation.That changed last year when I was introduced to Peter Titus, a professional trader and expert in automation. Peter showed me exactly what I needed. A series of logical steps that took me from beginner to advanced.He taught me how to create algorithmic trading rules and alerts in Excel, how to size trades and how to send them directly to my Interactive Brokers account using the API.In the rest of this article, I have teamed up with Peter to show you the steps needed to create your own trading system in Excel. Peter has also put together a that goes through each step in detail. How To Create Your Own Trading Robot In Excel In 10 Steps 1.
Open an account with Interactive Brokers.Interactive Brokers are the only brokerage which offers an Excel API that allows you to receive market data in Excel as well as send trades from Excel.IB is also the largest US electronic broker offering stock commissions of just $1 and a vast array of markets. If you want to automate your trading, then Interactive Brokers is the best choice.To open an account with Interactive Brokers is straightforward and is open to citizens of most countries around the world. A minimum deposit of USD 10,000 or USD 5,000 for IRA Account is typically required. Download and install the Interactive Brokers Excel API.The API allows the Trader Workstation (TWS) application to talk to Excel and is a prerequisite for building your automated trading system.The API software can be downloaded from the following link:you’ve downloaded the API you can proceed to download IB’s trading platform software Trader Workstation Latest (TWS):Latest is now available for most operating systems, including Windows 64-bit and Mac OS. This and a copy of Excel is the only trading robot software you will need to automate your trading. Think about how you can turn your trading rules into formulas you can use in Excel.If you are already well acquainted with Excel then this step shouldn’t be too difficult but it will involve some careful consideration.It’s important to think about your strategy and visualize what you want it to do.
Automated stock trading with Interactive Brokers About jOpenTrader is a tool that places NYSE and NASDAQ buy/sell orders on market open (via SMART routing) with protective stop loss orders and profit limit orders. Working parameters are read from an input text file.jOpenTrader works on Windows, Mac and Linux. Learn how to connect to Interactive Brokers with NinjaTrader. Save on trades with simple low rates. The marketplace for automated systems.
You don’t want to get sucked into the programming straight away then realise you’ve missed something fundamental and have to start again.It’s a good idea to spend a day or two just thinking about your trading system and how it can be translated to Excel. I recommend plotting everything out on a big sheet of paper before you sit down at the computer.If you’re not used to using Excel, or haven’t used it in a while, then you will want to spend some time getting to grips with it again. Here is a.The course also goes over the essentials covering VBA, sub procedures, macros, loops, IF and OR statements etc. Create and test your formulas.Once you have an idea of what you want to do and what formulas you need, you can start plugging them into Excel and testing them out.Once you have done this a few times you’ll be able to create your own trading rules in Excel from a completely blank work sheet.
With the use of IF and OR statements, formulas and loops, it is possible to make complex trading rules relatively simply.The Ranger 1.0 system developed by Peter contains many formulas and code snippets that you can pull from the spreadsheet, amend and paste into your own system. Build automation to buy and sell when your rules are met.Using the example trading system and template spreadsheets provided on the course, Peter shows how to build in the automation for your buy and sell rules.Doing this on your own with a live account can be a daunting experience but Peter shows live examples of how to do it correctly. When trades are entered, Excel displays their order status and automatically checks for any setup errors.Displaying market data and your trade entries side by side (just as they are in Interactive Brokers) gives you the confidence you need to run your automated trading desk and have Excel do all the heavy lifting. Build time rules to manage the market open, the market close, and any other time of day criteria you have.As you turn your system on and start to log data you will need to specify when to enter trades, how to manage your open positions and when to close them.
The trade session can be separated into three parts; pre-market, the trading day and market close/after hours.Key to this process is the implementation of timers and automated tasks to make sure your trades occur at the right times. Consideration must also be given to implementing stops and carrying positions overnight.
Trade with your simulated account while you debug your code.Before you turn on your automated trading system in the live market, it makes sense to take it for a test drive first.Fortunately, Interactive Brokers allows paper trading accounts which can be used to run the automation and see how the system is performing. It might be a good idea to run your system at a fairly high frequency at first as this will give you more opportunities to analyse performance and debug the code.Once everything starts to look good, you can start analysing the system at it’s natural frequency.Paper trade accounts can be accessed and reset in Interactive Brokers by going into Account Management then Manage Account Settings Paper Trading. Once your automated trading system is running smoothly and is profitable, move it to real money.Once the system is running as you want it to on the simulation account move it to real money and observe how it gets on. This is the exciting part where you’ll hopefully see your automated trading system making profits for your account while you sit back with your cup of tea.When you go live, it pays to start off cautiously at first. Paper accounts can sometimes exaggerate performance for certain strategies because they don’t always accurately simulate slippage or market impact. By starting off small you can observe any difference in performance without risking too much capital.9. Increase your position size the more it wins and decrease it if it starts losing.As you observe your automated trading system in the live market you will soon get an idea of its performance levels.
The better the system does, the more confidence it will give you. You can slowly increase position size and start generating larger profits on your capital.If the system starts performing worse than you’d like, you will want to decrease the position size. Under-performance could be due to changing market conditions or inaccurate simulation in the paper account, or some other reason. If this is the case, consider adjusting your system or using AI techniques to make it more dynamic. Use automation to log all of your trades. Think about ways to optimize or improve your rules and automation.Once your trading system is up and running you have the ability to log all of your trades automatically back into Excel.
This gives you something that is extremely beneficial to algorithmic trading – the ability to analyse, observe and feed improvements back into the system.By doing so you can seamlessly improve your trading system results and further eliminate stress. Using Excel to log the trades, you no longer have an excuse for failing to track your key statistics!