
Build a complete foundation for a robust forex trading and testing system with building blocks for data collection, historical data, web scraping, storage, and analysis.
Discover how forex trading works by exchanging euros and U.S. dollars, and profit from rate movements using leverage, buy and sell prices, pips, and spreads.
Set up the development environment by installing Python 3.6+, creating virtual environments, using Visual Studio Code with extensions, and using Postman for API requests.
Install Python 3.6 or newer on your system and learn how to run the interpreter across Windows, Linux, and macOS. Create a clean environment and avoid Anaconda, especially Windows 7.
Discover how Python virtual environments isolate project libraries, prevent version conflicts, and keep dependencies tidy. Learn to create and activate a virtual environment to manage dependencies within each project.
Learn how to create and manage a Python virtual environment on Windows, activate and deactivate it, install libraries with pip, and keep project dependencies isolated from the system Python.
Learn to create and activate Python virtual environments on Linux or macOS, install packages with pip, and manage paths and dependencies for forex trading projects.
Install Visual Studio Code and key extensions, set up a virtual environment, open the test folder with code, and select the proper Python interpreter for IntelliSense.
Master Postman to test API endpoints, organize requests in workspaces and collections, and simulate trading data for the complete algorithmic forex trading and back testing system course.
Discover how to access the Oanda rest api in the practice environment, authenticate with bearer tokens, and set json content-type while using the base url and endpoints to fetch data.
Learn how to call the accounts endpoint using Postman by configuring a workspace and a collection, setting bearer authorization and content-type json, and parsing a 200 response with account properties.
Navigate the account summary endpoint to fetch the account object and last transaction id with a get request using a required account id in the path.
Explore the account instruments endpoint to fetch all tradable instruments for a given account via a get request, returning the instruments list and the last transaction id.
Learn how to retrieve candlestick data using the instrument candles endpoint, configuring granularity, count, and from-to ranges, and interpreting open, high, low, close, and volume with UTC timestamps.
Fetch pricing data for specified instruments via the pricing endpoint and learn how price objects present time, bids, asks, tradability, and home currency conversions for live trading.
Begin by using Python to test endpoints, collect thousands of candles across currency pairs, and outline the main code structure for the complete forex trading and backtesting system.
Set up a Python virtual environment and VS Code workflow to run notebooks for forex data analysis, installing pandas, Jupyter, plotly, and requests, then create and run notebooks.
Set up a Python 3 virtual environment, install pandas and Jupyter, configure a Jupyter theme, create an exploration folder, start a notebook server, and run a simple API test notebook.
In a python notebook, set up a requests session with bearer api key and JSON content-type, build a ten candle eurodollar query, and parse the JSON response.
Implement a flexible fetch candles function to query the api with configurable count, granularity, and instrument, return a status code and data tuple, and prepare candles for Pandas dataframe analysis.
Learn to build a candles dataframe from mid, bid, and ask prices, convert strings to floats, and create a reusable get candles dataframe function for backtesting.
Save every tradable currency pair by generating all instrument combinations from major currencies, fetch candles at h1 and h4, and store them as data files for backtesting.
Define an Oanda api class with a requests session and headers, loading api key, account id, and base url from a file, and highlight secret management.
Learn to add a self-contained make_request function to the api class that standardizes get requests, builds a full url, uses try-except for errors, and returns a (success, json) tuple.
Create an in memory instrument class to store tradable data for backtesting and live bots, mapping API fields via from_api, converting margin rate to float and pip location, using underscore_type.
Build and test a second instrument collection class that loads instruments from an API, saves to instrument start JSON, and validates by loading and printing the JSON data.
Plot candle charts in notebooks to evaluate strategies, then build a simple back test across multiple currency pairs and parameters, and save and reopen notebooks to assess results.
Develop a reusable candle plotting utility for forex backtesting, enabling easy candlestick visualization in notebooks with a dedicated class, layout updates, and time-string handling.
Learn to compute and plot a ten-period moving average on a candle chart using pandas, including preparing a reduced dataframe, handling nan values, and resetting the index.
Plot the ten-period moving average on the candle chart using a scatter trace, with a clear line width, creating the moving average line alongside the candlestick plots.
Plot multiple moving averages using pandas in Python to visualize 10, 20, 50, 100, and 200 period trends on forex data and build line traces for rapid backtesting prep.
Detect delta sign changes to identify buy or sell trades by applying an is_trade function across the dataframe and creating a trade column for backtesting with moving averages.
Explore backtest results with a Result class that saves trade data to a data frame and provides a summary of trades, gains, and moving averages.
Integrate the main result class with existing code to return ETF trades and build the result object from trades, instrument name, and long and short moving averages.
Learn to convert backtest results into a pandas DataFrame by constructing a list of dictionaries, using list comprehension to extract results, and printing the dataframe for all forex pairs.
Evaluate cross strategies across currency pairs to gauge consistency. The BAC back test shows no strong cross and about half the pairs are profitable.
Analyze a cross-based forex backtest by sorting total gains, tracing cumulative gains over time, and comparing currency pairs with pandas plots, while preparing Excel exports for deeper review.
Build on prior test results by using Excel to quickly explore data with spreadsheets, charts, and tables, then automate the process to generate multi-sheet workbooks and well-formatted visuals.
Learn to export backtest data to Excel using the pandas dataframe and xlsxwriter engine, create a reusable create_excel function, and generate labeled tables and charts from simulation results.
Save backtest results to an xlsx workbook by preparing data, filtering by granularity, sorting by pair and total gain, removing time zones, and exporting per-pair sheets with moving average.
Export the cumulative gains for the best cross per forex pair and chart them in Excel by building a table from the dataframe and selecting the top row per pair.
Learn to build an algorithmic forex trading and back testing system that tests moving average cross strategies, saves results to Excel, and uses Python with pandas to extend candles data.
Collect candlestick data with Python scripting across many instruments and finer granularity, spanning six years. Rerun the moving average cross simulation to evaluate performance changes.
Update the OandaApi integration to fetch candles using date range or count, format dates with a T and Z for UTC, and return the candles for backtesting.
Implement a collection entry function that iterates euro and gbp pairs, builds instrument ids, and tests hourly data collection via collect_data with defined dates, paths, and an api.
Define date ranges and time steps to fetch candles across a span, handling end date and from date. Concatenate data frames and save the final file.
Fetch candles from an API with retry logic, build a candles dataframe, and verify 200 responses; test with m five candles and prepare to save historical data.
Collects and saves a cleaned, deduplicated dataframe of forex candles as a pickle file for backtesting, using a formatted file name with pair and granularity, and ensures time-ordered data.
Run moving average cross simulations over six years of data, saving Excel results for the H1 and the H4 granularities, and analyze CAD/JPY, GBP/CAD, and NZD pairs.
Learn how to calculate popular forex indicators and how the RSI signals, and gain the skills to build your own indicators without libraries for reliable backtesting and live trading.
Implement Bollinger bands in Python with pandas by computing the typical price and rolling mean and std using n and s to produce upper and lower bands for forex trading.
Explore how to calculate the average true range (ATR) and apply it to the keltner channel, using the EMA, true range components, and secondary y-axis plotting for forex trading.
Learn how the macd indicator uses the 12-26 ema difference and a 9-period signal line with a histogram to generate buy and sell signals, plus backtesting notes for forex trading.
learn to compute candle characteristics in Python: determine direction, body size, full range, and body percentage using pandas, and visualize with candle plots.
Compute candle characteristics by deriving body bottom and top percentages from candle ranges, normalize to the full range, and store results in a dataframe for later pattern identification.
Translate candle characteristics from notebook to a Python script, defining a patterns module that applies candle props and patterns to a dataframe using pandas, with VS Code workflow and testing.
Learn to identify hanging man and hammer candlestick patterns in a forex backtesting workflow, using body-size and position criteria to detect reversals and plot results in a notebook.
Explore the inverted hammer candlestick pattern and its reversal signals in forex trading, including how to detect shooting star setups and implement pattern checks in a notebook.
Identify the spinning top candlestick, signaling indecision, by enforcing a 40–60% body range and a 15% body size constraint across candles.
Explore the mariposa single candlestick pattern, defined by a near full-body candle (roughly 98-99%), and learn how to implement a lambda-based check to detect it in a forex backtesting workflow.
Explore how engulfing candles signal trend reversals in the dual candlestick pattern, distinguishing bullish and bearish cases, comparing body sizes, and excluding gapping.
Explore the morning star and evening star multi-candlestick patterns and implement their detection with midpoints, body percentages, and pandas dataframes for automated backtesting in forex trading.
Convert notebook candle pattern logic into a script, extend the dataframe with pattern fields, implement set candle patterns, test detection (engulfing, morning/evening star, mariposa), and prepare for deeper simulations.
Whilst fun, Forex trading is not easy! To be successful today, you must have the ability to test strategies, automate trading and access information.
IMPORTANT:
Note: For this course, we will use the Oanda API service. It is available in most countries worldwide, however please check before purchasing the course. You can check in video #3 called "Oanda account setup and API access". If you are in the EU, it's not available.
Whether it's as a hobby or professional, this course will give you the foundation upon which you will be able to:
Build a live trading bot
Create a fast, accurate strategy testing system
Retrieve live headlines, sentiments, technicals and more from the web.
Use databases to store and correlate data with market moves
Build a web application showing the latest prices, sentiments and other market data
Learn full stack development, using MongoDB, Python and JavaScript (with React)
We will start by learning to use Python to access the Oanda REST API. Next, we'll download a few thousand candles and develop a simple strategy back test, testing multiple parameters and currency pairs at once. We'll use the results from this back test to learn how to automate the export of results into a spreadsheet format with tables and graphs.
Once the simple strategy has been tested, we'll get hold of a lot more data - six years' worth for multiple time frames. We'll rerun our simple strategy, and then move on to implementing candle pattern detection and indicator calculation. We will also look at using multi-processing to speed up the testing even more.
Now we have some more knowledge, it's time to create a more comprehensive back testing system - with spread and breaking candles down into finer time frames. For testing we will choose two strategies with over a million views on YouTube and assess whether they really give the claimed 90% win rate...
It's now time to move on to the big moment - the live trading bot. We will develop a robust trading bot that trades multiple pairs with comprehensive logging. We will structure the code such that it is easy to swap in and out strategies.
Now it's time to get more advanced and learn how stream prices live - using multi-threading with events and work queues to react to prices and make decisions
We will learn how to use Web Scraping with Python to access live sentiments, technicals, headlines and economic data. Alongside this, we'll create a MongoDB database to store our data.
Next up: React! We will use the famous framework to develop ourselves a web application that can access live prices, our sentiment data and much more.
Finally, we will deploy our trading bot on a cloud service.
The course includes a quick-start appendix for Python and for HTML/CSS/JavaScript.