StrategyQuant connects young talents with algo-trading

I would like to thank StrategyQuant s.r.o. for providing free licenses for the algorithmic trading club I run at my high school Střední odborná škola průmyslová a Střední odborné učiliště strojírenské, Prostějov, Lidická 4. The link to the thematic plan is here: https://spsasoupv.cz/vzdelavaci-projekt-analyza-datovych-sad-financnich-trhu/.

Let me introduce myself. I have been involved in algorithmic trading for several years, I know how complex the path is from the first idea, through the programming of algorithms to the final evaluation of whether the algorithms succeed in the live market. The latest algorithm I designed and rolled out myself works on XAUUSD and NAS100, is based on the SUPERTREND indicator and uses a maximum of a sevenfold increase in position if the trade ends in a loss. In programming the algorithm, I ran into imperfections in the code that had to be corrected, and I discovered how the indicators affect different quote times at different brokers. It took months to fine-tune the algorithm. Here are the outputs from my last algorithm:

My SuperTrend algorithm on NAS100

My SuperTrend algorithm on XAUUSD

I was already familiar with StrategyQuant from the past, and after being approached by students who wanted to take a course in algorithmic programming, the strategy building path in the SQ Program seemed the best for them. The collaboration with StrategyQuant s.r.o. has begun 🙂

The students and I started generating strategies using a genetic algorithm for currencies, indices, metals and stocks. Then we could see which markets were better and worse to trade algorithmically. We generated strategies mainly for timeframe H1. Several computers were running continuously in the school to generate strategies and then optimize them. We imported the generated source codes that passed the out of sample test into the MetaTrader 5 trading program. There we sorted the strategies from best to worst and started optimizing them on different data from different brokers. We chose to optimize on the 2018 – 2021 data with 1/2 of the data for optimization and 1/2 as an out of sample test. We sorted the out of sample test results by the highest profit factor and found among the first few rows of results that the optimization has a similar profit to the out of sample period. This fact proved that there was no over-optimization. Next, we ran the setup on the 2021 – 2022 data. It was found that each algorithm experiences slightly less profitability than the optimization and over time this profitability decreases from the optimized period.

Here is an example of optimization US500 on 2018 – 2021 data with 1/2 of the data used for optimization and 1/2 for out of sample confirmation:

Here is an example of US500 and a forward test setup on 2021-2022 data:

For each broker, we performed optimizations on its data, due to the fact that one broker, for example, quotes NAS100 twenty-three hours per day and the other one quotes NAS100 sixteen hours per day. We also found that it is best to do the optimization every two months on data from the last three years.

The result of using SQ is that the students did not need to know the issues of algorithmic trading in detail, including programming, and despite this they were able to construct a successful trading portfolio using the frameworks I had set for them to follow. Using the SQ program to generate strategies using the genetic algorithm speeds up the development of the algorithms several times over, and the user can be confident that the generated algorithms work without programming errors.

Lucas
Kornel Mazur

Kornel Mazur

0 Comments
Inline Feedbacks
View all comments

Continue reading

Timothy Masters Internal Profit Factor

clonexNovember 22, 2022

When evaluating the success of a trading strategy, a strategy developer can use a large number of strategy metrics. One of them is the profit factor. Profit Factor may be …

New indicators are available September 2022

clonexSeptember 22, 2022

We have added several new indicators and snippets to the sharing server in recent months. In today’s blog post, we’ll briefly go through each of them.   Ehlers Hilber Transform …