Summary of Day 4 and Day 15: Deep understanding of Lists and Error Handling in Python
Python List: The Essential Data Structure for Quantitative Traders
The use of Python Lists is extremely important in algorithmic trading. Python Lists are a versatile data structure that can be used to store any type of data – be it stock prices or trading signals.
List vs Array: What’s the Difference?
Both List and Array are used for data storage in Python, but:
Lists can store different types of data (int, float, string, etc.).
Arrays store the same type of data and are more memory-efficient.
For traders, Lists are more flexible while Arrays are better for high-performance.
Usage Features:
- Dynamic memory allocation
- Indexing and Slicing facility
- Nested list support
Disadvantages of List in Algorithmic Trading:
- Slower in large scale computations
- High memory usage
Quantitative Analysis and Trading in Singapore:
Python List can be used to store historical price data, signals, and positions, making it easier to create trading strategies. Python-based trend analysis is a useful tool, especially in emerging markets like Singapore.

Error Handling in Python: Why is it important in Algo Trading?
What is Syntax Error and Exception?
There are two types of errors in Python:
- Syntax Error – Mistakes made while writing code, such as mismatch of brackets, indentation, etc.
- Exceptions – Logical errors generated during runtime, such as ZeroDivisionError, ValueError, or ModuleNotFoundError.
Importance of Syntax Error:
In Algo Trading, if any code has a syntax error, then the trading bot will never start. For example, if the bracket in print(“hello” is not closed, it will not run.
Such an error during live trading can lead to a huge financial loss.
Try-Except Block: Best Practice
When we think a line may give an error, we put it in a try-except block:
try:
risky_code()
except Exception as e:
print(“Error occurred:”, e)
Real World Example: Freqtrade Strategy
While doing error handling in Python, we implemented a crypto strategy where ModuleNotFoundError came while importing the module error. We can handle this with a try-except block.
Best Algorithmic Trading Software in the USA:
- Freqtrade
- Zipline
- QuantConnect
All of these have built-in support for error handling, but if you are writing custom Python scripts, then error management becomes very important.
Personal Note from the Creator
During the recording of Day 15 video I was returning back to India, but to continue this series with you guys I recorded multiple videos in a single day. This is the consistency and commitment that makes any Trader or Coder successful.
“It is only in our darkest times that we recognize the true power of the light within us.”
Watch this Day 17 video tutorial
Day 17: Exception Handling