Getting Started In Forex Robots - ROB BOOKER

Transcription

Getting Started in Forex RobotsBy Rob Booker and Wes WaltonVersion 1.01, February 8, 2017WARNINGTrading involves substantial risks. Forex trading is risky, and most traderslose money. Past performance is not necessarily indicative of future results.DOUBLE WARNINGIf you are not good with computers, robots are not a good idea for you. Ifyou are a beginner with basic computer tasks, such as opening programs,installing programs, opening files and folders, downloading files - t henrobots are NOT a good fit for you. We love you - and we do not want you tohave a bad experience. If you are a beginner with computers - take a quickclass on computer basics and then come back to the robots.TRIPLE WARNING!!!Run these robots on a demo account first. Run the robots in an accountthat is COMPLETELY separate from your discretionary trading. Run therobots with a TINY TRADE SIZE at first, because something can go wrong,and you do not want to have huge losses. There is plenty of time toincrease trade size later.RETURN TO TABLE OF CONTENTS RobBooker.com Page 1

TABLE OF CONTENTSClick a link to jump to a section. THE BASICS What is a trading robot? Why trade robots with forex? Is that dangerous? Why would I use a robot? How is a robot made? Is it hard to learn?THE EQUIPMENT What is Metatrader 4? What is a Virtual Private Server? How to set up a VPS at Amazon How to get a free VPS from your brokerHow to login to your VPS with Remote Desktop Connection HOW TO INSTALL A ROBOT Installing a robot Loading a robot onto your chart How to make sure it is “active” and looking for trades Playing around with robot settings HOW TO TEST A ROBOT The MT4 Strategy Tester Data: the Heart and Soul of backtesting How to run a simple test Reading Test ResultsRETURN TO TABLE OF CONTENTS RobBooker.com Page 2

Using the visual mode Optimization Common backtesting problemsTROUBLESHOOTING ROBOT PROBLEMSMy MT4 closed - now what?My server crashedMy MT4 frozeMy robot is not taking any tradesTHE BASICSWhat is a trading robot?A trading robot is a software program. Once the program is installed intoyour trading platform, it can take trades automatically. You can be asleep,working, or spending time with your family and it can take a trade.Robots as “Complete Trading Solutions”Some traders use robots to do ALL of their trading. That’s what I do. I letthe robots run 24/7 and I rarely touch them or intervene. These robots opentrades, manage the open trade, take profit, stop out - everything. I don’thave to touch the computer at all.Robots as “Trading Assistants”RETURN TO TABLE OF CONTENTS RobBooker.com Page 3

Some traders use robots as “trading assistants.” For example, you mightknow that you want to buy the EUR/USD currency pair, but you need to goto work right now. Work is awful. But you need to go to work, because yourfamily likes to eat food and live in a house with a roof.How can you trade the EUR/USD AND go to work?You could use a robot, like our “Trendline Robot.” You just draw a trendlineon the chart, and tell the robot to take a buy trade if price breaks beyondthat trendline. The robot can even send you an email alert that it took thetrade. Then the robot “hands” the management of the trade back to you.Why trade robots with forex? Is that dangerous?All trading is risky. Not just forex.Every kind of trading carries substantial risk. Forex is no different. Forextrading is not a get rich quick scheme. It can be, however, a “get poorquick” scheme. Many people lose money trading forex. In fact, most traderswho trade forex lose money - all of their first account, usually within just afew months.With that said, robots do the following things to help reduce that risk:1) They stop out of trades when they are supposed to (instead ofholding onto a loss forever);2) They do not get worried when they have a few losses in a row;3) They do not skip trades because they “see something on the chartthat makes them doubt the trade”;RETURN TO TABLE OF CONTENTS RobBooker.com Page 4

4) They take profit when they are supposed to;5) They take the entry on the trade when they are supposed to;6) They add to winners if they are supposed to and so on.In other words, a good robot is reliable. It sticks to the trading plan. Mosttraders who lose money do NOT stick to their trading plan. In fact, theytrade like deranged monkeys.I love robots because I can trust them to follow the plan. I cannot alwaystrust myself to follow my plan - so robots are really good for me.Why would I use a robot?I think I answered this above, but to make sure we’re clear:If you have a full time job and cannot watch the charts, the robots are agood idea.If you have a busy life and do not want to sit in front of the computer, therobots are a good idea.If you have been losing money - and trying to make your own discretionarytrades - then robots might be a good idea.If you find that you have a few good trades in a row, and then you take abig loss (over and over), then robots might be a good idea.How is a robot made? Is it hard to learn?The robots we talk about here are “Metatrader Robots.” They are written ina language called “Metaquotes,” or “MQL” for short.RETURN TO TABLE OF CONTENTS RobBooker.com Page 5

A robot built with the Metaquotes language is often called an “ExpertAdvisor.” I have no idea who created that name but I would like to punchthat guy in the face. There is no reason they should have called it an“Expert Advisor.” It’s a trading robot.Here is an example of what the code looks like:// Preliminary processing if( Bars Period MA 2 )// Not enough bars{ Alert ( "Not enough bars in the window. EA doesn't work." );return;// Exit start()} if( Work false) // Critical error{ Alert ( "Critical error. EA doesn't work." );return;// Exit -----------------------I don’t expect you to learn MQL. I don’t know how to program using it. Ifyou want to learn more, here is an online book about the language:https://book.mql4.com/There are thousands and thousands of metaquotes programmers in theworld. The program language is similar to C. I just overheard someone saythat at a cocktail party, and I don’t even know if it’s true.Why do we use Metaquotes?Metaquotes is a hugely popular programming language. It has been usedto build millions of indicators and robots. It is reasonably easy to debug. ItRETURN TO TABLE OF CONTENTS RobBooker.com Page 6

does not require a huge investment of time and money. It does not requireexpensive charts. So we use Metaquotes.You might hear people say that “successful traders don’t use Metaquotes,”and then they will tell you that you should be trading with a Pythonprogram, or Easy Language, or whatever. Tell them to go fly a kite. Youand over 1 million other traders around the world are doing just fine withMetaquotes.THE EQUIPMENTWhat is Metatrader 4? Why do we use it?Metatrader 4 is the world’s most popular forex trading software.MT4 (for short) is free. It is easy to learn and use. It is not the world’s besttrading software. But it is good. It is stable. It works. It is not perfect - but itworks.Every forex broker in the world offers the Metatrader (MT4) platform fortrading. It is easy to load a robot into this software. It is easy to test arobot’s historical performance with this software.Here is what MT4 looks like:RETURN TO TABLE OF CONTENTS RobBooker.com Page 7

I don’t know why I included that picture. I mean, you could have justgoogled, “What does MT4 look like?”How to Install MT4Ask your broker for a download link for Metatrader 4. (Not Metatrader 5 that is the newest version of Metatrader and we do not use it for about 100reasons that do not matter right now).You install Metatrader on a Windows computer. You cannot run Metatraderon a Mac.If you have a Mac: You can run the robots using a “Virtual Private Server”(see more in the next section) to access your Metatrader trading platform.There is a MT4 phone app. Can you use that?Yes, you can use that to monitor your trades. But you cannot use that toload robots or test robots.What if you do not like MT4?RETURN TO TABLE OF CONTENTS RobBooker.com Page 8

Then you should stop reading this guidebook.Where can you get more information on how to use MT4?YouTube is FILLED with lessons (for free) on how to use MT4. I suggestyou start with this trader-guide-intro/And then watch some videos on YouTube.DO NOT INSTALL A GENERIC MT4 PLATFORM!!!You might be tempted to download MT4 from a different broker than yourown, or the MT4 website. DO NOT DO THIS. Download MT4 from thebroker where you are going to do your trading, so that you are familiar withthe way your broker has set up MT4 - this is important, because everybroker will have a slightly different way of handling open orders, runningrobots, and so forth.What is a Virtual Private Server? Why should I use one?A Virtual Private Server (VPS for short) is a Windows computer. It is alwayson, it is managed to protect it from viruses, and you can turn off your homecomputer - and the VPS stays on.This is great because in order to run a robot on MT4, the computer runningMT4 needs to be on all the time. And a VPS can stay on day and night, allthe time, and only needs to be rebooted once a month (if even that).A VPS is going to run robots. It is not going to be used for games, orhomework, or web browsing, and all that garbage.RETURN TO TABLE OF CONTENTS RobBooker.com Page 9

You will be able to access your VPS through a software program named“Remote Desktop Connection” - or other programs that do the same thing.These programs allow you to open a window on your home computer - andthen look at the VPS computer’s desktop. And then you can move yourmouse around, you can type - anything - and you will be using the VPS asif it were right there in front of you. A VPS is another computer, just sittingsomewhere else, that you manage and operate from your home computer.It is “Virtual” because it’s not in your house. It’s a computer sitting in a bigroom, in a company’s server room, somewhere else.It’s “private” because it’s just yours.And it’s called a “server” because it usually runs a version of Windows usedfor Servers.How to set up a VPS at Amazonhttps://www.youtube.com/watch?v zqORpKde29Q This video supposedly shows you how to get Metatrader set up on a freeVPS at Amazon.https://www.youtube.com/watch?v uxF6lmnLgNE And this video does the same, as well.How to get a free VPS from your brokerMany brokers will offer a free virtual private server when you open anaccount. You can also just call and say, “Do you offer a VPS for clients?”RETURN TO TABLE OF CONTENTS RobBooker.com Page 10

Another option is to contact Justin Hertzberg at Forest Park FX. He knowsthe details on free VPS options at almost every forex broker. You cancontact Justin here:http://forestparkfx.comTell him that Rob Booker sent you. He is the one who set up my accounts.How to login to your VPS[coming soon]HOW TO INSTALL A ROBOTInstalling a robotDownload the robot to your computer (or onto your Virtual Private Server /VPS). Remember where you’ve placed the file.Open Metatrader 4. At the top of the left of the menu screen, you shouldsee the world “File”. Click on that.RETURN TO TABLE OF CONTENTS RobBooker.com Page 11

Click on the item “Open Data Folder”.Now open the folder called “MQL4”.Now open the folder called “Experts”.RETURN TO TABLE OF CONTENTS RobBooker.com Page 12

Once the “experts” folder is open, drag the robot file you downloaded - andput it into the “experts” folder. Now your robot is “installed” into MT4.To get the robot to “show up” in your MT4, you must now do the followingsteps:Go to your “Navigator” panel in MT4.Right-click on “Expert Advisors”.Click “Refresh”. Your robot will now show up in MT4.RETURN TO TABLE OF CONTENTS RobBooker.com Page 13

Loading a robot onto your chartTo load a robot onto your chart, drag the robot from the “Navigator” panelonto your chart. To drag the file, hover over it with your mouse, click the leftmouse button, and then drag your mouse onto your chart.After you drag the robot onto your chart, a “settings” window pops up.Close that window for now - we will play around with the settings later.Once the robot is on your chart, you will see the name of the robot in theupper right area of the chart. See where it says “Ultimate Finch of Doomv1.03” at the top right of the chart? That means we loaded the UltimateFinch of Doom robot onto our chart.But that doesn’t mean the robot is running or taking trades.RETURN TO TABLE OF CONTENTS RobBooker.com Page 14

How to make sure it is “active” and looking for tradesYou’ll know your robot is running if you see the “smiley face” on your upperright hand area of the chart. It looks like this:If you do not see that smiley face, then you need to check two things:1) Check the “Auto Trading” button at the top of your MT4 menu, andmake sure it’s green :2) Left-click on the smiley face (or frowny face) on your chart next to thename of the robot. Your robot settings will pop up. Now click on the“common” tab. Make sure that “allow live trading” is checked.RETURN TO TABLE OF CONTENTS RobBooker.com Page 15

If your robot still has a frowny face after you do these two things, call yourbroker. Ask your broker if they allow you to trade with robots (expertadvisors) on your account. If they say “yes,” tell them your platform is givingyou a frowny face no matter what.Playing around with robot settings/inputsEvery robot has “settings”. These are also called “inputs”. These settingscontrol when it opens trades, the trade size, the profit target, and more.WARNING: Before you start playing with new settings, keep a note of (orsave) your favorite settings that you are using right now.To view the settings window, left-click on the smiley (or frowny) face onyour chart.Here is what the “settings/inputs” window looks like.RETURN TO TABLE OF CONTENTS RobBooker.com Page 16

These inputs control what the robot does, and when the robot does it.Don’t get caught up in each of the settings above - I only want to mention afew of them that are universal to all of our robots:1) WARNING: Robot trading carries risks. Most traders lose money(even with robots). Run all robots on a demo account first.2) “Magic”: This is the robot’s “magic number”. You will probably neverneed to change this. This number simply helps the robot rememberwhich trades it took, and can distinguish between its own trades andyour discretionary trades. But I still want to warn you - you shouldseparate your robot and discretionary trading into two accounts.RETURN TO TABLE OF CONTENTS RobBooker.com Page 17

3) “Slippage”: This tells the robot to NOT take a trade if price is slippingin a fast-moving market.4) “Max Spread”: This tells the robot not to take trades if the spreadwidens too far (for example, during news).You can learn about the other settings/inputs when you learn about each ofthe individual robots.For now, just play around with changing the numbers in the settings.NOTE : If your robot is running on your chart, with an open trade, and youopen the settings/inputs window and make changes, y our robot will nowstart to manage the trade with the new settings.HOW TO TEST A ROBOTThe MT4 Strategy TesterMetatrader 4 (MT4) has one of the easiest to use, automated back testingprograms available, and it is free with the platform. This back testingprogram is called “Strategy Tester”.Here is what it looks like:RETURN TO TABLE OF CONTENTS RobBooker.com Page 18

Data: the Heart and Soul of backtestingHaving accurate and reliable historical data is critical to back testing. If youdo not have good historical data, your tests can be inaccurate or give highlyskewed results.MT4 makes getting historical data easy, and they even give you anaccuracy score to let you know you are testing with good data. First, youwill need to download the data, which you can do by clicking on Tools atthe top menu of your platform, then click on History Center:RETURN TO TABLE OF CONTENTS RobBooker.com Page 19

You should see something like this pop up:RETURN TO TABLE OF CONTENTS RobBooker.com Page 20

Double-Click on the currency pair of your choosing, then double-click onthe 1 Minute timeframe and press “Download” at the bottom of the window.Once the Download is complete, press “Close” and you are ready to test!It is usually best to run your tests in a demo-trading platform from yourbroker, which is SEPARATE from your live trading account.How to run a simple testOnce you have downloaded data, you are ready to start testing!Open Strategy Tester (See “ The MT4 Strategy Tester ” section above)Step 1: Choose the robot you plan to test:Step 2: Select the Symbol for the test:RETURN TO TABLE OF CONTENTS RobBooker.com Page 21

Step 3: Select “Every tick” in the “Mode” dropdown menu:Step 4: Select your date range and use the Check Box to ensure you usethose dates:RETURN TO TABLE OF CONTENTS RobBooker.com Page 22

Step 5: Decide whether or not to use “Visual Mode” (See “ Using the VisualMode ” section below) b ut for now leave it un-checked :Step 6: Choose your timeframe (Period):Step 7: Spread - This step is important. The Spread is the differencebetween the “Bid” and the “Ask” price. For more information about what the“Spread” is, head over to GettingStartedInForex.com , or CLICK HERE .The tester automatically selects “Current” as the default, but you don’t wantthat.If your broker has 5 decimal places on price (for example, 1.12345) thenyou will want to select 30 (for 3 pip spread) or 50 (for 5 pip spread). If yourRETURN TO TABLE OF CONTENTS RobBooker.com Page 23

broker uses 4 decimal places (for example, 1.1234) then you will want toset 3 (for 3 pip spread) or 5 (for 5 pip spread).Step 8: Expert Properties. These are the inputs that you can changewhen you use the robot. You can change them around to find the bestsettings.NOTE: See Optimization for more information about optimizing your robot,ignore it for now.The Expert Properties window should look something like this:RETURN TO TABLE OF CONTENTS RobBooker.com Page 24

Step 9: Start Test - Just press the “Start Button”Step 10: Wait for the test to finish up. When the green bar reaches the end,the test is complete:RETURN TO TABLE OF CONTENTS RobBooker.com Page 25

Step 11: Look at the results (See “ Reading Test Results ” for moreinformation). The Report tab is where you find your test results data:Step 12: Change some settings around in the Expert Properties and try itagain.Reading Test ResultsTesting is one of the most useful (and necessary) things you can do whenstarting out with robotic trading. It helps you get a “feel” for how your robotreacts in certain situations, during certain periods of time, and what settingsyou should use for your live trading. But what do the results mean?RETURN TO TABLE OF CONTENTS RobBooker.com Page 26

This section will take you through the “Report” that shows up AFTER youcomplete a test. These are the 4 MOST important things to look at.NOTE: Good results in testing do NOT guarantee the same results in livetrading, but it should give you a good idea of how the robot performs.Here is the “Report” page:1) Total Net Profit: This is how much you made total after you subtractyour losing trades from your winning trades. G ross profit (all of yourprofitable trades combined) minus the G ross loss (all of yournegative trades combined) equals T otal Net Profit .2) Total Trades: This is the total number of trades your robot tookduring the time period you selected.3) Maximal Drawdown: This is the most important drawdown to look at.This is the total amount of drawdown you got from all trades open atthe same time. If you have 1 trade open that is -

Getting Started in Forex Robots By Rob Booker and Wes Walton Version 1.01, February 8, 2017 WARNING Trading involves substantial risks. Forex trading is risky, and most traders lose money. Past performance is not necessarily indicative of future results. DOUBLE WARNING If you are not go