Categories
Senior Software Project

The Plot

Welcome back to Sean’s Syntax. In this blog I will be going over what I have been working on for the past few weeks for my algorithmic trading project, which includes 2 different interactive graphs.

Solution Comparison Chart.


The first chart I implemented is the “Solution Comparison” chart. It’s a color-coded bar chart that compares each top strategy’s return to a “Buy and Hold” benchmark. With dozens of potential solutions available, this visual allows you to quickly identify the top performers. And below the chart, I’ve included a table with the exact percentage return of each strategy. So we have both a rapid visual at a glance and accurate data to make final decisions.

Price Chart with Trading Signals


The 2nd interactive graph I implemented was a Price chart with trading signals. It shows market prices as a smooth line and uses triangle symbols to indicate entry and exit locations. Green upward triangles indicate purchases, while the descending triangles in green or red indicate lucrative and losing exits, respectively. Seeing these signals in a visual context has been super helpful for debugging. Being able to visually see when solutions become trapped in sideways markets or have a flaw in the stop loss, allows us to tweak the algorithm easier.

Technical Obstacles
Building these charts presented its own issues. Our trade timestamps arrived in various formats, so I had to create a standardizer that converted everything to ISO timestamps before plotting. Also, when we loaded hundreds of trades across several years, the charts slowed down. To fix this, I added a preprocessing step that aggregates data when zoomed out but retains complete information when zoomed in.

That concludes this blog. Thank you for reading!

Categories
Senior Software Project

Progress Report

Welcome back to Sean’s Syntax!
A lot has happened with my senior software project, and today I’m just going to give a quick overview of the progress we have made. Im also going to talk about why i chose this project and if it has met my expectations.

Introduction to Sean’s Syntax
This was my first post, in which I introduced myself and what was in my mind for this blog. I wrote about having lived in San Diego, surfing and photographing as a hobby, and being psyched about working with AI or algorithm business. I also presented the three pitches that interested me most, like developing a cloud-based algorithmic trading application.

Algorithms in Stock Trading
Next, I explained what the basis of what our project involves—optimization and algorithms. I explained that we’re testing different trading strategies with a genetic algorithm and picking out the best. We’re tracking important statistics like Sharpe ratio, max drawdown, and win rate to see how each strategy does. This blog established how we’re going to be making wiser trading decisions.

Creating Clouds (AWS Setup)
After that, I talked about configuring AWS Elastic Beanstalk for our trading application. We had not deployed our application, and discussed how we had established our environment, i.e., choosing our platform to be Python, defining environment variables, and real-time monitoring. This will be applicable in deploying and scaling our algorithm.

Coding Culture and Clean Code

In this blog, I took a different direction and wrote about best practices in clean code. Following in the footsteps of Robert C. Martin’s Clean Code and Martin Fowler’s Refactoring, I wrote about naming and why descriptive naming makes our code readable and maintainable. I warned against “shotgun surgery”, a code stench in which you have to do a single thing in many locations. By focusing on cleaner code, we’re keeping our project organized and saving ourselves enormous headaches in the future.

The Tech Stack

Most recently, I walked through our tech stack. My favorite tool is Python because it’s easy to read and gets along with libraries like NumPy, Pandas, and backtesting.py. SQL’s fantastic to work with when you have massive amounts of data, but it’s not a favorite because it’s a bit clunky. Lastly, AWS was a painful learn, but now it’s a lifesaver for deployment and scaling. These tools combined power our trading algorithm from start to finish.

Why This Project & Expectations So Far

I chose this project because it perfectly blends my interests in algorithms, finance, and software engineering. I’ve always wanted hands-on experience with building smart systems, and algorithmic trading felt like the perfect challenge. Since there’s real data, real complexity, and real-world impact. So far, it’s absolutely met my expectations. I’m learning a ton about coding best practices, cloud infrastructure, and how to design algorithms. I’m excited to see how our trading strategies perform in real-world tests. Thanks for following along, and stay tuned for more updates on Sean’s Syntax as we continue building this project!

Categories
Senior Software Project

The Tech Stack

Welcome back to Sean’s Syntax! Today I’m talking about tech stack for my algorithmic trading project. As I continue to work on this project I’m finding new tools to utilize. I’m going to cover my favorite and least favorite parts of my tech stack, aswell as one that was hard to learn but is worth it.

The best part of my tech stack: Python

Python is my go to tool because it’s simple, easy to read, and works for almost anything. We use it for backtesting strategies, optimizing performance, or analyzing data. Libraries like NumPy, Pandas, and backtesting.py are essential for working with financial data, and pymoo helps with optimization. There’s also a large community supporting the language, which makes learning and troubleshooting easier.

My least favorite part of the tech stack: SQL

SQL is useful but not my favorite. Writing queries, managing databases, and dealing with joins can feel tedious. Unlike Python, where I can be creative, SQL feels more rigid. Still, it’s necessary for handling large datasets, especially when working with historical market data. Even though I don’t love it, I know it’s important for organizing and retrieving financial data quickly.

Difficult to learn but well worth it: AWS

AWS was confusing at first. There are so many services, settings, and best practices. IAM roles, EC2, S3… a lot to learn. But once I got comfortable, I saw how powerful it was. AWS will make it easy to deploy and scale our trading algorithm application. With cloud-based execution, we can run backtests, store market data, and set up automated testing. Learning AWS has been very important to this project.

Categories
Senior Software Project

Coding Habits: Clean Code

Prompt: What is one thing from the articles that you would like to start doing (more often), and why? What is one thing you want to avoid doing and why?

Welcome back to my blog Sean’s Syntax. This week I will be researching and covering the principles of clean code and code smells. Both of these concepts are important for writing maintainable and scalable software. After reading the key ideas from Robert C. Martin’s Clean Code and Martin Fowler’s Refactoring, I have found some practices that i want to implement in my code more often and one I need to avoid.

One of the clean coding practices from Robert Martins Clean Code that I want to implement more is using descriptive and unambiguous names. As I am working with a team for my capstone project it’s important to create code that is easily readable and understandable to others. Martins talks about how these practices make the code self-documenting and help reduce excessive comments.

A good example is when creating this function below. I should have named it check_palindrome() instead of check_pal(). This would make it easier for others to understand the function’s use and search for it easily when needed. It also removes the need for the comment.

A coding practice I want to avoid is shotgun surgery. This bad code smell is identified by Martin Fowler in his book Refactoring is shotgun surgery. Fowler explains this as a single change that requires modifications across multiple classes or methods. This happens when responsibilities are poorly organized or too widely dispersed, making updates labor-intensive and error-prone (Fowler). I want to avoid this practice because shotgun surgery increases the odds of missing important updates and can make the codebase fragile.

Here is an example of the code smell: “if vault_name in vaults”. To fix this all i would need to do is refactors this to include a method vault_valid().

Refrences:

Martin, Robert C. Clean Code: A Handbook of Agile Software Craftsmanship. 1st edition, Pearson, 2008.

Fowler, Martin. Refactoring: Improving the Design of Existing Code. 2nd edition, Addison-Wesley Professional, 2018.

Categories
Senior Software Project

Creating Clouds: AWS Setup

Welcome back to Sean’s Syntax!
This week, I’ve been working on setting up an AWS Elastic Beanstalk environment for my groups trading algorithm project. While we haven’t deployed anything just yet, the foundation is ready. I’m excited to share what went into preparing this cloud.

Why Elastic Beanstalk?

AWS Elastic Beanstalk provides simplicity and scalability. It’s designed with great tools for hosting our Python-based trading algorithm application since it automates server administration, scaling, and load balancing. This lets us focus on building and optimizing algorithms and leaving the infrastructure to Elastic Beanstalk.

Getting Started

Here’s what I’ve done so far to get the environment ready:

  1. Platform Setup
    I selected Python as the platform for Elastic Beanstalk. It’s compatible with the tools I’m using like backtesting.py for the trading strategies. Elastic Beanstalk automatically provisions resources like EC2 instances, so all I had to do was pick the right options.
  2. Environment Configuration
    I set up the basics:
    • Created environment variables so we can plug in API keys and database credentials.
    • Set up Elastic Beanstalks real-time monitoring of performance.
  3. Preparing the Application
    Even though my group hasn’t deployed yet, Here is what the full structure of the application will look like. The app includes:
    • Application files for the trading dashboard.
    • A requirements.txt file listing all the Python libraries the app needs.
    • Config files for connecting to AWS services like RDS (database) and S3 (storage).

Next Steps

Now that the cloud environment is ready our next task is to deploy the app and start testing it in the cloud. Elastic Beanstalk will help with this and once the app is live, I’ll tweak the setup based on performance and scalability needs.

Categories
Senior Software Project

Algorithms For Stock Trading

Welcome back to Sean’s Syntax! I’m excited to share the latest on my algorithmic trading strategy project. This post is all about algorithms, optimization, and the tech that powers it—don’t worry, I’ll keep things simple and fun! Think of this as a peek into how we’re building the brains of a smart trading system, designed to help individual investors make smarter choices in the stock market. Let’s dive in!

Algorithms & Optimization: The Heart of the Project

In any trading system, the algorithm is the “secret sauce.” It’s responsible for figuring out when to buy and sell, with the goal of making a profit. In my project, the Algorithms and Optimization module is central. It’s where we create, test, and improve different trading strategies based on factors like price velocity, price acceleration, and market volatility (all that basically means is: we’re looking at how fast the price changes and how jumpy it is). This module also includes risk management tools, which help the system avoid big losses when the market suddenly gets rocky.

The Cool Part: A Genetic Algorithm

Our trading system’s algorithm uses a genetic algorithm for optimization. Think of it as a survival-of-the-fittest process, where we’re constantly testing new trading strategies to see which performs best. We do this by setting different configurations (like how many days we hold a stock before selling), then watching which setups make the most profit, minimize losses, and maintain a high win rate. The most successful setups “survive,” while weaker ones get left behind, just like evolution!

With this system, users can customize parameters like how many “generations” of strategies to test or the size of the “population” (which is just the number of different strategy versions tested at once). The goal? Finding that perfect balance between returns, drawdown, and win rate to beat a basic buy-and-hold strategy.

Performance Metrics: How We Measure Success

To know if a strategy is working, we track key performance metrics:

  • Sharpe Ratio: Shows how much risk we’re taking to get returns.
  • Maximum Drawdown: The biggest drop from the highest point to the lowest.
  • Win Rate: The percentage of successful trades.

We display these metrics in interactive charts to make it easy for users to see what’s working and where to tweak things. It’s like having a fitness tracker but for trading strategies!

That’s it for this blog! Thank you so much for reading and stay tuned for more progress.

Categories
Senior Software Project

Introduction To Sean’s Syntax

Welcome to Sean’s Syntax, my name is Sean and in this blog post, I will be introducing myself and the plans for this blog. I live in San Diego, CA where I was born and raised. Living near the beach has influenced my hobbies as I spend my free time surfing, diving, taking photographs, or messing with code.  I’m currently a senior at Oregon State University majoring in Applied Computer Science with the goal of becoming a software engineer.  

One of my photos captured in San Diego, CA

My blog will be about my senior software engineering project. Throughout the year, I will be going through the design, implementation, and testing of my project. While I’m building my project I will be documenting most of the process with this blog. There will be posts about coding breakthroughs, the ways I keep track of my project, and the occasional rant when things don’t quite go my way.

In each post, I’ll focus on a specific topic, whether it’s a new technology I’m learning or a challenge I’ve recently overcome. The idea behind this is to document the real ups and downs of working on a large software project. While at the same time, offering insights into anything that may be helpful for others.

Project Brainstorming

As I am waiting to hear back about which project proposal I will be chosen for, I want to highlight some of my favorite project proposals. My goal for this project is to work on something that is AI or algorithm-based. This is because I want to gain some practical experience with these topics while working in a professional environment.

My Top Project Proposals:
AI-assisted Features for BRI’s Growth Forge® Software
  • I’m interested in this project of building AI-powered features for BRI because it helps to turn fast data into effective insights. It will also help me expand my knowledge of integrating AI into existing software.
Cloud-Based Algorithmic Trading Strategies for Individual Investors.
  • I am quite excited about the project proposal since it teaches you about learning investment and algorithmic trading in-depth. While also providing you with hands-on building of a cloud-based trading application.
Leveraging AI for Improved Public Transit
  • I am super interested in the project because it incorporates AI into real-life applications that create an impact. It also provides the opportunity to learn from experienced data engineers.

So, here’s to a year of coding, learning, and documenting the progress. Time to get started!