Basics of Python Algo Trading | 1/100 Days of Python Algo trading

Become an Algo Trading Expert in 100 Days – Day 1 Starts with Python

Do you want to learn algorithmic trading? If yes, you can become an expert algo trader in the next 100 days — and the journey begins with Python.

What is Python?

Python is a high-level interpreted programming language known for its clean and simple syntax.

Not only is this language easy to read, but writing code in it is also quite beautiful and straightforward.

Interpreted vs Compiled Language

Interpreter: Python reads and runs the code line by line. That is, as soon as you write a line, it can be run immediately.

Compiler: On the other hand, the compiler first reads the entire program at once, then runs it.

Basic Of Algo Trading
basic of algo trading2

Features of Python

Multi-paradigm support: You can code in all three ways in Python – procedural, object-oriented, and functional.

Object Oriented Programming (OOP): We will learn OOP in detail in the upcoming video.

Flexibility and Versatility: Python can be used for web development, data analysis, artificial intelligence, scientific computing, and more.

Why Python for Algo Trading?

  • Easy to Learn: Python is such an easy language that anyone can learn it and start programming in 1-2 weeks.
  • Close Relation to Math: Python has many pre-built mathematical modules that make your coding easier and faster.
  • “Batteries Included” Philosophy: Python already has many built-in functions — like you can reverse a string with just one line.
  • Library and Community Support: Libraries like NumPy, Pandas, Matplotlib and a strong developer community make it even more powerful.

100 Days Algo Trading Plan

We will cover these topics in the next 100 days:

Day Topic
1–10 Basic Python Programming
11–20 Python Data Types
21–30 Object Oriented Programming
31–40 Advanced Python
41–50 Beginning NumPy and Pandas
51–60 Advanced Pandas
61–70 Data Visualization
71–80 Data Analysis Techniques
81–100 Real World Algo Trading Projects

Watch this Day 1 video tutorial

Best Python Libraries for Algo Trading:

Pandas & NumPy – Data analysis & handling

TA-Lib – Technical indicators for quantitative analysis in Singapore

Freqtrade – Open-source crypto trading bot

Setting Up Your Algorithmic Trading Environment

Step 1: Install Python & Required Libraries

pip install pandas numpy ta freqtrade

Step 2: Set Up a Trading API (Binance, Coinbase, etc.)

Step 3: Implement a Basic Trading Strategy

import pandas as pd

data = pd.DataFrame({‘Price’: [45000, 46000, 47000], ‘Moving_Avg’: [45500, 45700, 46500]})

data[‘Signal’] = data[‘Price’] > data[‘Moving_Avg’]

print(data)

Introduction to Freqtrade Strategy for Crypto Trading

Freqtrade is one of the best algorithmic trading software in the USA for automating crypto trades.

How to Install Freqtrade?

git clone https://github.com/freqtrade/freqtrade.git

cd freqtrade

./setup.sh –install

How Freqtrade Helps?

Supports backtesting & paper trading

Implements custom crypto trading strategies

Ideal for quantitative traders in Singapore & the USA

Developing a Simple Trading Strategy

Using RSI Indicator for Trade Execution

import talib

# Sample price data

prices = [45000, 45500, 46000, 47000, 46500]

# Calculate RSI

rsi = talib.RSI(prices, timeperiod=14)

if rsi[-1] < 30:

print(“Buy Signal”)

elif rsi[-1] > 70:

print(“Sell Signal”)

6. Backtesting & Optimizing Your Trading Strategy

What is Backtesting?

Backtesting helps traders test their strategies using past data before deploying them live.

How to Backtest in Freqtrade?

freqtrade backtest –strategy MyStrategy

Go ahead—challenge yourself and solidify your learning!

Day 1: Python Basics

1. Which of the following best describes Python?

2. What is the output of the following code?
Python
print(“Hello,”)
print(
“World!”)

3. How would you print the following output with a single print function? “My age is 28”

4. What is the data type of the value 3.14?

5. Which data type represents True/False values?

6. Which of the following is a valid variable name in Python?

7. What symbol is used to start a single-line comment in Python?

8. How would you create a multi-line comment in Python?

9. Which of the following is a Python keyword (and therefore cannot be used as a variable name)?

10. What is the main difference between keywords and identifiers in Python?

11. Which function is used to collect user input in Python?

12. What would be the data type of the value entered by the user using the input() function?

13. How would you convert the string “10” to an integer?

14. Which function allows you to convert a number to a string?

15. Which of the following is NOT a Python literal?

16. What type of literal is ‘Python’?

17. Which of these represents a floating-point literal?

18. What data type would the following literal represent? [1, 2, 3, “hello”]

19. Which of these would be a valid numeric literal in Python?

20. What is the purpose of literals in Python programming?






 

SekabetSekabetSekabet GirişSekabet Güncel GirişSekabetSekabet GirişSekabet Güncel Giriş