
Python for Algorithmic Trading Cookbook
By :

SQLite offers a bridge between the simplicity of flat files and the robustness of relational databases. As a serverless, self-contained database, SQLite provides algorithmic traders with a lightweight yet powerful tool to store and query data with SQL but without the complexity of setting up a full-scale database system. Its integration with Python is seamless, and its compact nature makes it an excellent choice for applications where portability and minimal configuration are priorities. For traders who require more structure than CSVs, or prefer to use SQL, but without the overhead of larger database systems, SQLite is the optimal choice.
We’ll build a script that can be set to run automatically using a CRON job (Mac, Linux, Unix) or Task Scheduler (Windows). For this recipe, we will create a Python script called market_data_sqlite.py
and run it from the command line. We’ll also introduce the exchange_calendars...