Part of my covid project and part of my long obsession with prediction markets, I have created a web page that displays and allows to compare best and worst performing trading strategies.
TL;DR: best stocks + best strategies -> the list of top and bottom performing trading algorithms.
Product
Typically, trading newsletters and stock-scanners display only price return for top market gainers and losers. I have forever been interested in inspecting top and bottom performing trading strategies for a given set of securities and could not find any websites that do that. So, I decided to create a tool of my own.
I wanted the tool that would help me to answer questions like if there is a better strategy than buy and hold, should I follow greed and fear indicator of the market or do the opposite.
Top and bottom performing securities do not tell you if a stock is going to go up or down, but they do alert you to rapidly changing market conditions, such as change in the competitive landscape, impending lawsuits, changes in the company's management and, at the very least, the stocks you should avoid in your programmatic trading.
Top strategies do all that, but they can also alert you to a change in the market regime. For example, MACD strategy, which is a variant of oscillator strategy, executed on Citibank stock returned 20% in the first half of 2020. In the same time period, the Citibank stock went down and "BuyAndHold" strategy, which is pretty much what it sounds, lost 45%. Now, compare that to the end of 2020 through spring of 2021, when MACD lost 1% and "BuyAndHold" gained 70%. This happened due to the change in the market due to the rally in financial stocks at the end of 2020. The market player who detect change in the market conditions first will reap most benefits.
Another example, TSLA since the beginning of 2021 until end of April lost 7%. The StopLoss strategy sells the position after abrupt price drop and waits until the price returns to the level before the drop. For the same time interval the StopLoss strategy gained 10%. In this particular example, StopLoss outperformed BuyAndHold. See the graph and table results below.
To me personally, the most important feature is the ability to quickly tweak and modify trading strategies and observe change in their performance. You can change strategies parameters on the fly and even design your own custom trading strategy.
In the end, I developed a tool I can use for myself but hope other investors who are experimenting with trading algorithms will find it useful as well. I called it "Profit and Loss AI", or PnL.ai for short.
PnL.ai Description
The web-tool in the link below allows you to customize parameters of existing strategies and essentially create your own strategy and seeing how it will compare to the set of original strategies.
http://ec2-54-185-19-38.us-west-2.compute.amazonaws.com:5006/srv
- In the section above you can specify security and data range.
- In the section below you can choose strategy to customize and modify it's parameters.
- The strategy comparison table will automatically update and will display a newly created strategy side by side with the original strategies.
Technology
The tool is developed on bokeh and python and allows you to edit configuration parameters of each strategy all without programming knowledge.
The strategies are fully specified via key/value pairs in the format of ini files used to initialize programs. The strategy classes are autogenerated by reading the ini config files dynamically using "factory" pattern.
You can find a simplified code in this github repo: https://github.com/varturas/PnlAITk
Next Steps
You can receive daily newsletter with the list of trading strategies generated by above-mentioned web-tool by registering on http://pnl.ai/ and checking subscribe checkmark.
Comments
Post a Comment