I am learning from a book called "Learn Algorithmic Trading" by Donadio and Ghosh, and I literally copy-and-pasted the code directly from the book: