
Optional (only for students who are on a Mac): Install Parallel so that you are able to use MetaTrader5 Python module later on (https://www.parallels.com/products/desktop/).
In this lecture, we talk about what Python expressions are.
In this lecture, we give an an overview of the native Python data types, and start our detailed examination of each data type.
We go over the numerics data type in Python in this lecture.
We discuss the string data types in Python in this lecture.
List is a very versatile data type in Python, and this is the topic for this lecture.
We will examine the tuple data type in this lecture.
We discuss the set data type in Python in this lecture.
Python dictionary is used very often every day, and we will go over the dictionary data type in this lecture.
We go over the fundamental control flow structure syntax in Python in this lecture. After this lecture, you will be able to work with all the native Python data types, and build decision logic into your code.
Import pandas as pd and load the gapminder csv into a data frame named world. Inspect its shape, data types, and missing values, and preview rows with head and tail.
Explore how data frames support heterogeneous columns—strings, integers, and floating point numbers—and how to access wide data frames using df.columns, with debugging tips and quick summary statistics.
Access the year column in a pandas data frame using square brackets, yielding a pandas series. Verify its type with the type function.
Explore subsetting, indexing, and slicing in data frames using iloc and loc, selecting specific rows and columns, and retrieving single elements, with examples.
Learn how to compute unique values and value distributions in a pandas column using value_counts, sort_index, and unique for subregion data.
Learn to filter rows by applying a boolean condition in pandas, using square brackets to return only rows meeting a criterion like life expectancy above 82.
Practice filtering a world subregion by exact match and year using boolean series and the double equals operator, creating East Asia data frames limited to 2015.
Explore how to loop through an instrument-year list in Python, fetch live market data, and build indicators for a trading strategy, with the option to expand strategies using this format.
Learn to define and call a Python function that retrieves daily data from the MetaTrader five platform, using inputs like pair and time frame to process and return data.
Use try/except inside functions to keep multi-pair trading running when getting data for a pair fails, with clear debugging messages.
Learn to use Python's datetime module and Timedelta to fetch 500 days of market data, computing a start time in a time zone down to midnight UTC.
Install the MetaTrader5 module in Python, set up a project in the Anaconda prompt and Jupyter Notebook, import pandas, NumPy, and Talib, then verify installation by importing MetaTrader5.
Learn how to build indicators with pandas by computing percent change on close prices across periods, comparing current and prior bars, and overwriting data frames accordingly.
Connect to MetaTrader 5 to fetch account information such as balance, equity, margin used, free margin, and view current positions and history for money and risk management in algo trading.
Are you a trader who is interested in learning how to build their own trading algorithm?
If so, this course will teach you the basics of Python - you will learn about all the native data types in Python, and know how to work with control flow structure so that you can have decision logic built into your code.
Trading is hard, but it is also highly rewarding. With Python, you can put in a methodical system to build your own rule-based algorithm in order to get to your goal efficiently.
Python is also the perfect language for AI-based algorithms using a variety of machine learning techniques. The AI-based courses are coming soon.
This complete course of algo trading with Python will teach all the Python syntax you need to know, and get you ready for working with Pandas, taking care of the DateTime objects, and handling errors. You will then immediately learn about how to use Python to connect to the MetaTrader5 terminal, and get market data as well as account information programmatically from your broker directly. You will also learn about constructing indicators that work for your style of trading, by using Pandas, Ta-Lib, or writing your own user-defined functions. You will learn how to programmatically compute position size but first decide where you would like to place your stop loss level, and then query some account information to complete the computation. You will learn about the specific ways that you will communicate, using Python, with your brokers to enter and/or exit trades with the computed size for your risk tolerance. Further, you will also learn about how to set the stop loss and take profit, how to move stop loss to breakeven, and how to update (trail) your stop-loss level after that point. Once you have learned all about these topics, you are able to build as many elaborate risk management strategies as you want in a way that you like to trade.
At the end of this course, you will have a firm understanding of what goes into building an algorithmic trading strategy from scratch. You will have not only all the tools necessary to create your own algorithmic strategies, but you will also know how to manage your positions, as well as take what you already know and set up a backtesting environment for yourself, so that you are able to systematically build and test strategies on an on-going basis.
The goal of the series is to give you an understanding of what goes into building an algorithmic trading strategy from scratch. By the end of the three-part series, you should have not only all the tools necessary to create your own algorithmic strategies, but you will also know how to manage your positions.