Automated Trading - Trading Heroes https://www.tradingheroes.com/tag/automated-trading/ Discover Your Grail Trading Strategy Wed, 30 Jul 2025 10:03:40 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.4 https://www.tradingheroes.com/wp-content/uploads/cropped-white-color-32x32.jpg Automated Trading - Trading Heroes https://www.tradingheroes.com/tag/automated-trading/ 32 32 How to Automate Backtesting of a Trading Strategy https://www.tradingheroes.com/automate-backtesting/ Fri, 29 Mar 2024 10:13:37 +0000 https://www.tradingheroes.com/?p=1025107 Learn how to automated backtesting of a trading strategy in any market and on any timeframe. Get the tools, techniques and more.

The post How to Automate Backtesting of a Trading Strategy appeared first on Trading Heroes.

]]>

In my experience, backtesting a trading strategy is an essential step before deploying it in the market.

It allows me to assess how the strategy would have performed in the past, giving me a clearer idea of its potential success in the future.

Manual backtesting is great, but automated backtesting speeds up the process considerably.

There are three ways to automate backtesting of a trading strategy: learn a programming language, use pseudocode software or use no code software. Each one has pros and cons that must be considered when choosing an automated backtesting method. 

So in this article, I'll explain each of the options and how to figure out which one is the best one for you.

Keep in mind that you don't necessarily need to learn programming to do an automated backtest, and this can be done in any trading market where sufficient historical data is available.

I'll also provide links to the best resources that I know of, based on my experience and research.

Let's get into it…

When you buy something through one of the links on our site, we may earn an affiliate commission.

Backtesting in office

Key Takeaways

  • Automated backtesting can be done even if a trader doesn't want to learn how to code.
  • Not all trading strategies can be fully automated. But in those cases, semi-automated backtesting can be extremely helpful.
  • There are many free and paid tools that can help traders of all skill levels get into automation.

Why Backtesting a Trading Strategy is Important

I've written many articles and tutorials on backtesting.

You can find them here.

But if you're new to the idea of backtesting, I'll give you the elevator version of why it's so important.

By utilizing backtesting software, I'm able to simulate years of trading within minutes, allowing me to test multiple strategies against a wide range of market conditions.

The software does the heavy lifting, executing my strategy across the selected time period and accumulating the results for my analysis.

What I look for in the backtest results is not just overall performance, but also how the strategy behaves during different market phases.

Whether the market is trending, ranging, or experiencing high volatility, I need to know that my strategy can handle these conditions.

The insights gained are invaluable.

They either prove that the strategy has a legit edge, or I go back to the drawing board to make improvements.

Why Automated Backtesting?

The bottom line is that automated backtesting helps me speed up the process of creating and optimizing profitable trading strategies. 

I first started backtesting with a simple chart and a spreadsheet.

That was fine in the beginning because there weren't the tools that are available now.

But it would take foreeeever to backtest just one market, even on the daily chart.

When I can automate backtesting, I can speed up that process dramatically and test multiple markets in a fraction of the time.

What many traders also miss is that they can do semi-automated backtesting. 

Since not all trading strategies can be 100% automated, semi-automated backtesting allows me to automate just the entry, for example.

Then I can use discretion to exit the trades.

Any aspect of a trading strategy that can be semi-automated, should be, because it saves a ton of time.

Benefits of Automated Backtesting

Automating the backtesting process offers efficiency and the ability to test numerous strategies across different timeframes and market conditions very quickly.

Many software packages will also provide detailed analytics on each backtest.

This allows me to focus on coming up with ideas and optimizing, instead of figuring out how to get these metrics in a spreadsheet.

The tools available nowadays can make this easy to do.

Limitations of Automated Backtesting

Despite its many benefits, there are limitations to automated backtesting.

One primary challenge is ensuring the historical data used is complete and accurate.

Any gaps or inaccuracies can significantly alter the test results.

There's also the risk of overfitting a strategy to past data, making it less adaptable to future live market conditions.

Another point to consider is simulation limitations, as models may not account for factors like market impact, liquidity, or real-time transaction fees.

Finally, not all trading strategy criteria can be completely programmed into a computer.

The First Step Before Backtesting

Hands writing in journal

Before you start backtesting with one of the solutions below, be sure that you have a trading strategy to test.

This means having a complete trading plan.

You need to have specific parameters for your entries, exits, risk and trade management.

Once you have a strategy to test, now it's time to pick a platform to help you do an automated backtest.

Automated Backtesting Software Tools

Before picking a robust backtesting framework, it's essential to understand your options.

So here are the 3 types of tools that are available, along with some resources in each category.

New solutions are constantly popping up, so use this list as a starting point in your exploration.

I'll update this list as frequently as possible, but it's up to you to find the best solution for your situation.

Learn a Trading-Friendly Programming Language

Trading at computer

To effectively develop and customize a trading algorithm, you must be fluent in a programming language commonly used by traders.

I haven't had the patience to learn a programming language myself, so I'm not an expert in this area.

But I have done quite a bit of research on the topic and here's what you need to know.

Benefits of Programming

  • There are highly mature languages that have been proven to work for trading
  • Many free tools available
  • The ultimate level of customization capabilities
  • You can build reusable blocks of code that you can use for future backtests
  • There is a large library of open source code and tutorials that you can use to get started quickly
  • Can be used in any market where historical data is available

Downsides of Programming

  • It can take time to learn how to code at a level that will allow you to create meaningful backtests
  • Creating simple things like performance graphs usually takes extra time to learn
  • One misplaced semi-colon can break the entire program and take extra time to find and fix

There are 3 programming languages that are frequently used by professional traders:

  • Python
  • R
  • C#

I'll give you a quick summary of each one and where you can go to get more information.

Python Programming Language

Python programming language

I personally know a couple of traders who build their trading strategies with Python.

It emphasizes code readability and allows programmers to express concepts in fewer lines of code compared to other languages.

Python supports multiple programming paradigms, including procedural, object-oriented, and functional programming.

It has a vast standard library and a thriving ecosystem of third-party packages.

Python's interpreted nature facilitates rapid development and debugging, making it popular among both beginners and seasoned developers.

Here are resources that will get you started with programming in Python: 

R Programming Language

R is a programming language and environment that is primarily used for statistical computing and graphics.

Perfect for trading.

It provides a wide variety of statistical and graphical techniques, including linear and nonlinear modeling, time-series analysis, and clustering.

R is open-source and highly extensible, with thousands of packages available for specialized tasks.

It is widely used in academia, research, and industry for data analysis, visualization, and machine learning applications.

R's syntax is designed to make data manipulation and analysis intuitive and efficient, making it a popular choice among statisticians and data scientists.

Here are some resources that will get you started with programming in R: 

C# Programming Language

C# is a versatile, object-oriented programming language developed by Microsoft as part of its .NET framework, designed to be simple, modern, and type-safe.

It's widely used for developing desktop applications, web services, and enterprise software, and it has extensive libraries that facilitate tasks ranging from database interaction to web development.

Traders use C# to program automated backtests by writing algorithms within trading platforms like WealthLab, or QuantConnect, which support C# natively.

They utilize the language's robust features to define trading signals, manage orders, and analyze historical data for performance evaluation.

The backtesting environment provided by these platforms allows for the simulation of trading strategies over past market data to assess their efficacy before live deployment.

Here are some R resources that will get you started with programming in C#: 

Now if programming isn't your cup of tea, then luckily there are other options out there.

Use Pseudocode Software

 

Pseudocode software serves as an intermediary solution between programming and no code software.

It's meant to be a little easier than traditional programming, but still give you more control and customization than the no code route.

There are many built-in shortcuts that are included in each platform, reducing the amount of code needed for each application.

I'm personally not a fan of these solutions either, because they are still too much like programming for my taste.

However, this is useful to some traders who want to automate their backtesting, without learning all the nuances of a true programming language.

So if you don't want to become a full-on programmer, then this might be a happy medium.

Benefits of Pseudocode Software

  • Easier to learn than programming
  • Usually more built in tools for things like graphs and statistical analysis
  • Less code needed when compared to traditional programming

Downsides of Pseudocode Software

  • Platform dependent, so your pseudocode will only work on one platform
  • You may not be able to do everything you can do with a regular programming language, since there isn't the same level of customization available

I've personally used 4 solutions:

  • Pine Script
  • MQL
  • EasyLanguage
  • AFL

Here's a summary of each of them and where to get more information.

The right one for you will depend on the platform you use and the market you trade.

MetaTrader / MQL

MetaTrader 5 website

MQL, or MetaQuotes Language, is a proprietary scripting language for developing trading robots, technical indicators, scripts, and function libraries for use with the MetaTrader software.

MQL4 is used with MetaTrader 4, while MQL5, its successor, offers more advanced capabilities and is used with MetaTrader 5.

Both versions of MQL are specifically designed for automated trading, strategy testing, and financial market analysis.

This is a very popular language that some people might consider a full-on programming language.

In my opinion, it falls more into the category of pseudocode because you don't need to include all of the elements that are required for a normal computer program.

It's fairly complex however, so it does take some time to learn.

Here are some resources that will get you started with MQL: 

TradingView / Pine Script

Pine Script is TradingView's platform-specific scripting language used for creating custom technical analysis indicators and strategies directly within its charting platform.

It's designed to be user friendly, allowing traders with minimal programming experience to design, test, and share their trading ideas and systems.

Pine Script enables the customization of charts and the creation of alerts based on specific trading conditions.

I've created a few custom indicators with Pine Script and it is easier than MQL.

Here are some resources that will get you started with Pine Script: 

TradeStation / EasyLanguage

EasyLanguage is a proprietary programming language used in the TradeStation platform for developing and backtesting trading strategies.

It's designed to be user-friendly and accessible to traders without extensive programming experience.

EasyLanguage allows traders to create custom indicators, strategies, and trading systems using a simplified syntax and built-in functions.

Here are some resources for learning TradeStation's EasyLanguage: 

Amibroker / AmiBroker Formula Language (AFL)

AmiBroker Formula Language (AFL) is a scripting language used in the AmiBroker trading platform to create custom indicators, trading strategies, and analytical tools.

This solution is primarily for stock traders.

AFL allows users to define and manage charts, scan for opportunities, and backtest trading systems with speed and precision.

It's designed to be easy to understand for those familiar with technical analysis and trading concepts, while also being powerful enough to implement complex algorithms.

Here are some resources for learning Amibroker's AFL:

Use No Code Software

Man at beach

No code backtesting software allows traders to test their trading strategies using a visual interface without writing any code, typically by selecting indicators, setting parameters, and defining rules through dropdown menus and form fields.

These platforms often provide a user friendly drag-and-drop or point-and-click environment to facilitate the creation and historical evaluation of trading strategies.

They aim to make backtesting accessible to those without programming skills, while still offering robust analysis and performance metrics.

Benefits of No Code Software

  • Extremely easy to use
  • Can start creating meaningful backtest very quickly
  • Some platforms have a wide range of trading strategy inputs to create many different strategies

Downsides of No Code Software

  • Lack the same level of customization that programming or pseudo coding provides
  • Some platforms are very limited in what they can do

I'll share my experience with 2 platforms, but do your own research because new ones are popping up all the time.

NakedMarkets

Automate backtesting with NakedMarkets

This is my favorite no code platform.

It has a ton of flexibility that I haven't seen before in a no code platform.

I can create fairly complex trading strategy logic with its intuitive drag and drop interface.

You can backtest Forex, stocks, indexes and more.

The detailed analytics suite also provides a ton of data on a backtest that you don't get in other platforms.

Everything can be backtested in the platform, so there's no need to export an EA or plugin to another platform for backtesting.

They are also working on an export feature that will export automated trading strategies to MetaTrader.

Check out the videos and tutorials below to get a feel for what the program can do.

You can also get a discount and a special offer on NakedMarkets here.

Here are some resources for learning NakedMarkets:

EA Builder

EA Builder is an online platform that allows traders to build MetaTrader 4 and 5 Expert Advisors (EAs), and TradeStation strategies, without coding.

The benefit is that the software will export the strategy that you build on the website to a file that you can import into MetaTrader or TradeStation.

I found that this helps a lot with very simple trading strategies.

But once you try to build more complex ones, the platform simply doesn't have the capacity to do that.

So if you're looking for something to build simple strategies and backtest them in MetaTrader or TradeStation, then this could be for you.

However, you should try their free demo first to see if this is a good fit for what you want to do.

Here are some resources for learning EA Builder:

Evaluating Backtesting Results

Automated backtesting results have to be evaluated a little differently than manual backtesting results.

The first thing I look for are potential errors in the logic of the trading strategy.

Since the trades are being executed automatically, I cannot see the trades in action.

So I have to double check that the trades look correct.

I do this by looking at the trades list and I spot check a few of the executions manually.

If that checks out, then here's what I look at:

  • Profitability: I not only look at the overall profit of the strategy, I also look at how consistent the strategies is on a yearly basis. A strategy can be profitable, but all of that profit could have come from just one month. I like to see steady growth over multiple years.
  • Win / Loss Ratio: I also take note of the win-loss ratio which indicates the proportion of winning trades to losing ones. A low ratio is not necessarily bad if the winners are much bigger than the losers, but I want to see if there is any room for improvement.
  • Drawdown: Understanding the drawdown of a strategy is vital. It involves assessing the largest peak-to-trough decline in my account balance. I calculate the maximum drawdown and if it's too large, it indicates potential high risk, and I should probably adjust my risk management approach.
  • Monte Carlo Simulation: I run a simulation over at least 100 simulations to get a good idea of the maximum potential drawdown.
  • MFE/MAE: These metrics show how much the trades went in my favor or went against me, while the trades were open. This can give me valuable clues as to how to improve the strategy.
  • Risk of Ruin: This shows my chances of blowing out an account with a strategy. I want the risk of a huge loss to be fairly low. Other traders can tolerate a more risky strategy.
  • In and Out of Sample Data: It helps to test a strategy with only part of the historical data, then test the optimized strategy with the rest of the data. If the strategy works well with both data sets, then the strategy is more robust and probably more reliable.
  • Time of Day or Day of the Week Analysis: I look at how profitable certain days are, or how profitable certain hours of the day are, if I'm testing a day trading strategy. This will show me if I might want to stop trading certain days of the week or hours of the day.

The reality of backtesting is that most trading strategies won't be profitable enough to trade with real money. 

But by reviewing the metrics above, I can potentially spot ways to turn a failed strategy into a profitable one. 

I can also potentially make a profitable strategy even more profitable.

Final Thoughts on How to Automate Backtesting

Automated backtesting can take your backtesting process to the next level by allowing you to test a ton of ideas in a very short amount of time.

In addition, you can leverage semi-automated backtesting to test specific aspects of a trading strategy, if the entire strategy cannot be automated.

The technology nowadays is quite good, so I feel that all traders should at least do some automated backtesting because it's so easy and fast.

So if automated backtesting appeals to you, take the time to learn your preferred platform.

It's one of the greatest skills that you can have as a trader.

 

The post How to Automate Backtesting of a Trading Strategy appeared first on Trading Heroes.

]]>
How to Use Strategy Tester in MT5 to Backtest EAs https://www.tradingheroes.com/how-to-use-strategy-tester-mt5/ Fri, 03 Jul 2020 09:04:52 +0000 https://www.tradingheroes.com/?p=1019867 Get the step-by-step guide to using MetaTrader 5 for automated backtesting. Learn how to install EAs, adjust settings, troubleshoot problems and get reports.

The post How to Use Strategy Tester in MT5 to Backtest EAs appeared first on Trading Heroes.

]]>

One of the best parts of MetaTrader 5 is that you can program automated trading strategies, called Expert Advisors (EAs), with the MQL5 programming language. Then you can test your strategies in the MT5 Strategy Tester.

Many traders use EAs to create fully automated trading strategies. However, EAs can also be used by discretionary traders to test new ideas, or in Incremental Automation.

Regardless if you go fully or partially automated, this post will show you how to get started with the MT5 Strategy Tester.

I'll show you how to install .ex5 and .mq5 files, how to do your first test, and how to find a MT5 programmer, if you don't know how to code.

Trading Computer

The Difference Between .MQ5 and .EX5 Files

Let's start by taking a look at the two types of files that can you can install in MT5.

There are two different types of files because there is one file that humans can read and one file that that MetaTrader can read.

The file that human programmers can read (the .mq5 file) is not very efficient, so it's converted into a version that the computer can use efficiently (the .ex5 file). These files are also known by the following names:

  • .ex5 = compiled, program or executable file
  • .mq5 = source code file

When you add a .mq5 file to MT5, it will automatically be converted to a .ex5 file, when you open MT5. 

If you purchase an EA on the internet, it will usually come in .ex5 format. This is because EA developers want to protect their hard work.

The .ex5 file hides their programming and doesn't allow others to see how it works.

However, if you create an EA yourself, or you work with a programmer to create an EA from scratch, the EA will be in .mq5 format.

Before working with a programmer, be sure that they will give you the .mq5 file. Having this file will allow you to make changes to your EA in the future.

How to Install an Expert Advisor in MT5

In order to start using Strategy Tester in MetaTrader 5, open MT5, then go to: File > Open Data Folder.

You can also hit Ctrl+Shift+D on your keyboard.

Open data folder

Once the folder is open, go to: MQL5 > Experts.

Then drag your MT5 Expert Advisor into the folder. The EA can either be in .ex5 or .mq5 format.

add EA

After the file has been moved, then restart MT5. You're now ready to start testing your EA in Strategy Tester.

How to Use Strategy Tester

Set Up Your Test

When MT5 restarts, go to: View > Strategy Tester. You can also press Ctrl-R on your keyboard to open Strategy Tester.

It will appear in a window at the bottom of your screen.

Strategy Tester MT5

Here's what the settings do. They are listed in the order that they appear on the screen.

  • Expert: Select the Expert Advisor you want to test from the dropdown.
  • Symbol: Select the symbol you want to backtest.
  • Timeframe: Select the timeframe you want to backtest.
  • Dollar sign icon: Click on this icon to get details of the symbol selected.
  • Date: Select the preset date ranges.
    • Entire history
    • Last month
    • Last year
    • Custom period
  • First date dropdown: If you select Custom period, select the starting date of your test.
  • Second date dropdown: If you select Custom period, select the ending date of your test.
  • Forward: This allows you to do forward testing of your trading strategy. MT5 will split your data into 2 parts and only do optimization on the first part. Then it will test the optimized settings on the second part of the data. If you get similar results with both sets of data, then there's a higher probability that the settings are reliable and not subject to curve fitting. When forward testing is activated, you will see an additional tab that shows the forward testing results.
    • No: Forward testing not used.
    • 1/2: Half of the time period is used for the forward test.
    • 1/3: One third of the time period is used for the forward test.
    • 1/4: One fourth of the time period is used for the forward test.
    • Custom: Use the dropdown to specify the first date of the forward test.
  • Delays: You can select from several delay times to simulate delays between the time that MT5 gets a trade signal and the time the trade actually gets executed. This is useful if the connection to your broker is slow.
  • “Select delay…” Button: This can be used to include other factors that might affect profitability like slippage, non-tradable time periods, margin and commissions.
  • Modeling: You can select how ticks are generated. You can find more information on that here (it's pretty complex).
  • Deposit: Adjust your initial deposit and deposit currency.
  • Leverage: Choose the leverage you'll be using in live trading.
  • Optimization: Choose the algorithm type you want to use. There are different ways that you can optimize your EA by having MT5 run through a series of values for each of your settings until it finds the best setting. Select the inputs you would like to optimize on the Inputs tab. You can read more about optimization here.

Start Your First Test

Once you've setup the test, click the green Start button. If you've checked the “visual mode…” box, the Strategy Tester Visualization window will open and show you the backtesting trades on the chart.

Use the slider to increase or decrease the speed of the test. This will allow you to watch your trades and see if your EA is working as you expected.

Visualization

If you didn't check the “visual mode…” box then the test will run without seeing the trades on a chart. The best way to see the progress of your backtest is to flip to the Graph tab.

That will allow you to see live update of your equity and account balance.

Equity graph

Review Your Results

Once your test has completed, it's time to review your results. Go to the Backtest tab to see the stats on your test.

Backtest results

Where to Get MetaTrader 5 Expert Advisors

There are many ways to get a MT5 EA, but here are a few good places to start.

There are also many other websites that sell EAs and some offer free EAs for download.

If you have an idea for a trading system or EA, you can also create your own EAs.

How to Find a MT5 Programmer

The good news is that you don't have to learn programming…if you don't want to. You simply have to explain your strategy to a programmer and have them create the EA for you. 

I created a list of Forex programmers here. Talk to them and see if any of them are a good fit.

Be sure to read the guide in the beginning to find the best programmer for you.

Learn to Program Yourself

If you would like to learn MQL5 programming, then start with the official MQL5 docs.

The best way to learn programming is to choose a simple project, then learn through trial and error.

For example, you could start off by programming a simple EA that opens a long trade when price closes above a moving average and closes the trade when price closes below the moving average.

…and the opposite for short trades.

It also helps to find free code on the internet, study how it works and make simple changes to the code. You might have to spend a couple of weeks learning how to code, but it can really pay off.

When you can code for yourself, you can test trading ideas, without paying for a developer to create the EA for you.

Conclusion

A final word of caution. Be sure to check, and double check every EA you install.

There can be bugs in the programming, which can have disastrous results. Even if you run an EA through the Strategy Tester, the results in live trading can be different.

So even if an EA does well in backtesting, always test it in a demo account for a few months before you put it into live trading. 

But all of that testing can be worth it, if you can find an EA that will help you make profits while you're away from your computer.

The post How to Use Strategy Tester in MT5 to Backtest EAs appeared first on Trading Heroes.

]]>
5 Steps to a Rule-Based Trading System That Works https://www.tradingheroes.com/rule-based-trading-system/ Mon, 02 Mar 2020 12:44:44 +0000 https://www.tradingheroes.com/?p=1019157 Learn if a rule-based trading system is for you and how to create one that matches your personality. Also learn to avoid the common pitfalls with this type of trading.

The post 5 Steps to a Rule-Based Trading System That Works appeared first on Trading Heroes.

]]>

This type of trading system is very appealing to some traders because it can take a lot of the emotion out of trading. If you find that you are too emotional when you are trading, then this type of trading might be for you.

A rule-based trading system has strictly defined rules for all components of a trade. A trader is not allowed to deviate from the rules. The basic rules cover: entry criteria, lot sizing, maximum trade risk, trade management, maximum portfolio risk and exit criteria. 

There are basically three types of rule-based systems:

  1. 100% automated strategies
  2. Manual trade management strategies
  3. A mixture of both automated and manual elements (Incremental Automation)

Regardless of which one you choose to use, this guide will show you how to create a system that works for you. 

Step 1: Understand What Works With Your Personality

Trading personality

This is a really important step, so don't overlook it.

Many new traders think that they don't have to worry about system/personality fit because they just have to follow the rules of a system and they will make money.

Nothing could be further from the truth.

Even if you have black and white rules, you still have to consider how you will react to the results.

You could have a very profitable system, but if you cannot tolerate certain aspects of the system, you will give up on it.

Let's take a look at the primary elements that you should be aware of.

What Are Your Goals?

The first thing you should consider are your goals for the trading system. 

Do you want to multiply a small account? Or do you want to make a steady income on a larger account?

These are very important questions to ask yourself when you are getting started. 

Your answer to this question will determine the type of system you will create.

It helps to write down a yearly goal that you will be shooting for.

Some traders want to make 10,000% in a year (yes, they are serious). But in reality, 30% a year, with a decent sized account would be more than enough to meet their desires…with a lot less stress.

So take a realistic look at what you really want to get out of your trading system. 

Write down your goals in your trading plan. 

Drawdown

A lot of traders want to make the big bucks. But big profits usually also means big drawdowns.  

Can you handle that?

Some traders can.

However, in my experience, most traders can't.

So pay attention to your drawdown numbers. A 40% drawdown might not be a big deal when you are demo trading. But the psychology can change dramatically when real money is on the line.

If you have a hard time feeling the emotional impact of a drawdown in a demo account, open a small real money account and use nano lots.

You may find that you are willing to tolerate a higher or lower drawdown than you expected. That's why it's important to test different types of trading systems to find out what works best for you.

Trading Frequency

Next, it's important to understand how frequently your strategy trades and how you feel about that frequency. 

For example, let's say that your strategy only executes a few trades a month. But when it does trade, there's a high probability of success and you usually have a few big winners because you trail your stop loss.

That sounds great right?

Well, that actually sounds terrible to some traders. These traders get bored easily and want to be trading more frequently.

The opposite can also be true.

If a system executes too many trades, some traders get stressed out about having to trade all the time, or having too many trades open at once.

So take some time to consider your optimal trading frequency. 

It's not the same for everyone. 

Winning Percentage

Are you the type of trader who likes to see a high win rate? Or do you prefer to win less often, but have higher risk multiple returns per trade?

One trader I know of likes to go for 100R trades. But he only wins about 20% of the time. Could you handle 8 losing trades in a row (or more), before you get a winner?

Or would you rather only make 1R, but win 75% of the time?

Both methods are profitable.

There are no right or wrong answers here.

It's all about what you are most comfortable with.

Again, experiment with both to see what you prefer.

Fully Automated, Manual or Both?

Wondering trader

The mechanics of how you enter and exit trades can make a big difference in your trading results.

For example, if your trading system has to be automated in order to be profitable, but you don't know how to program an automated trading strategy, then that strategy won't work for you.

But you can always learn. Take our Beginning MT4 Programming Course by master developer Adam Hartley.

Of course, you can also look for programmer to code it for you. Here's a list of programmers and a guide on how to find the right one.

On the other hand, maybe you don't trust an automated system and would prefer to manage trades yourself. If that's the case, then be sure that you will be able to trade at the times when your trades usually set up.

If your system usually has its best trades at 3:00 am local time, then that probably won't work as a manual system.

This is why backtesting and beta testing are so important. You want to figure out the blind spots in your system so you can compensate accordingly.

Step 2: Create a Written Trading Plan

The next step is to write down your trading rules.

This ensures that you have a solid reference point from which to make all of your trading decisions.

Use any recording method that works for you, but I've found that good ol' pen and paper works best for me. It's just easier to take notes and change things during the development process.

Taking notes on laptop

After I'm done making changes to a system, then I'll put it into Evernote.

If you want a template for your trading plan, you can download a free PDF worksheet here. I find it very useful to print out a bunch of these and leave them near my desk.

When I get an idea, I jot it down so I don't forget. Then I can come back to it later to develop the idea.

A good trading plan should have the following elements:

  • Trading system name
  • Version number
  • Indicators used, with settings
  • Entry criteria
  • Trade management rules
  • Risk rules
  • Re-entry rules
  • Rules for portfolio risk
  • Will this be traded manual, fully automated, or a little of both?

There may be other elements that you want to add later, but that list is a good start.

You can get a trading plan from many sources on the internet. There's no shortage of them, you can get them from courses, forums and blog posts.

See the strategies that we've shared here.

I would also recommend checking out the MQL5 Codebase and TradingView trading strategy communities. They are a big mish-mosh of strategies, with varying levels of quality, but they can give you some good ideas.

You can also look at the code and copy/paste ideas you like. If you find a strategy that actually works, that can be a great starting point for your strategy.

But how do you know if a trading strategy will give you an advantage in the markets?

That's what backtesting is for…

Step 3: Backtest Your Trading Plan Rules

Trader with a headset

Next, it's time to test your plan so you are confident that it will work in real-world trading. If you are new to backtesting, read our free guide here.

There are different ways to backtest and the best method for you will depend on the type of strategy you have.

For example, if you have a fully automated strategy, you may consider testing in something like Forex Tester or MetaTrader 5. These are good platforms to backtest automated Forex strategies on.

If you have a manually executed strategy, Forex Tester, MetaTrader 5 or TradingView are all good platforms to test on.

Your backtesting will give you some key pieces of information:

  • Drawdown
  • Win rate
  • Longest win streak
  • Longest losing streak
  • Best/worst days to trade
  • Best/worst times to trade
  • And more!

If a backtesting platform doesn't give you some of this data, you can always export it to a spreadsheet to figure it out.

Don't expect to hit the jackpot on the first try. A successful backtesting result is almost always the result of many, many experiments.

Successful traders make small tweaks to a strategy and test the results. Remember to only change one thing at a time and test that change.

Otherwise, you won't know which changes worked and which ones didn't.

Once you have a strategy that hits your goals, you are ready to move on.

Step 4: Beta Test Your Rules

After you have tested your strategies and are confident in the results, don't jump into live trading just yet. There's one more step to do before you start risking real moola.

This is called beta testing or forward testing.

You don't want to jump directly into live trading because there are still a few things that you may need to work out.

For example, if you have a fully automated trading strategy that runs on MT5, you should definitely test it in a demo account with the broker that you intend to trade live with.

The broker's spread or server lag may affect how your strategy trades in live conditions. Sometimes the results can be significantly different.

So run this beta test for a few months to be sure that there aren't any other hidden issues with your trading system. Once you are confident it will work as you expect, now it's time to go live!

Step 5: Go Live

Happy trader

Now it's time to put your system into action. I would recommend starting out with a small account or using a smaller amount of risk in the beginning.

There may still be a few unforeseen differences between your broker's live server and the demo server. 

But if it's all good, then let your strategy loose!

Remember to track your trades in a trading journal, so you can review the results every week.

Don't change anything about the system until you have at least 100 trades in the books. It can be tempting to start to mess with the system if it isn't winning right away.

Resist the urge because you may just be in a normal drawdown. You need to give the system time to apply your edge.

Final Thoughts on Rule-Based Trading Systems

A rule-based trading strategy will not take all of the emotion out of trading. For some traders, a very strict trading system can actually lead to more losses because they are not free to take all opportunities that come along.

But for traders who can be indecisive about trading decisions, or prefer to minimize the effect of their emotions, strict rules can be a great way to trade.

The added benefit of a rule based strategy is you can change specific elements of the strategy and see exactly how those changes affect the results.

 

The post 5 Steps to a Rule-Based Trading System That Works appeared first on Trading Heroes.

]]>
How to Get Started With Incremental Automation In Forex Trading https://www.tradingheroes.com/how-to-get-started-with-incremental-automation-in-forex-trading/ https://www.tradingheroes.com/how-to-get-started-with-incremental-automation-in-forex-trading/#comments Tue, 29 Jul 2014 15:18:57 +0000 http://www.tradingheroes.com/?p=8328 Trading automation isn't all or nothing. This post will show you how you can use Incremental Automation to assist your trading, without handing all of your trading over to a scary trading robot. There are ways that almost every trader can benefit from automation.

The post How to Get Started With Incremental Automation In Forex Trading appeared first on Trading Heroes.

]]>

Some traders think that trading automation means that they have to create a trading robot that handles of all of their trading.

It identifies the setup, enters the trade and manages the exits.

This is pretty damn appealing at first and you are probably thinking that this is something that you want to try. I don't blame you, it appealed to me at one point. It still does, to a certain extent.

Making money while you sleep is the ultimate business.

But creating a trading robot is like getting married in Vegas while you are drunk. It always sounds like a good idea in the beginning, but it ends up being much more complicated than you think.

Forex trading robot

When you get down to creating a fully automated robot, it's actually pretty scary. If you don't know programming, you will either have to learn, or put your faith in a developer.

Most people opt for a developer, I sure do.

To find a programmer that fits your needs, and budget, see our guide to finding a great programmer. At the end of the blog post is also a list of programmers that I recommend.

Before you find a developer however, you will need to quantify your trading system so that a computer can understand it. Something that may be obvious to the human eye, may actually be really hard to define to a programmer.

Take pin bars for example:

  • What is the ideal ratio of wick-to-body?
  • How long should the total length of the candle be?
  • Should it be a up or down candle?
  • Where should the pin bar print in relation to previous price action?

…and that's not even getting to the entries and exits yet.

Even if you find the best developer in the world, there can still be bugs that can blow out your entire account.

So a fully automated system should be tested thoroughly before trading it with live money. 

Not The Only Way

While this is one type of trading automation, it is not the only way. Don't get me wrong, fully automated trading can work if you know what you are doing.

Like any other trading method however, it has to fit your personality and skill set. I honestly believe that only a small percentage of traders are cut out to be fully automated.

But what about the rest of us? Is there any way that almost any trader can get the benefits of fully automated trading without having to battle the fully automated beast?

The answer is yes.

I call it Incremental Automation. This post will explore the concept of Incremental Automation in Forex trading.

I will show you how to start simple and take your trading from partially automated, to full automation.

…if fully automated works for you.

The great thing is that even partially automated trading can provide tremendous benefits.

When This Works

This will only work when the method you are trading has defined entry, management or exit signals.

They don't all have to be clearly defined, but the ones that will be automated need to be. Even if you are trading a very discretionary system however, Incremental Automation may still work for you.

Incremental Automation Defined

So what is Incremental Automation and how does it work?

It is simply the process of automating parts of a trading system and adding as many automated components as possible, until you reach the Maximum Automation Point (MAP).

The MAP could just be automating your entry signal with an indicator. You could also have a robot only handle your exits.

The degree to which you automate is up to you and will depend on your trading method.

The Simplest Forms Of Automation

Let's start with a couple of things that you can do right now. The first thing is to create price level alerts.

You can begin by setting an alert when the price of a currency pair hits a historical high or low. These areas can be major turning points in a currency pair.

Since most people use Metatrader, I'll use that as an example. To setup a price level alert in MT4, click on the Terminal icon, then click on the Alerts tab. Then right-click on the alerts window and click Create from the menu.

how to create an alert

Then setup the type of alert that you want and the price at which you want to be alerted. Text message alerts and push notifications are the easiest way to get notified when you are on the go.

Before you start relying on the alert, be sure to test it out. For more information on how this works check out the MQL4 documentation.

Create alert

Many mobile apps also have this capability. Here is what it looks like on the Oanda iPhone app:

oanda alerts

You might forget that limit and stop entry orders are also forms of trading automation. Set your entry levels beforehand and you don't have to worry about watching the trades closely.

The only thing that you do have to worry about is canceling pending orders if they are no longer valid.

Automation Through Indicators

If you need to get more complex alerts, custom indicators are the next step in the Incremental Automation process. They provide you with more flexibility than simple price alerts, but they do not take the extra step of actually executing trades.

This is as far as most independent traders will need to go. Using custom indicators with built-in alerts can greatly reduce the number of trades that you miss.

In order to create your first custom indicator, be sure look around for a programmer who has a good reputation and can create what you need at an affordable price.

MQL4 source code library

You can also look around the MQL4 Source Code Library to see if there are any existing solutions that you can use. Remember to thoroughly test any indicator that you use.

Indicators may not be as dangerous as Expert Advisers because they do not execute trades, but there can still be bugs. Monitor your indicators closely for a few weeks to uncover any flaws.

Automation Through Expert Advisors (EAs)

If you have been able to automate your trading signals, now it might be time to start automating your entries and exits. Just like with the rest of this process, you can choose the degree to which you automate.

You may want to enter trades manually, but have an EA exit the trades for you. Or you might want the EA to manage moving your stop.

Whatever the case may be, EAs do not have to be used to completely automate your trading.

Conclusion

Consider how you can automate pieces of your system and incrementally get to a level of automation that you are comfortable with.

Fully automated trading isn't for everyone.

But you can still benefit from using automation in pieces.

I hope that this post has helped you look at automation a little differently.

When used correctly, it can help you spend less time in front of the screens. It can also help you diversify your trading strategies and trade multiple systems at the same time.

The post How to Get Started With Incremental Automation In Forex Trading appeared first on Trading Heroes.

]]>
https://www.tradingheroes.com/how-to-get-started-with-incremental-automation-in-forex-trading/feed/ 2