Systematic Trading from Scratch: How to send the first Automated Order

Need More Help? Book Your FREE Strategy Session With Our Team Today!

We'll help you map out a plan to fix the problems in your trading and get you to the next level. Answer a few questions on our application and then choose a time that works for you.

BOOK YOUR FREE STRATEGY SESSION NOW >>

In today's video we'll show you all the steps needed to trade live with an automated trading system.  

To do this we'll use three software programs that we at Unger Academy use to do systematic trading: TradeStation (great as a datafeed provider), MultiCharts (the platform to create the trading systems and send the orders) and Interactive Brokers TWS (which receives and executes orders). 

In a previous video called "Systematic Trading from Scratch: What Programs To Use and How To Install Them" we showed you how to download and install these software programs on your computer to start trading systematically: Click Here to Watch Part 1

By watching this video you'll learn: 

- How to setup and make TradeStation, MultiCharts and Interactive Brokers TWS communicate with each other

- How to create a simple trading system in MultiCharts

- How to send orders from MultiCharts to Interactive Brokers and make sure they have been executed

 

Enjoy the video!

Transcription

Hey everyone and welcome back! I'm one of the coaches at Unger Academy, and today we're going to be looking at all the steps that are required from a technical viewpoint, and therefore of the infrastructure, to trade on the market automatically from scratch.

Now this is the second part of the video we started last week. For your convenience I'll leave you the link at the top right of the screen.

In that video we started from scratch with a computer that had no software whatsoever for trading. And we ended up with three software that we at Unger Academy usually use to trade: TradeStation, which will serve as our data provider, MultiCharts, which will be the processor of this market data, and finally, the TWS from Interactive Brokers, which will receive the orders from MultiCharts and send them to the market.

So, let’s start here with our Windows desktop. It's no longer empty as it was at the beginning of the first video, but it already has these three software programs installed.

We'll now gradually open them one at a time. Let's start by opening TradeStation.

Obviously all three software will run in administrator mode, so we'll have free access to all the functions of these software. I'll log in with my Username and Password. Let's login.

Live trading or Simulated trading – it doesn't really matter this point. Let's select "Live trading" because this software will only serve to feed the datafeed that we'll then put on MultiCharts.

Ok, so now just for the sake of completeness let's go and open a chart to see if everything's working properly. Perfect. You can see that the chart opens up just fine. Let's try a ticker… for example, the Mini S&P 500.

Perfect, we have the data in real time. Let's now open MultiCharts. And we'll open it in Administrator mode and then log in with the license. We can select "Remember password" so it won't ask us for it again. Perfect.

The two standard workspaces open up but we aren't interested in this. What we have to do now is to connect the first two softwares: TradeStation with MultiCharts.

So we'd like to open a chart in MultiCharts using the TradeStation datafeed. To do this we need Quote Manager, namely this application here which contains all the symbols that MultiCharts has.

For example, let's assume we want to create and send an order to market on the Mini S&P 500 futures index. We create the ticker. Click on "TradeStation". Select "Future". And we'll look for Symbol Root "ES”.

We use, as you can see here, TradeStation connection ok. Select "@ES" future, which is the continuous contract on the future, currently on June 2022.

Let's click on "Add". 

"Instrument added". Perfect.

Once this is done, we can go here and open a chart. This is the little symbol for creating a chart.

Data source: select "TradeStation". Under "Instrument" select "@ES". Let's go and plot the chart. Ok, let's also select 1 minute over the last 80 bars.

Here you'll see "Establishing connection", which means it is requesting data from TradeStation to plot it. The chart has filled up and this is our real-time chart of the Mini S&P 500.

Now, we need to open Interactive Brokers. Let's go on the Trader Workstation. I'll use my paper trading account because I can't use the live account as it's currently running with my systems.

We need to type the login and password of our account.

Let's access the TWS. Okay. Great. Never mind these tickers that are currently in the portfolio.

Now, just as we made the connection between TradeStation and MultiCharts for the datafeed, we need to make the connection between MultiCharts and Interactive Brokers.

While viewing the chart, we can open this "chart trading" and you'll see that at the moment, there is no active broker on this chart. So, we can't really trade now.

To be able to trade we need to connect TWS with MultiCharts, and to do this we need to manage our Broker Profiles.

So select "Manage Broker Profile" and then "Interactive Brokers". As you can see it's currently "Disconnected". Now, just to check, let's see if the connection ports between MultiCharts and Interactive Brokers are set properly. Let's click on "Edit".

Under "General Settings" you can see that the port here is 7 4 9 7. Let's see if we have the same port on TWS. Let's select "API" and then "Settings". The "Socket port" is 7 4 9 7. Perfect, everything fits. I'd like to remind you that in the TWS settings, the "ActiveX and Socket Clients" must be enabled, so we need to give free access to the API to make the TWS work properly via MultiCharts.

The port is the same so we can click on "OK" and then "Connect". Let's also click on "Do not show this message again". And now our broker profile is properly connected.

Once MultiCharts is connected to Interactive Brokers, we need to do the last step, which is to connect the TradeStation chart to the actual contract to be traded.

What does that mean? We now see the chart of the continuous contract of the Mini S&P 500, but I can't trade the continuous contract of the Mini S&P 500.

In fact, to trade this market I must trade the real contract. But where is the real contract? Let's open a new tab and write "ES". Let's look for and select "Futures". The most liquid future at the moment is the June ES, so we'll have to link the chart of the continuous contract with the tradable contract from Interactive Brokers.

To do this we'll use the "Symbol Mapping" settings. Right click on "Interactive Brokers". "Edit Broker Profile" has already been selected. Click on "Symbol Mapping".

What are we going to choose here? You see, we have "Chart Symbol", which is our TradeStation contract, and then "Broker Symbol", which is the one we actually want to use to place orders.

Go to Interactive Brokers. Click on "Add Symbol" to choose the symbol we want to trade. Okay. Select "Future". Let's write "ES" and then "Lookup" and select the June 2022 contract.

June has an "M" symbol. So, search for "ES M2", Globex, which is the reference market. Let's add the instrument. Okay. And we'll look for it in the drop-down menu. Here it is. This is the contract that we're actually going to trade.

Let's adjust the chart symbol, which is exactly that of TradeStation "@ES". Ok, and we're ready.

From here we can go to Interactive Brokers. You see it got my account. We are up and running. And if I were to go and place for example an order on this chart, on the @ES chart which is linked to the tradable ES M 22 contract, we should expect a placed order on the TWS.

Let's say for example this sell limit at 4490.5 points. Click on "Yes". And you see that a sell order has appeared on TWS.

Here it is. If I delete it, the order will automatically be deleted from the TWS.

We're ready. We have connected everything. What's missing? A strategy. Now we're going to see how to quickly code a strategy and then apply it systematically, automatically on our chart.

We'll start by opening the PowerLanguage Editor. This tool can be opened easily from MultiCharts by clicking on this icon.

This is the tool that allows us to write our own strategies. We're going to write one from scratch. Strategies are called "Signal" by MultiCharts, let's call it "Video YT (YouTube Video)".

I'm going to code the strategy in a very simple way indeed. It's now exactly 08:30 on the US market, so this is the bar that will close at 8:30.

For example, we could make a code that opens at 08:45. So we'd write: "if t = 0845 then buy next bar market;".

Then once we enter the market, what can we do? We can add a stop loss, so "set stop loss of $1,000". And then we could also add a profit target. So "set profit target of $2,000".

Perfect, we are done. Nothing else is needed at the moment. So, if it's 08:45 we'll buy at the current market price, so the price quoted at that time, and automatically you'll see that not only will this order be executed, but also two new pending orders will appear: a stop loss and a take profit. Respectively $1,000 below the buy price and $2,000 above the buy price.

We compile the strategy and insert it into our chart. "Insert Signal". We called it "VideoYT (You Tube Video)".

Click on "Okay". All you have to do now is to turn on the automation. This is the place to turn on the automation. So, I'll activate, Interactive Brokers, I say "ok”.

Perfect. Our strategy is on. We just have to wait until 08:45 to see what happens. So, see we'll see in a few minutes.

Here we're back. 25 seconds left on our order. As you can see, I'm not touching anything. I have put MultiCharts here on the left and here on the right you see the tab on pending orders on Interactive Brokers.

So, we'll expect that the executed order and the two new orders of stop loss and take profit will appear in the pending orders. 

Here we are. We've bought the Mini S&P. We've seen that a stop order and a limit order are automatically generated, of $1,000 and $2,000 respectively. We can see it in the Portfolio, look here, in Total Future, what's happening now, so our "Open Profit and Loss".

Our limit and stop orders will remain active to close the position. And so… that's it. We've built our first fully automated trading system and sent an order to the market.

Did you see that? It was just a couple of videos of about ten minutes each.

Obviously, to become able to trade the markets properly you'll need a method. So if you need help to start investing in the markets in a systematic way, then I suggest you click on the link in the description of this video. It's going to take you to a page where you will find some very useful resources, including the possibility of registering for a free presentation by Andrea Unger, or purchasing our book "The Unger Method" by covering only the shipping costs or, why not, perhaps you know, book a call with a member of our team for free strategic advice.

Finally, I would like to remind you to subscribe to our channel and to leave us a Like if you liked this video. Also remember to click on the notification bell to always be updated on the release of all our new videos and our content.

I will see you soon in our new video, bye-bye!

Need More Help? Book Your FREE Strategy Session With Our Team Today!

We'll help you map out a plan to fix the problems in your trading and get you to the next level. Answer a few questions on our application and then choose a time that works for you.

BOOK YOUR FREE STRATEGY SESSION NOW >>
Andrea Unger

Andrea Unger

Andrea Unger here and I help retail traders to improve their trading, scientifically. I went from being a cog in the machine in a multinational company to the only 4-Time World Trading Champion in a little more than 10 years.

I've been a professional trader since 2001 and in 2008 I became World Champion using just 4 automated trading systems. 

In 2015 I founded Unger Academy, where I teach my method of developing effecting trading strategies: a scientific, replicable and universal method, based on numbers and statistics, not hunches, which led me and my students to become Champions again and again.

Now I'm here to help you learn how to develop your own strategies, autonomously. This channel will help you improve your trading, know the markets better, and apply the scientific method to financial markets.

Becoming a trader is harder than you think, but if you have passion, will, and sufficient capital, you'll learn how to code and develop effective strategies, manage risk, and diversify a portfolio of trading systems to greatly improve your chances of becoming successful.