Skip to content
Facebook page opens in new windowX page opens in new windowWhatsapp page opens in new windowTelegram page opens in new windowInstagram page opens in new windowLinkedin page opens in new window
+61417804481zhe.li@zheli.com.au
Search:
中文
Zhe Li
Zhe Li an IT Finance & AI blogger
Zhe LiZhe Li
  • Home
  • Finance Analysis
  • Python
  • About me
  • Contact
  • Home
  • Finance Analysis
  • Python
  • About me
  • Contact

Automating Trading Operations

Programming, Python, Python for Algorithmic TradingBy Zhe2 March 2026Leave a comment

Capital management Kelly criterion in binomial setting Assume a gambler is playing a coin-tossing game against an infinitely rich bank or casino. Assume further that…

Read more

FX Trading with FXCM

Programming, Python, Python for Algorithmic TradingBy Zhe27 February 2026Leave a comment

Install the Python wrapper package Open a FAXM Demo Account Create a unique API token Connect to the API The configuration file Retrieving data Retrieving…

Read more

CFD Trading with Oanda

Programming, Python, Python for Algorithmic TradingBy Zhe27 February 2026Leave a comment

The Oanda API The configparser module is used to manage account credentials. Filename: pyalgo.cfg To access the API via Python, it is recommended to use…

Read more

Working with Real-Time Data and Sockets

Programming, Python, Python for Algorithmic TradingBy Zhe26 February 2026Leave a comment

ZeroMQ is a lightweight, fast, and scalable socket programming library. ZeroMQ supports different patterns for socket communication. One of those patterns is the so-called publisher-subscriber…

Read more

Building Classes for Event-Based Backtesting

Programming, Python, Python for Algorithmic Trading, Zhe LiBy Zhe26 February 2026Leave a comment

Potential shortcomings of the approach are the following: Look-ahead bias Vectorised backtesting is based on the complete data set available and does not take into…

Read more

Predicting Market Movements with Machine Learning

Programming, Python, Python for Algorithmic TradingBy Zhe25 February 2026Leave a comment

Using Linear Regression for Market Movement Prediction Using logistic regression to predict market direction Without considering transaction costs Consider the same strategy applied to the…

Read more

Vectorised Backtesting

Python, Python for Algorithmic TradingBy Zhe10 February 2026Leave a comment

Simple moving average (SMA) based strategies For buy and sell signal generation is already decades old. Momentum strategies Based on the hypothesis that recent performance…

Read more

Reading Financial Data From Different Sources

Python, Python for Algorithmic TradingBy Zhe9 January 2026Leave a comment

The Data Set Suppose that we have file, AAPL.csv in a data folder. Reading from a CSV File with Python Using a csv.DictReader iterator object…

Read more

Fundamental Algorithmic Trading Strategies

Financial Trading with Python, Programming, PythonBy Zhe4 January 2026Leave a comment

Any algorithmic trading strategy should entail the following: It should be a model based on an underlying market theory since only then can you find…

Read more

Zipline and PyFolio

Financial Trading with Python, Programming, PythonBy Zhe31 December 2025Leave a comment

Zipline and PyFolio abstract away the complexities of the backtesting and performance/risk analysis aspects of algorithmic trading strategies. Backtesting should include all relevant factors, such…

Read more

Financial Market Data Access in Python

Financial Trading with Python, Programming, PythonBy Zhe31 December 2025Leave a comment

Exploring the yahoofinancials Python library The yahoofinancials Python library provides free access to the market data available from Yahoo Finance, whose provider is ICE Data…

Read more

Statistical Estimation, Inference, and Prediction

Financial Trading with Python, Programming, PythonBy Zhe27 December 2025Leave a comment

Four key statistical libraries in Python statsmodels is a Python library to explore data, perform statistical tests, and estimate statistical models Normal distribution test with…

Read more

Data Visualisation Using Matplotlib

Financial Trading with Python, Programming, PythonBy Zhe25 December 2025Leave a comment

Creating figures and subplots Defining figures’ subplots Adds a subplot Plotting in subplots The sharex= parameter can be passed when creating subplots to specify that…

Read more

Data Manipulation and Analysis with pandas

Financial Trading with Python, Programming, PythonBy Zhe22 December 2025Leave a comment

The name pandas is derived from panel data, an econometrics term for a multidimensional structured dataset. Introducing pandas Series, pandas DataFrames, and pandas Indexes pandas.Series…

Read more

High-Speed Scientific Computing Using NumPy

Financial Trading with Python, Programming, PythonBy Zhe22 December 2025Leave a comment

Creating NumPy ndarrays Creating 1D ndarrays Inspect the type of the array Creating 2D ndarrays Creating any-dimension ndarrays Creating an ndarray with np.zeros(…) Creates an…

Read more

Exploratory Data Analysis in Python

Financial Trading with Python, Programming, PythonBy Zhe20 December 2025Leave a comment

The objective of exploratory data analysis (EDA) is to load data into structures most suitable for further analysis to identify and rectify any wrong/bad data…

Read more

A Basic Python main()

Other Python Notes, PythonBy Zhe16 October 2024Leave a comment

In some python scripts, you may see a function definition and a conditional statement that looks like the example below: In this code, there is…

Read more

Regular Expressions Based on Syntax Used by Perl

ProgrammingBy Zhe20 August 2024Leave a comment

Symbol(s) Meaning Example Example Matches * Matches the preceding character, subexpression, or bracketed character, 0 or more times a*b* aaaaaaaa, aaaaabbbb, bbbbbbb + Matches the…

Read more

Vehicle usage per month question

Other Python Notes, Programming, PythonBy Zhe20 November 2023Leave a comment

You want to find out which fraction of your car’s use is for commuting to work, and which is for personal use. You know the…

Read more

Transportation question

Other Python Notes, Programming, PythonBy Zhe20 November 2023Leave a comment

You want to decide whether you should drive your car to work or take the train. You know the one-way distance from your home to…

Read more

Painting Question

Other Python Notes, Programming, PythonBy Zhe20 November 2023Leave a comment

In order to estimate the cost of painting a house, a painter needs to know the surface area of the exterior. Develop an algorithm for…

Read more

Bank Account Question

Other Python Notes, Programming, PythonBy Zhe20 November 2023Leave a comment

Write an algorithm to settle the following question: A bank account starts out with $10,000. Interest is compounded monthly at 0.5 per cent per month.…

Read more

Create a virtual environment for a Python project

Other Python Notes, PythonBy Zhe18 November 2023Leave a comment

A virtual environment is created on top of an existing Python installation, known as the virtual environment’s “base” Python. It may optionally be isolated from…

Read more

Binance Terminologies

Other Python Notes, Programming, PythonBy Zhe6 October 2023Leave a comment

Market Data Endpoints These endpoints provide real-time and historical market data for different cryptocurrencies traded on Binance. This data includes information such as the current…

Read more

How to get remote from Yahoo Finance

Other Python Notes, PythonBy Zhe22 August 2023Leave a comment

According to the “datareader” official site, to access the remote Yahoo Finance Data, it is suggested to use the following code: These codes will pop…

Read more

How to fix no module named ‘pandas-datareader'[Solved]

Other Python Notes, PythonBy Zhe22 August 2023Leave a comment

The following code doesn’t work. Without any reason, the code above will give you an error message: ModuleNotFoundError: No module named ‘pandas_datareader’ After seeking a…

Read more

urllib and “SSL:CERTIFICATE_VERIFY_FAILD” Error

Other Python Notes, Programming, PythonBy Zhe28 May 2023Leave a comment

I’m trying to test my blog site by the urllib.request. Unfortunately, my blog site has SSL (Secure Sockets Layer) enabled, and returns an urlopen error,…

Read more

Part 1 Machine Learning for Trading – From Idea to Execution

Machine Learning, Other Python Notes, PythonBy Zhe7 March 2023Leave a comment

Algorithms are a sequence of steps or rules designed to achieve a goal. They can take many forms and facilitate optimisation throughout the investment process,…

Read more

Bash: Reading Input

BashBy Zhe4 November 2021Leave a comment

The read command is a builtin command that reads from the standard input. By default, it reads until a newline is received. The input is…

Read more

Bash: Printf

BashBy Zhe4 November 2021Leave a comment

printf: formatting and printing data printf FORMAT ARG … The FORMAT string can contain ordinary characters, escape sequences, and format specifiers. Ordinary characters are printed…

Read more

Install Python Packages on Visual Studio Code

Other Python Notes, PythonBy Zhe20 June 2021Leave a comment

Visual Studio Code is a free programming software. It is multiple platforms software that you can install it on Windows, Linux and Mac OS. As…

Read more

How to Install Python on Ubuntu

Other Python Notes, Programming, PythonBy Zhe21 February 2021Leave a comment

The latest version of Python is 3.9.2 on the date of posting this tutorial that shows how to install Python on Ubuntu. Installing Python 3.9…

Read more
Contact me
  • Mobile
    +61417804481
  • E-Mail
    zhe.li@zheli.com.au

Find us on:

Facebook page opens in new windowX page opens in new windowLinkedin page opens in new windowInstagram page opens in new windowWhatsapp page opens in new windowTelegram page opens in new window
Message me

Submit

Zhe Li
Copyright © 2026 ZHELI.COM.AU All Rights Reserved!
  • Home
  • Contact
  • About me
Bottom Menu
Go to Top