I’ve been spending my recent free time in building an Event-Driven Backtesting Engine from scratch for Options. Backtesting complex option strategies requires processing massive amounts of market data, calculating Greeks, and tracking portfolio metrics simultaneously. To handle this without latency bottlenecks, I decided to architect the entire core engine in C++. for now I have mostly tried to make it very flexible like modular commission and slippage and ability to write custom strategies instead of editing the core engine itself I completely decoupled most of the core things so The entire C++ backend is compiled as a standalone library. I am also trying to Integrate a python bridge using pybind11 exposing this compiled library directly to Python. The goal for this is to make the engine to do all the computation in the background, allowing anyone to write, test, and plug in custom strategies dynamically using simple Python scripts without ever needing to modify the core engine files. Getting the C++ event loop to work good with Python scripting is proving to be a little complicated right now! I'll be pushing a final README and some sample strategies once I get the bindings fully stabilized. You guys can check out the code here : https://lnkd.in/gRSgd4gs #quantfinance #cpp #python #algorithmictrading #options #pybind11 #derivatives
Building Event-Driven Backtesting Engine for Options in C++
More Relevant Posts
-
Log 2/100: Telnetting into the Switch Python Library: telnetlib Today, I wrote a script to Telnet into my lab switch, but it kept crashing. After some troubleshooting, I found the exact issue: Python is just too fast. The script kept pasting the username before the switch had even generated the login prompt. The Fix: I added an extra line to the script (read_until) to force Python to wait and read the output until it actually saw the word "login:", and then asked it to paste the username. I applied the same logic to the Password prompt as well. Suddenly, the script started working flawlessly. The Takeaway: Writing the code is the easy part. Anticipating timing issues and making sure the script actually works without breaking in production is the tough part! The scirpts executes the show version command on the switch. Git Hub Repo: https://lnkd.in/gFkfNyWm Git hub Profile: https://lnkd.in/gjJJJQeT #Python #NetworkAutomation #NetDevOps #NetworkEngineering #100DaysOfCode #ArubaCX #CodingJourney
To view or add a comment, sign in
-
-
Day 2/30 – Building with Python Recently, I worked on a Vehicle Feedback System using Python The idea behind this project was to create a simple system where users can: 📝 Submit feedback about vehicles 📊 Store and manage responses efficiently Through this project, I learned: ✨ How to handle user input and data ✨ Basic logic building and structuring a program ✨ The importance of user-friendly systems This is just the beginning — I’m planning to improve it further by adding: OTP-based authentication for better security Database integration for scalability Possibly a simple UI for better user experience Building projects like this is helping me understand how real-world systems evolve step by step Would love your suggestions or ideas to improve this further! #Day2 #PythonProject #LearningInPublic #StudentDeveloper #BuildInPublic #TechJourney
To view or add a comment, sign in
-
𝐃𝐚𝐲 𝟔/𝟑𝟎: 𝐇𝐨𝐰 𝐝𝐨 𝐏𝐲𝐭𝐡𝐨𝐧 𝐝𝐞𝐯𝐬 𝐡𝐚𝐧𝐝𝐥𝐞 𝐭𝐡𝐢𝐬? 🐍 Coming from C++, I’m used to the compiler being my safety net. If I try to add a string to an int there, the code won’t even run. ➡️ But yesterday I realized Python is... a different world! def add(a, b): return a + b add(10, "5")💣 Boom! Runtime Error In a tiny script, this is a 2-second fix.. But in a massive codebase with thousands of functions? This feels like a 𝐡𝐢𝐝𝐝𝐞𝐧 𝐫𝐢𝐬𝐤 𝐰𝐚𝐢𝐭𝐢𝐧𝐠 𝐭𝐨 𝐡𝐚𝐩𝐩𝐞𝐧. So, the real question for the experts here: How do you guys stop these "sneaky" errors before they hit production? Is it: A) Just remember everything B) Test everything thoroughly (Unit tests for every single edge case) C) Use Python type hints (a: int, b: int) (👀but do they actually stop the crash?) D) Something else(MyPy? Pylint?) I’ve been digging into this 𝐜𝐥𝐚𝐬𝐡 𝐛𝐞𝐭𝐰𝐞𝐞𝐧 𝐟𝐥𝐞𝐱𝐢𝐛𝐢𝐥𝐢𝐭𝐲 𝐚𝐧𝐝 𝐬𝐚𝐟𝐞𝐭𝐲 𝐭𝐨𝐝𝐚𝐲. I’m hunting for a way to make Python feel just as safe as C++. I'll share what I find tomorrow! Drop your choice below 👇 What’s the standard industry workflow for catching these? #Python #Cpp #LearningInPublic #30DaysOfCode #SoftwareEngineering #Programming
To view or add a comment, sign in
-
-
If you used Rcpp back in the R days, this will feel familiar. I vibe-coded something over the weekend that does the same thing for Python: write C++ inline, call it like a normal function, get results back as numpy arrays. No build system, no separate files, no compilation step. ``` fn = cppFunction(''' std::vector<double> simulate(int n, double mu) { ... } ''') fn(10000, 2.5) ``` Projects like pybind11 and Cython are better for production C++ projects, but this is for when you just need one fast function right next to your Python code. The code compiles on the first call and is cached forever after. Armadillo works out of the box if you have it installed. https://lnkd.in/gt6YQENq
To view or add a comment, sign in
-
Just finished building an Automated Data Firewall in Python! The Problem: Manually checking incoming CSVs for errors is slow and prone to human error. The Solution: I built a system using Python and Watchdog that monitors folders in real-time. It runs parallel quality checks (null-value detection & outlier analysis) before promoting clean data to a MySQL warehouse via SQLAlchemy. Key Features: ✅ Real-time file monitoring ✅ Fail-safe reporting with ReportLab (PDFs) ✅ Concurrent processing with ThreadPoolExecutor 📂 Check out the repo here:https://lnkd.in/e8p7Aefq #Python #DataEngineering #Automation #Github #SoftwareDevelopment
To view or add a comment, sign in
-
-
My biggest mistake early in my Python journey wasn’t bad code. It was ignoring the small tools that make systems reliable. After 4+ years building automation projects, I found a handful of libraries that quietly transformed my side projects into production-ready products. I wrote about the exact 8 libraries I rely on today. Check out the full breakdown on my Medium account.
To view or add a comment, sign in
-
VSCode workspace is a game changer! If you're writing Python codes for different versions (2.* and 3.*), then you should try the workspace in VSCode. Basically with workspace, you can define/set which CPython version to use when you click the play/run button in VSCode. This is very useful in cases where you might be trying out a logic in Python 2 and also on Python 3, or when you're migrating either upwards (from 2 to 3) or downwards (from 3 to 2), and since it's on the same IDE, the experience is really enjoyable. This also works on the same major version, so maybe you have Python 2.2 and 2.7, or 3.10 and 3.13; and it's not limited to just 2, you can have more. First time I tried it, had me smiling :) cause I work on different versions and it's not fun going to console and manually typing which python version to run on which folder --- (side note: python launcher is a great tool, but having an IDE that can support multiple versions seamlessly is just another level of ease). I really liked it, try it and see for yourself ;) #vscode #workspace #dcm #python
To view or add a comment, sign in
-
Today’s Python lesson felt like the moment code stopped being just instructions and started feeling reusable, flexible, and kind of smart. 🐍 Day 14 of my #30DaysOfPython journey was all about higher order functions, and this one made Python feel a lot more powerful. In Python, functions are first-class citizens, which means they can: 1. take other functions as parameters 2. return functions as results 3. be modified 4. be assigned to variables Today I also explored: 1. Functions as parameters 2. Functions as return values 3. Closures — where an inner function can use the outer function’s scope 4. Decorators — a clean way to add extra behavior without changing the original function 5. Built-in higher order functions like: i. map() → transforms items ii. filter() → keeps only matching items iii. reduce() → combines items into one value What stood out to me today was how Python lets functions do more than one job. They are not just blocks of code anymore — they can actually shape how other code behaves. One more day, one more topic, one more step toward thinking in cleaner, more reusable logic. Which one feels the most interesting to you right now: map(), filter(), reduce(), or decorators? Github Link - https://lnkd.in/gc-mj8Qi #Python #LearnPython #CodingJourney #30DaysOfPython #Programming #DeveloperJourney
To view or add a comment, sign in
-
Every #Python developer has a well-worn toolkit. Pandas for data, requests for HTTP, logging when something needs to be logged, print() when you’re debugging, and nobody’s looking. These tools work, and they’re battle-tested for good reason. But the Python Package Index now hosts more than 800,000 projects, and Python Software Foundation keeps the ecosystem growing through grants, infrastructure, and community programs that fund the people building the next generation of libraries. Some of the most useful ones never quite break into the mainstream. Most developers use only a fraction of what’s available, so take a gander at what’s new once in a while. (And sign up for #PyConUS, it starts on May 13th! https://us.pycon.org/2026/) Read more about these libraries like #Rich, #Nuff, #Typer:\ https://lnkd.in/ejw3G5Pf
To view or add a comment, sign in
-
-
If you want your python code to be less buggy and easier to maintain and deploy, check out the following FREE, open source tools you can build into your development workflow than can do all that and more. black, ruff, pytest, py-spy, mypy and pre-commit. In my latest article on Towards Data Science I show where to get them, install and use them. Read the article for free using the link in the first comment.
To view or add a comment, sign in
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development