{"id":1203,"date":"2024-01-26T10:47:41","date_gmt":"2024-01-26T10:47:41","guid":{"rendered":"https:\/\/tradeafricahub.com\/?page_id=1203"},"modified":"2024-01-26T10:48:37","modified_gmt":"2024-01-26T10:48:37","slug":"backtesting-a-trading-strategy","status":"publish","type":"page","link":"https:\/\/tradeafricahub.com\/index.php\/backtesting-a-trading-strategy\/","title":{"rendered":"Backtesting a trading strategy"},"content":{"rendered":"\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>There are countless ways of making money in forex. But how can we ensure that our strategy will work in the long run? The truth is that we can never know 100% as markets are ever-changing organisms. The good news is that we can get very close to profitability thanks to backtesting. In this lesson, we will take a look at backtesting basics and show you how you can make the most of it to gain confidence in trading.<\/p>\n\n\n\n<p>Table of Contents<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Guide to forex backtesting \u2013 gain confidence in trading strategy<\/li>\n\n\n\n<li>Types of backtesting<\/li>\n\n\n\n<li>Don\u2019t forget about forward testing<\/li>\n\n\n\n<li>Important backtesting statistics<\/li>\n\n\n\n<li>How many trades should be backtested?<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Guide to forex backtesting \u2013 gain confidence in trading strategy<\/h2>\n\n\n\n<p>One thing connects all professional traders \u2013 they have 100% trust in their trading strategy. If we want to join this elite club of traders, we must know what to expect from our trading strategy. This is quite a complicated task since none of us can see the future, but thanks to the historical data, we can easily see how we would have performed in the past. If we can find out that our trading strategy performed well in the last couple of years, there is a very small chance it won\u2019t work in the future.<\/p>\n\n\n\n<p><strong>So what is backtesting?<\/strong><\/p>\n\n\n\n<p>While we backtest, we put our strategy to the test on historical data. This can be done over the last few months, but we can also go 10 or 20 years back. It all depends on our appetite and how robust we want our backtest to be. Although backtesting can be very time-consuming, it is relatively easy. All we need is a trading platform with enough historical data and a simple Excel sheet where we will document all trades.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Types of backtesting<\/h2>\n\n\n\n<p>There are two types of backtesting, manual and automated.<\/p>\n\n\n\n<p><strong>Manual backtesting<\/strong>&nbsp;is as straight as it gets. We need to open the platform and look daily for valid trading setups we would trade in real-time. After every trade, we log it into our spreadsheet and carry it on. This can be quite a long process; most importantly, we must be 100% true to ourselves. One of the mistakes traders make with backtesting is they try to \u201ccurve-fit\u201d strategy so it would bring a positive expectancy. An example of this can be when the trading setup would present itself in the middle of the night where we won\u2019t be able to execute it, or our Stop Loss would get hit by spread and we completely ignore this fact and register the trade as profitable anyway. We must realize that we are only hurting ourselves by doing this as we will lose money in the live market conditions.<\/p>\n\n\n\n<p>The second type of backtesting is fully&nbsp;<strong>automated<\/strong>. We often need knowledge of some programming language for this type of backtesting. It is mostly Python, MQL or C++. You can also use some third-party online software. A huge&nbsp;advantage&nbsp;of automated backtesting is that it completely removes all the daily emotions and time we need to spend on historical data. The downside of it is that we need to invest quite some time in learning the programming language or understanding third-party online software.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Don\u2019t forget about forward testing<\/h2>\n\n\n\n<p>Another type of testing that is just as important as backtesting, is&nbsp;<strong>forward testing<\/strong>, also called walk forward testing or paper trading. Compared to backtesting, where we look at historical data, in forward testing we use real time market data to test our strategies.<\/p>\n\n\n\n<p>This type of testing is very important, because it allows us to see trading examples as they happen in real time. By doing so, we can eliminate some of the shortcomings that result from backtesting, such as historical bias or curve-fitting, while also being able to observe how our strategy reacts to news and macro data releases.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Important backtesting statistics<\/h2>\n\n\n\n<p>When we are running a backtest, these are the most important statistics we should keep track of.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Time and date of entry<\/li>\n\n\n\n<li>Entry and exit price<\/li>\n\n\n\n<li>Position size and % risk on our trading account<\/li>\n\n\n\n<li>MAE \u2013 maximal adverse excursion<\/li>\n\n\n\n<li>MFE \u2013 maximal favourable excursion<\/li>\n\n\n\n<li>Average RRR ratio<\/li>\n\n\n\n<li>Strike rate<\/li>\n\n\n\n<li>Maximum drawdown<\/li>\n\n\n\n<li>Long\/short ratio<\/li>\n\n\n\n<li>The success rate on different instruments<\/li>\n<\/ul>\n\n\n\n<p>If possible, adding the screenshot to all the trades in our backtest is also good. This way, we can easily come back to it later.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How many trades should be backtested?<\/h2>\n\n\n\n<p>Some traders might test the first ten trades, and if they see their strategy works, they decide it is just enough and give up on further backtesting. This is definitely not a good approach as we don\u2019t have a robust data sample. To be really sure our trading system is stable and robust, we need a sample size of at least 100-200 trades. This way, we will gain much more confidence in our trading. Although trading in the real market is always different from testing the strategy on the demo, we will gain much more confidence knowing that our strategy has a positive expectancy over the long run.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are countless ways of making money in forex. But how can we ensure that our strategy will work in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_themeisle_gutenberg_block_has_review":false,"footnotes":""},"class_list":["post-1203","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Backtesting a trading strategy - TAH<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/tradeafricahub.com\/index.php\/backtesting-a-trading-strategy\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Backtesting a trading strategy - TAH\" \/>\n<meta property=\"og:description\" content=\"There are countless ways of making money in forex. But how can we ensure that our strategy will work in [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/tradeafricahub.com\/index.php\/backtesting-a-trading-strategy\/\" \/>\n<meta property=\"og:site_name\" content=\"TAH\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-26T10:48:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/tradeafricahub.com\/wp-content\/uploads\/2024\/01\/OT133F1w-scaled.jpg?fit=2560%2C1849&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1849\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/tradeafricahub.com\/index.php\/backtesting-a-trading-strategy\/\",\"url\":\"https:\/\/tradeafricahub.com\/index.php\/backtesting-a-trading-strategy\/\",\"name\":\"Backtesting a trading strategy - TAH\",\"isPartOf\":{\"@id\":\"https:\/\/tradeafricahub.com\/#website\"},\"datePublished\":\"2024-01-26T10:47:41+00:00\",\"dateModified\":\"2024-01-26T10:48:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/tradeafricahub.com\/index.php\/backtesting-a-trading-strategy\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/tradeafricahub.com\/index.php\/backtesting-a-trading-strategy\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/tradeafricahub.com\/index.php\/backtesting-a-trading-strategy\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/tradeafricahub.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Backtesting a trading strategy\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/tradeafricahub.com\/#website\",\"url\":\"https:\/\/tradeafricahub.com\/\",\"name\":\"Trade Africa Hub\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/tradeafricahub.com\/#organization\"},\"alternateName\":\"T.A.H\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/tradeafricahub.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/tradeafricahub.com\/#organization\",\"name\":\"Trade Africa Hub\",\"url\":\"https:\/\/tradeafricahub.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tradeafricahub.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/i0.wp.com\/tradeafricahub.com\/wp-content\/uploads\/2025\/05\/cropped-Texture-Watch-Instagram-Post-scaled-1.png?fit=2560%2C2360&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/tradeafricahub.com\/wp-content\/uploads\/2025\/05\/cropped-Texture-Watch-Instagram-Post-scaled-1.png?fit=2560%2C2360&ssl=1\",\"width\":2560,\"height\":2360,\"caption\":\"Trade Africa Hub\"},\"image\":{\"@id\":\"https:\/\/tradeafricahub.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/instagram.com\/tradeafrica.co\",\"https:\/\/wa.me\/254701657815\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Backtesting a trading strategy - TAH","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/tradeafricahub.com\/index.php\/backtesting-a-trading-strategy\/","og_locale":"en_US","og_type":"article","og_title":"Backtesting a trading strategy - TAH","og_description":"There are countless ways of making money in forex. But how can we ensure that our strategy will work in [&hellip;]","og_url":"https:\/\/tradeafricahub.com\/index.php\/backtesting-a-trading-strategy\/","og_site_name":"TAH","article_modified_time":"2024-01-26T10:48:37+00:00","og_image":[{"width":2560,"height":1849,"url":"https:\/\/i0.wp.com\/tradeafricahub.com\/wp-content\/uploads\/2024\/01\/OT133F1w-scaled.jpg?fit=2560%2C1849&ssl=1","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/tradeafricahub.com\/index.php\/backtesting-a-trading-strategy\/","url":"https:\/\/tradeafricahub.com\/index.php\/backtesting-a-trading-strategy\/","name":"Backtesting a trading strategy - TAH","isPartOf":{"@id":"https:\/\/tradeafricahub.com\/#website"},"datePublished":"2024-01-26T10:47:41+00:00","dateModified":"2024-01-26T10:48:37+00:00","breadcrumb":{"@id":"https:\/\/tradeafricahub.com\/index.php\/backtesting-a-trading-strategy\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/tradeafricahub.com\/index.php\/backtesting-a-trading-strategy\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/tradeafricahub.com\/index.php\/backtesting-a-trading-strategy\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/tradeafricahub.com\/"},{"@type":"ListItem","position":2,"name":"Backtesting a trading strategy"}]},{"@type":"WebSite","@id":"https:\/\/tradeafricahub.com\/#website","url":"https:\/\/tradeafricahub.com\/","name":"Trade Africa Hub","description":"","publisher":{"@id":"https:\/\/tradeafricahub.com\/#organization"},"alternateName":"T.A.H","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/tradeafricahub.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/tradeafricahub.com\/#organization","name":"Trade Africa Hub","url":"https:\/\/tradeafricahub.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tradeafricahub.com\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/tradeafricahub.com\/wp-content\/uploads\/2025\/05\/cropped-Texture-Watch-Instagram-Post-scaled-1.png?fit=2560%2C2360&ssl=1","contentUrl":"https:\/\/i0.wp.com\/tradeafricahub.com\/wp-content\/uploads\/2025\/05\/cropped-Texture-Watch-Instagram-Post-scaled-1.png?fit=2560%2C2360&ssl=1","width":2560,"height":2360,"caption":"Trade Africa Hub"},"image":{"@id":"https:\/\/tradeafricahub.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/instagram.com\/tradeafrica.co","https:\/\/wa.me\/254701657815"]}]}},"jetpack-related-posts":[],"jetpack_sharing_enabled":true,"rttpg_featured_image_url":null,"rttpg_author":{"display_name":"Admin","author_link":"https:\/\/tradeafricahub.com\/index.php\/author\/admin_u3leb0t8\/"},"rttpg_comment":0,"rttpg_category":null,"rttpg_excerpt":"There are countless ways of making money in forex. But how can we ensure that our strategy will work in [&hellip;]","_links":{"self":[{"href":"https:\/\/tradeafricahub.com\/index.php\/wp-json\/wp\/v2\/pages\/1203","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tradeafricahub.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/tradeafricahub.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/tradeafricahub.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tradeafricahub.com\/index.php\/wp-json\/wp\/v2\/comments?post=1203"}],"version-history":[{"count":1,"href":"https:\/\/tradeafricahub.com\/index.php\/wp-json\/wp\/v2\/pages\/1203\/revisions"}],"predecessor-version":[{"id":1205,"href":"https:\/\/tradeafricahub.com\/index.php\/wp-json\/wp\/v2\/pages\/1203\/revisions\/1205"}],"wp:attachment":[{"href":"https:\/\/tradeafricahub.com\/index.php\/wp-json\/wp\/v2\/media?parent=1203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}