My Portfolio

RTE - Assistant Project Manager

RTE is the French public company that manages the high-voltage segment of the French electrical grid. During my time at this company, I worked in the substation department, which is responsible for managing electrical substations (nodes and transformation areas within the network).

Database Management

As part of the departure of the asbestos project manager in the substation department, I took over all of their work to update the company's database and ensure that their successor could continue and complete the ongoing projects. To achieve this, I:

- Analyzed the asbestos project processes and the expected deliverables at each phase.

- Proposed a classification system to my supervisors, ensuring easy access to these data for company members.

- Searched through their computer and email inbox to retrieve and categorize all documents related to their work.

- Maintained a detailed list of all projects and their progress to facilitate a smooth handover to their successor.

RTE has chosen to centralize its quality controls on a platform. Standardized questionnaires are written for each type of inspection, focusing on the key control points. For each control point, the result must be explained as either compliant, non-compliant, or not applicable in that particular situation. The company’s quality control policy is as follows: always check the site plans used for project planning, major or critical modifications, significant purchases, certain companies, and key sites. In this role, I:

- Familiarized myself with the company’s control policy and drafted a summary for personal use to ensure I adhered to it as closely as possible.

- Set up the required inspections on the company’s control platform.

- Reported non-compliances to the companies for correction.

- In the beginning, I used these inspections to understand the company's expectations and ensured I reviewed all services completed for the first time.

Quality Control

In a major renovation project at the Lannemezan site, there was an old transformer that needed to be replaced. I was responsible for this part of the project. Since the amount involved was significant, the awarding of the contract required a consultation with at least three companies, and the choice had to be justified to ensure proper use of public funds. For this task, I:

- Drafted the project specifications, set the response deadline, selected the companies to consult, and contacted them.

- Analyzed their responses, chose the two most promising ones from the four companies consulted, and scheduled a meeting with the project manager.

- Planned the management of the asbestos-containing part of the transformer (gasket).

- Drafted the contract and scheduled the project.

- Supervised the proper execution of the service and attended the resale of materials.

Consultation for Service Provider Selection

Project Management (around 2 million euros)

Planification phase

Due to the significant number of photovoltaic parks in the Nouvelle-Aquitaine region, large discrepancies between production and consumption have been observed (with an annual average of 20% overproduction). To prevent premature wear of the network caused by this overproduction, which leads to voltage fluctuations exceeding the tolerance limits of devices, the installation of 6 reactors at strategic locations within the network has been decided.

The project to add a reactor was incorporated into a project for the renewal of the control devices at the substation and some other equipment. As this made the project much more expensive, it was transferred to my project manager’s supervision. Therefore, I:

- Assessed the current progress of the previous project (Planification phase).

- I listed the services required for the updated version of the project.

- I planned the key milestone meetings with the project team to ensure that the modifications to the initial project could be executed.

Since the project was still in the study phase, no planning had been done, and the addition of the reactor had little impact.

For projects of this scale, contracts are negotiated by the purchasing department based on the requirements that have been communicated. A contractor will be selected to carry out the work, and additional services may be provided by other companies if necessary. The chosen contractor provides a detailed cost estimate as well as a project schedule. I reviewed these deliverables, paying particular attention to the schedule (Gantt chart), which is a crucial element of the project. For this, I checked the following points:

- All site interventions, as well as the company responsible for each task.

- The sequencing and/or simultaneity of interventions.

- The project’s high-risk or particularly complex phases identified by the project manager and/or RTE.

- Deliverable milestones, meeting points, and stop points necessary for RTE's project management.

- The start of the work, completion of RTE’s asset database updates, submission of plans, compliance checks, commissioning, testing, and operation start.

- Work acceptance procedures.

- The deadlines for placing orders.

- Any other interventions on-site for other projects.

- The necessary shutdowns.

- Temporary works and special means (temporary connections).

I then contacted the company to have the non-conformities on the two documents corrected. I reported the non-conformities on RTE's centralized control platform and validated the corrections.

I then managed the final steps of the planning phase:

- Selection of the Safety and Health Coordinator (different from the works manager).

- Contract drafting.

- Writing the observation summary (communicating with all project stakeholders to gather their feedback before the study phase begins).

Study Phase

I then managed the study phase. For this type of project, the company follows a specific process. Three files must be completed:

- One related to planning.

- One related to feasibility studies.

- One summarizing the study phase and preparing for the construction phase.

Some documents are expected from the chosen contractor. In this case, I:

- Monitored the deadlines for the documents to be submitted with the contractor.

- Checked the submitted documents.

Some documents are produced by RTE. In this case, I:

- Researched each document to understand how to complete them.

- Contacted the project team members responsible for certain documents.

- Filled out the documents that I could complete.

- Had each document approved by the company's supervisors.

- Organized a meeting with the stakeholders and project managers to validate the study phase.

- Addressed the non-conformities raised during the study phase, finalized the phase, and informed the project stakeholders.

Above is an example of the study phase tracking document, serving as a guide for the study phase.

Construction phase

The majority of the work was planned with the main contractor for the site, except for the main components, for which delivery, installation, and adjustments would be carried out by the specific manufacturer. The components included:

  • Circuit breaker

  • Busbar disconnectors

  • Reactor

I managed the orders for these components to align with the project schedule. I also monitored the progress of the work. My main tasks included:

  • Regularly contacting the main contractor, especially after the delivery dates of key services, to ensure proper execution. Informing companies when different services were being performed by different contractors simultaneously, and ensuring proper coordination was in place.

  • Making sure that the services needed for tasks carried out by third-party companies (such as concrete foundations for main elements, low-voltage control panels, and adjustments after installation) were completed.

  • Monitoring the main tasks and safety measures during high-risk activities (close to live lines).

Since the project proceeded smoothly, this phase was relatively easy to manage.

Thales - Project Manager

The company's building was constructed in 1970, reflecting the work practices of that time, with many large individual offices. Thales AVS Toulouse would like to renovate its site to better meet the current needs of its teams:

  • The need for space optimization, the company is growing.

  • The desire to improve the ergonomics of workstations.

  • The need for spaces adapted to the specific requirements of the teams.

A budget of 800,000 euros was allocated in the 2018 budget for the start of the renovation work.

The project's progression was presented to me as shown in the scheme below, with different phases, each requiring validation from specific stakeholders. The choice of the company that will manage the site modification work has already been made. It is the company with which Thales has an existing contract for site management. Only the companies supplying the office furniture are yet to be selected.

The priority renovation services were outlined as follows by the site director :

  • FLX department near the demo area, with the goal of turning it into a showcase to secure more budget and continue renovating the site.

  • A work café near the demo spaces.

  • The marketing team’s area, which is a growing, newly established, and high-performing team.

Expression of Need Phase

The requirements were stated by the site director, so I began the necessary work to understand and address them. To achieve this, I met with the teams. Initially, I needed to:

  • Get to know the teams.

  • Inform them of my task.

  • Identify each department.

  • Precisely define the space allocated to each department.

  • Appoint a contact person within each department.

The black stars represent the locations of priority renovation services

I then designed a questionnaire in the form of a simple Google Form for easy completion, aimed at understanding the specific needs of each department. I needed to know:

  • The current staffing levels and projected growth.

  • The teams' work habits (meeting time? How many people? Time spent working together? Time spent at the desk?)Their specific work needs (e.g., client demo space).

  • Their typical week.

  • What their ideal workspace would look like, according to them.

  • Whether any changes in their work habits were anticipated.

  • Their confidentiality requirements in relation to other departments or potential visitors.

I made sure to emphasize that the care taken in responding to this questionnaire would have a direct impact on the quality of their future workspace. I intentionally designed the questionnaire to be as thorough as possible to ensure the best results.

Initial Design Phase

To get started, I began designing the project for the main part of the site, the FLX department (around 30 people and growing). This project was intended to be a showcase for the broader site renovation, at the request of the site manager. I created 2D plans based on their Google Form responses as an initial proposal. Then, I met with the project representative to discuss what would work well. The goal was to implement all the elements they wanted to create the ideal project. I used this first draft to assess the feasibility of such a project (budget, construction, scheduling) and better understand how to adapt this ideal plan to what’s actually achievable. I had to use software approved by Thales for these plans due to confidentiality reasons. Therefore, I cannot share the actual renovation plans. Instead, I will use representative examples to explain my work.

The 2D plan was first reviewed with the relevant team for validation, and some modifications were made as a result. Next, a meeting was held with the on-site contractor to evaluate the cost and feasibility of the project. At that point, the project exceeded my total budget for the year, so I had to find ways to reduce costs. As expected, I aimed for an ambitious initial design to obtain a detailed cost estimate. This allows us to cut the budget later with the relevant team, explaining the necessary budget limitations to follow. Here are the options to minimize the budget as much as possible:

  • Minimize structural changes: With the space layout approved, the goal now is to arrange areas in a way that requires the least structural modifications.

  • Reuse materials as much as possible: To achieve this, I listed and measured the existing office furniture and materials available on-site for reuse. The priority will be to use these items in a practical and aesthetically pleasing way.

  • Focus on ergonomics and comfort of workstations rather than aesthetics of workplace.

Building on the knowledge gained from designing this project, I created the initial design for the other two projects based on the same principles. For the marketing team, there was one unique requirement: an immersive client presentation room with a complete projection/audio system and high-end furnishings, located near the central corridor.

Regarding the break/coffee room, management explained their decision not to turn this space into a game room. The goal is truly to allow for rest and a break from the work environment. The chosen concept includes warm, eye-friendly lighting, green and natural decor to create an outdoor feel, relaxing background music, a whiteboard, and a few comfortable seats.

Validation

Next, it was necessary to have everything approved by the site manager and supervisor. To accomplish this, I scheduled a meeting with executives, team representatives, and the site works manager. In this meeting, I presented:

  • The budget (with a broad margin for equipment supply)

  • 2D plans

  • Work estimates

I also took the opportunity to relay the latest requests and specific comments from each participant (similar to an RTE). Having everyone present allowed us to discuss each team's needs for the successful execution and completion of these projects.

The initial design phases are completed and approved. I have now finalized the design plans. To accomplish this, I:

Final Design

  • Incorporated the latest requests raised during the validation meeting.

  • Finalized the plans.

  • Completed the detailed project documentation for the supplier consultation dossier.

Office Furniture Supplier Consultation Process

Although the consultation process was largely guided and supervised by the sales department, certain strategic choices were made at our request. Specifically, the use of a maximum budget rather than a price range, explicit selection criteria, and guidelines for design proposals and color choices.

  1. Define Needs

    • Clarify requirements: furniture types, quantity, style, ergonomic needs.

    • Set a budget maximum.

  2. Research and Shortlist Suppliers

    • Research potential suppliers.

    • Shortlist based on product offerings, reputation, quality, and pricing.

  3. Initial Contact

    • Reach out to suppliers.

    • Provide an outline of needs.

    • Present projects.

  4. Request for Proposal (RFP)

    • Set selection criteria.

    • Set answer format.

    • Establish response timeline.

    • Send an RFP with all needed information.

  5. Supplier responses

    • Invite suppliers to present offerings (in person or virtually).

    • Evaluate product samples or visit showrooms if possible.

  6. Evaluate Proposals

    • Review proposals based on criteria pre-set.

    • Negotiate terms if needed.

    • Chief validation.

Detailed Schedule

During the supplier consultation process, the work schedule was developed. The supplies will be delivered last. The timeline has already been discussed with the on-site project manager. It involves coordinating the team’s relocation to ensure work continuity. Prefabricated outdoor offices will be installed to accommodate the teams until the new facilities are available. The work needs to be completed as quickly as possible, so it will begin at a time that allows the on-site contractor to perform the tasks in a linear sequence, with supply delivery following shortly after the projected completion date. Installation will also be managed for the on-site contractor. I then created the schedule (Gantt) myself and validated it with the on-site contractor.

Final Approval

Once the schedule was detailed, contractor feedback analyzed, and final 3D plans completed, I called a meeting with the leadership team to present the final projects and the planned execution, along with the necessary purchase orders and contracts for signature. With the project fully planned and no additional budget allocated for site renovation next year, there was no further need for my involvement until the start of the work, scheduled in several months.

Real Estate Consultant – Contractor

Study Phase

By chance, while job hunting after my contract at Thales, I met a real estate agent who told me about a market inefficiency in the city where I lived, Toulouse, France. There were still neighborhoods and apartments in the city, well-located in terms of public transportation, selling at very low prices. So low that, when converted into shared rentals, the tenants' rent would easily cover monthly payments on a 25-year loan—easy to obtain in France at that time. I decided to do some research.

Above is the map of Toulouse's metro and tram lines. As you can see, Line A indeed passes through two areas with low rental prices, yet still provides quick access to the city center (universities and schools). The prices in these areas are averages; there are significant price variations within each zone depending on the age of the apartments. Indeed, you can find older apartments near metro stations at very low prices (80,000 to 140,000 euros for apartments ranging from 45 to 100 square meters).

Amouroux

I chose Amouroux, a neighborhood with several hundred nearly identical older apartments: two types of one-bedroom units, one type of two-bedroom unit, and one type of three-bedroom unit, all within a five-minute walk from Metro Line A.

There you can find apartments at very low prices (80,000 to 140,000 euros for apartments ranging from 45 to 100 square meters). As an agent, I can earn up to 10% of the sale price, and as a contractor, I can retain the entire amount. If I can offer apartments that are self-financing, I’ll likely be able to sell at a good price and earn several substantial commissions.

Prospecting

My next task was to find people willing to entrust me with the sale of their apartment. The biggest challenge I faced was that French people are constantly bombarded by advertisers and tend to have a very poor opinion of real estate agents. Across all methods, I had to find ways to build trust with people before even discussing any business. To achieve this, I employed several approaches:

Sale Listings

This method is challenging because anyone who posts an ad online is typically bombarded by real estate agents (often 80% or more of the calls they receive). What worked best for me with this method was not presenting myself as a real estate agent at first. Instead, I would ask questions about the progress of the procedures required for the sale and eventually share my experience selling apartments in the neighborhood.

Advertising

This method is straightforward to implement and can bring in some clients. I used two approaches here:

  1. Flyers distributed in mailboxes.

  2. Display signs on apartments I was managing.

In-person Prospecting

This is relatively simple but takes time to yield results. However, it can become a significant source of leads. For this method, I spent time in the neighborhood and engaged with people—doing my shopping, participating in activities or events, and simply taking walks. This method works extremely well but requires time to develop a good understanding of the area and its residents.

Referral Incentives

This method involved offering money in exchange for any recommendations that led to a sale. To implement this, I contacted local artisans and shopkeepers and shared the idea with people I had gotten to know in the neighborhood.

Prospecting is an ongoing task, something you do whenever you’re not occupied with an active deal. To improve in this area, I developed the habit of recording myself speaking to review my approach, researching techniques, and experimenting with different methods.

Creating the Offer: The Investor File

The business idea was as follows: In the neighborhood, shared rental rooms could be rented out for €400 to €450, while apartments were selling for between €80,000 and €140,000. With a 25-year loan at around 2% interest (easily obtainable at the time in France for two individuals with long-term employment contracts and modest salaries slightly above minimum wage), it was possible to propose a buy-renovate-rent project where rental income would fully cover the loan's monthly payments. Here is the process:

Renovation Estimate

Once the apartment was under management, the first step was to create 2D plans, identifying load-bearing walls, radiators, electrical outlets, and water drainage circuits. Based on these, modified plans were designed to convert the apartment into a shared rental with as many rooms as possible, minimizing structural modifications to reduce renovation costs. Finally, 3D renderings were created to visually showcase the final result for both renovation and marketing purposes.

Photo 3D HD Bathroom

Plan 3D Project

Plan 2D Project

Plan 2D Base

Photo 3D HD Room

Photo 3D HD Kitchen

Furniture and Equipment Costs

This step involved estimating the costs of furnishing and equipping the shared rental using the IKEA and Electrodépot catalogs for new items. Drawing on my experience and research into numerous shared rentals, I also advised on room features: higher-end amenities allow for higher rents and better profitability. Each room was equipped with individual TVs, ample storage, and quality beds. Additional perks like Netflix, high-speed internet, and fully equipped kitchens (including large refrigerators, washing machines, and dryers) enhanced the rental's appeal.

Purchase Fees

These primarily included notary fees, a mandatory legal process in France for transferring property ownership. These costs are regulated and easily estimable online using the apartment's details.

This process provided a clear estimate of the total project cost for the buyer, typically ranging from €120,000 to €200,000.

Monthly Expense Calculation

The next step was to calculate the project's monthly expenses, which included:

Loan Payments

Easily estimated using online mortgage calculators for the total loan amount. Buyers could also choose to cover part or all of the cost upfront.

Operating Expenses

After managing several projects in the same neighborhood, I could reliably estimate utility costs and homeowners’ association fees. High-speed internet and Netflix subscriptions were also included to maintain the rental’s high standard. Insurance costs were calculated using online insurance broker platforms.

Property Tax

This annual cost is publicly calculated and easily converted into a monthly amount.

These figures allowed me to determine the project’s total monthly expenses.

Revenue and Profitability

By estimating the rental income based on local market rates, I could calculate the net monthly profitability of the project. This method enabled me to sell multiple rental investment projects where, at a minimum, the rental income covered all operating costs. Buyers effectively acquired apartments at no net cost to them, while I successfully sold apartments at good prices and earned substantial commissions.

Establishing Partnerships

This entire process involved collaboration with various stakeholders:

  • Craftsmen for the estimation and execution of renovation work.

  • Loan Brokers for calculating monthly payment estimates.

  • Notaries for handling the official property transfer procedures.

In the same way I offered incentives to people who helped me secure sales, I sought to work with professionals who would reward me for bringing them clients. For each phase of my projects, I met with and tested collaborations with various professionals to identify partners who delivered quality work and offered incentives for referrals—whether for a client renovating an apartment, seeking a loan for a purchase, or making a property purchase.

These partnerships not only streamlined my workflow but also increased my income through these additional

The End of the Opportunity

After approximately two years of taking advantage of this opportunity, its profitability unfortunately declined significantly due to several factors:

  • Drop in Rental Prices for Shared Housing: The increase in the number of shared rentals in the neighborhood led to a decrease in rental prices.

  • Sharp Rise in Interest Rates: This caused monthly loan payments to increase by about 50%.

  • Soaring Energy Costs: Triggered by sanctions against Russia, these costs further reduced the profitability of these older, energy-inefficient apartments.

  • Changes in Loan Eligibility Rules: Previously, rental income was considered part of your overall income, minus expenses. Banks used this to calculate your savings capacity and determine the loan payments you could afford. This system allowed buyers to acquire multiple properties that generated more income than their costs. Today, this is no longer possible.

These factors ultimately pushed me to move on to a new project.

Quantitative Trading

During my experience in real estate, having saved some money, I began exploring investments and trading. With a friend, we invested in a trading bot that turned out to be a scam. However, it inspired us to create our own trading bot. He then offered me some money to help him build a trading bot.

My idea was straightforward: there are countless traders using a wide variety of strategies and indicators. This diversity means numerous opportunities in the markets. By leveraging automated backtesting, I believed I could identify strategies that could be implemented algorithmically.

Study Phase

Before and during this period, I read numerous books on the subject, summarized them in writing, and tested all the information and ideas they contained. Here is a list of the books that supported my work.

  • How I made a million $, last year, trading commodities, Larry R. Williams

  • Long term secrets for short term trading, Larry R. Williams

  • The Definitive guide to Futures Trading Vol 1., Larry R. Williams

  • The Definitive guide to Futures Trading Vol 2., Larry R. Williams

  • Trade Stocks and Commodities with the Insiders, Larry R. Williams

  • Algorithmic trading, Ernest P. Chan

  • Quantitative trading, Ernest P. Chan

  • A Complete Guide To Volume Price Analysis, Anna Coulling

  • The Wyckoff methodology in depth, Rubén Villahermosa Chaves

  • The new money management, Ralph Vince

  • Trading in the zone, Mark Douglas

  • Technical Analysis of the Financial Markets, John Murphy

I also followed numerous traders through interviews and training courses, always applying the same methodology: taking notes and testing.

Trading Simulation

On the advice of Professor Ernest P. Chan, I used MATLAB for automated backtesting. The first challenge I faced was simulating trade execution, including entry and exit points. How is this translated algorithmically?

Essentially, the algorithm analyzing historical price data operates in two possible states:

  1. Neutral State: In this state, the algorithm monitors the data to determine whether entry conditions are met.

  2. In-Trade State: Once the entry conditions are satisfied, the algorithm transitions into an active trading state. At this point, it records the entry price along with the stop-loss and take-profit levels defined by the strategy.

In the in-trade state, the algorithm stops evaluating entry conditions and instead focuses on managing the stop-loss and take-profit values based on the current price and the exit strategy. When the price either hits the stop-loss, the take-profit, or the exit conditions are met, the trade results are recorded. These results are stored in an additional column appended to the price data's DataFrame, making them easy to manipulate and analyze afterward.

Thanks to this process, I was able to test complex strategies entirely automatically. Here is an example of how it works.

Once the methodology was established, I tested:

  • The most well-known indicators with various settings.

  • Different exit methods (time-based, indicator-based, or a combination of both).

  • The strategies and methods presented in the books.

I chose to learn algorithmic trading in the cryptocurrency market because:

  • Real-time data is free.

  • API usage is free.

  • More data is accessible.

Algorithmic trading in traditional markets typically costs at least 500$ per month, which requires a significant capital base and high profitability to cover operational costs.

The Trading Bots

As I had hoped, this approach allowed me to discover numerous strategies that performed well on historical price data. My next task was to code a bot that would execute these strategies in real time.

A trading bot consists of three main components:

1. Data retrieval: Collecting price data and any other information required by the strategy as soon as it becomes available. This is achieved through requests to APIs provided by relevant data providers.

2. Strategy execution: For example, "if buy conditions are met, then take action."

3. Order execution: Sending trading orders via the API of the chosen trading platform.

I chose Python for creating trading bots because most APIs are compatible with it.

Initially, I attempted to build a program that would run continuously in a loop, updating price data every few seconds and executing strategies accordingly. The code looked something like this:

The issue I quickly encountered with this type of bot was unexpected interruptions. When interacting with an API, errors occasionally occur. On an operating system, parallel tasks (such as network updates) sometimes run. Many unforeseen events can disrupt the program, and unless you code a response for each of these events, the program will stop. To address this, I used a task scheduler:

Advantages:

  • Keeps your computer's resources free when the program isn't running.

  • Can automatically restart in case of an error.

Drawbacks:

  • When the program starts, it has no knowledge of previous actions. You need to add a section in the code to assess the current state (e.g., "Am I already in a position? How much have I purchased? How long have I been in this position?").

Since APIs do not update quickly, the solution I found was to have these algorithms log their actions in a text file. With each new execution, the program reads this document and acts accordingly. Another tool to implement for simplifying code is working with functions. In the example here, the function (def function() ) is included in the same script. However, functions can also be created in separate scripts and called by your algorithms. This approach helps simplify your code, avoids the need to rewrite the same code multiple times, and reduces the risk of errors, which can be challenging to identify in large scripts. Additionally, presenting your code in a clear manner (with proper spacing and explanatory comments) is essential. When working on different algorithms with hundreds of lines, a clean and organized structure makes the work significantly easier. That part of the code looks like this (on the right):

The Data Snooping Bias

At this point, I was easily finding strategies that performed well in backtests but failed in real trading. This is when I understood what data snooping bias was.

What is data snooping bias, and how can we identify it?

To identify whether I was falling into the data snooping trap, I tried backtesting parameters that produced profitable strategies on one set of data, then applied them to a different data set. What I found was that the parameters identified as "winning" were not consistent. Testing these "winning" parameters on the second dataset failed to deliver good results.

What does this mean?

When you test an enormous number of parameters on a dataset, as I was doing, you increase your chances of finding something that worked on that specific dataset by chance. However, this reduces the likelihood of creating a strategy that performs well in real-world trading.

An example to illustrate:

Suppose I test a strategy using 3 years of historical data for a stock. Let’s say I base my trades on arbitrary parameters like the weather, the color of the T-shirt of the first person I see, the first letter of the first word I hear in the morning, and the exact time I wake up. Based on these parameters, I decide whether to buy in the morning and hold the position for 1 to 20 days before selling.
With enough random parameters, it is highly likely that I’ll find some combination that would have made money during the chosen 3 years. However, this has little chance of working in the future.

This is what I was doing in my research: testing so many parameters that I ended up finding statistical anomalies. These anomalies were not reproducible and did not provide any statistical edge in the markets.

This realization forced me to overhaul my entire backtesting methodology and focus on statistical principles. Here’s what I changed:

1. Validation on Separate Data Sets:

  • First, find profitable parameters using one dataset.

  • Then test these parameters on a completely different dataset. Only the results on the second dataset count.

2. Focus on Robust Results:

  • The more consistently positive the results across multiple tests, the better the strategy.

3. Large Sample Sizes:

  • The more trades a strategy generates during testing, the more reliable the results.

4. Minimize Variables:

  • Test as few different variables as possible simultaneously to avoid overfitting and statistical noise.

This made the testing algorithms more complex because, in addition to selecting the parameters, the data had to be split. Here’s what the process looked like:

  • Data Splitting: Divide the historical data into separate sets (e.g., training, validation, and testing).

  • Performance Criteria: Establish minimum performance thresholds to identify "winning" parameters during the initial tests.

  • Validation: Only the parameters that meet the criteria are tested on the other datasets to confirm their reliability.

This additional step added complexity but ensured that the strategies were more robust and less likely to be influenced by statistical anomalies or overfitting.

Speed Optimization

Having moved on to a new, more complex testing phase, it was time to focus on execution speed. How do you approach this?

1. Research: Gather knowledge about efficient coding practices, algorithmic complexity, and performance optimization techniques.

2. Testing: Implement changes and measure their impact on performance, iterating until the desired speed is achieved.

The first key principle is to minimize the number of operations and the size of the data being processed. For example, if you need to use a specific value from a DataFrame multiple times in your program, assign that value to a separate variable instead of repeatedly accessing it from the DataFrame by referencing its position. This method allowed me to increase the execution speed of my programs tenfold.

The second key is parallelization. This involves maximizing the usage of your computer's hardware components. For instance, my computer has 4 processors and 8 threads. By default, the computer will use only one core, processor, or thread to execute your program. I need to explicitly specify that, for a certain portion of the code, I want the calculations to be performed in parallel.

The parallelized section works as follows: instead of testing the different parameters one by one, it tests several in parallel. This requires minor adjustments to your code but is relatively simple to implement.

Below is an example of parameter testing. Here, I create an array containing all possible parameter combinations based on the selected ranges and parallelize this loop. All iterations within your program can be parallelized in this way.

Other solutions to explore:

Here, we are only discussing parallelization on processors, which typically have 2 to 8 cores on standard computers. It is possible to rent servers with processors featuring up to 100 cores, significantly increasing execution speed. Additionally, one can parallelize on GPUs, which are specifically designed to handle a large number of calculations in parallel, typically ranging from hundreds to thousands of cores.

GPU

Using NVIDIA GPUs, which are compatible with MATLAB, is a straightforward option. However, leveraging other GPUs often requires switching to different programming languages. Therefore, I decided to experiment with backtesting using Fortran and C++ to utilize my computer's GPU.

The primary difference between these languages and Python or MATLAB lies in variable declaration. Furthermore, these languages require more effort to find resources and are more complex to install and configure.

I encountered issues in Fortran that I could not resolve. While the results of the initial loops were accurate, they deteriorated over time. On the other hand, C++ delivered promising results, allowing for another 10x increase in execution speed.

Conclusion

This backtesting method allowed me to identify several strategies from Larry R. Williams' books that produced reproducible results across different datasets on Bitcoin.

Risk

Risk refers to the maximum amount you could lose on a single trade. Typically, traders use a percentage of their capital for this. Each strategy has an optimal percentage that maximizes returns. Naturally, the higher the percentage of your capital you risk per trade, the greater the potential gains.

However, the downside is that losses grow proportionally as well. The percentages of losses have a more significant impact than equivalent percentages of gains. For example, if you lose 20% of your capital, you need a 25% gain to recover. If you lose 50%, you need to regain 100% to break even. Thus, increasing your position size excessively will eventually nullify your gains.

Generally, the ideal percentage risked per trade falls between 5% and 20%. I decided to deploy the trading bot with settings that maximized gains while limiting the drawdown to 50% of the capital in the test datasets.

Results

To ensure continuous operation regardless of my activities, I installed these algorithms on a server. This setup provided a flawless runtime over six months and yielded a performance of approximately 120%.

Challenges Encountered

After this period, and a withdrawal of part of the gains, the bot experienced a big drawdown—20% more than the maximum calculated from historical data. It seems that while it's possible to somewhat reproduce performance with a method defined on historical data, one must expect scenarios that have never been encountered before, with certainty. Gaetan Housel explains in his book that throughout history, unpredictable events occur regularly and with certainty. It seems that this also applies to trading, and it is safer to set risk parameters with a significant margin to avoid a loss that would be too difficult to recover from.

Additionally, the server costs require a minimum profit to make operating such a bot financially viable, which necessitates a certain amount of capital.

Lastly, an NVidia GPU can greatly assist in research work. I have since stopped this bot because I needed the money, but I continue to work in this field because I enjoy it.

What I Learned

  • I learned English by reading books, studies, and listening to the best speakers on the subject, who, in trading, express themselves in English.

  • I learned programming in Python, MATLAB, and C++. I am now able to automate many tasks.

  • I learned how to learn, understand who the right people to listen to are in a field, gather valuable information, and apply it to my work.

  • I learned a great deal about the markets and developed skills that I am sure will benefit my personal life and serve my future employer.