profile image Kshitij Banerjee (KB) Trading and Code Generation with ML, LLMs

Syncing historical data from IBKR
ML Trading

Syncing Historical Data from IBKR: A Comprehensive Guide In this post, we’ll walk through a complete workflow for downloading historical data from Interactive Brokers (IBKR) and preparing it for analysis and backtesting. Why download from broker ? The core assumption is that we sync data directly from the broker, ensuring its accuracy while trading and backtesting. Once this data is downloaded, we can build ML data batches for training models....

February 1, 2025

Statistical learnings - Failed santa rally 2024
ML Trading

Intro Santa Claus Rally is a well-known narrative in the stock market, where it is claimed that investors often see positive returns during the final week of the year, from December 25th to January 2nd. But is it a real pattern or just a market myth ? It is also claimed that next years returns are positively correlated to the Santa rally. But is it a real pattern or just a market myth ?...

January 1, 2025

Adventures in ML trading - Part 2
ML Trading

Preface In my previous post, I developed a simple mean-reversion strategy based on an oscillating signal calculated from a stock’s distance to its 50-day simple moving average. However, the results revealed a key shortcoming: the algorithm struggled to account for momentum, leading to poorly timed exits during parabolic moves—either too early or too late. In this post, we’ll dive into momentum and conduct an analysis to validate our assumption. If we can confirm that incorporating momentum enhances the strategy, we’ll move forward with developing a more advanced approach to leverage it effectively....

December 25, 2024

Adventures in ML trading - Part 1
ML Trading

Preface For those who know me, I spend a lot of time reading financial statements and analysing technical signals. While this is probably the known path, and the perhaps the wiser way to make money in the market - I am particularly interested in the mathematical, statistical and probabilistic nature of the market. Everyone who has tried their hand at trading, can atleast imagine how computers would be able to crunch through numbers better than humans....

December 19, 2024

June 2024 - Papers on Agents, Fine-tuning and reasoning
AI, Machine-Learning

What’s included Multi-Agent RL for Adaptive UIs Is ‘Programming by Example’ (PBE) solved by LLM’s Learning Iterative Reasoning through Energy Diffusion LORA: Low-Rank Adaptation of LLMs Automating the Enterprise with Foundational Models MARLUI - Multi-Agent RL for Adaptive UI ACM Link: https://dl.acm.org/doi/10.1145/3661147 Paper: MARLUI Adaptive UIs Adaptive UIs - as opposed to regular UI’s, are UI’s that can actually adapt to the users needs. In this paper, the UI is adapting to optimize the number of clicks needed to reach the outcome....

June 22, 2024

Evaluating LLM Benchmarks for React
AI, Machine-Learning

Introduction I previously wrote about writing react code with Deepseek-coder 33b model, and whether we could improve some of these shortcomings with the latest research in the LLM space But to really measure and mark progress, it would require the build of a benchmark to test various hypothesis around it. So in this post, I’m going to evaluate existing benchmarks that specifically measures LLM capabilities on coding capabilities. My goal is to be able to build a benchmark that can test their React/Typescript coding capabilities....

May 4, 2024

Can LLM's produce better code?
AI, Machine-Learning

Introduction In my previous post, I tested a coding LLM on its ability to write React code. Specifically, I tried the currently leading open source model in the HumanEval+ benchmark leaderboard - DeepseekCoder:33b-instruct. I used this model in development for a few weeks, and published a subset of examples in the post. Even though I tried this on a relatively small problem size, there were some obvious issues that were recognisable to me, namely:-...

April 30, 2024

Deepseek coder - Can it code in React?
AI

Introduction The goal of this post is to deep-dive into LLMs that are specialized in code generation tasks and see if we can use them to write code. Note: Unlike copilot, we’ll focus on locally running LLM’s. This should be appealing to any developers working in enterprises that have data privacy and sharing concerns, but still want to improve their developer productivity with locally running models. To test our understanding, we’ll perform a few simple coding tasks, compare the various methods in achieving the desired results, and also show the shortcomings....

April 15, 2024

Exploring Code LLMs - Instruction fine-tuning, models and quantization
AI

Introduction The goal of this post is to deep-dive into LLM’s that are specialised in code generation tasks, and see if we can use them to write code. Note: Unlike copilot, we’ll focus on locally running LLM’s. This should be appealing to any developers working in enterprises that have data privacy and sharing concerns, but still want to improve their developer productivity with locally running models. To test our understanding, we’ll perform a few simple coding tasks, and compare the various methods in achieving the desired results and also show the shortcomings....

April 14, 2024

Build - Tony Fadell
Book-Review

Introduction Tony Fadell is CEO of nest (bought by google ), and instrumental in building products at Apple like the iPod and the iPhone. The book is not about facts and science, but based on tony’s experience and deals with subjective concepts like how to build products, dealing with assholes, and how to hire etc. Overall, 4/5 stars for me, and I recommend reading it. It covers one strong individuals strong opinions, about how to deal with matters one must deal with when building impactful products....

February 24, 2024