Preface
When developing strategies, many developers will write long and short strategies together in the same code, so there will only be one direction of the order at the same time. This is "integration" for developers, but they find that the strategies they develop are not easy to debug or may be over-fitting. So how should the strategies be developed?
Strategy portfolio
This is a long strategy:

This is a short selling strategy:

It can be seen that the sampling time period of the above two strategies is the same, and the strategy operation time zone size is also the same, but the performance is not very good visually.
Now what happens if we combine these two long and short strategies?
The combined strategy looks like this:

Eh, that looks good.
So why is this happening?
Strategy portfolio introduction
In last year’s (2022) crypto hedge fund report, we can see that multi-strategy is an approach used by hedge fund companies, and it is also the approach used by our MFT/LFT developers.
"Multi-Strategy" is to diversify investments into different strategies, for example:
Originally, there was only one strategy, and 100% of my funds were in this strategy, but the overall system risk was on this one strategy;
But now I have developed 10 strategies, and I only need to invest 10% of the total funds in each of them. The risk is spread over the 10 strategies, and the profit and loss margins and "timing" of each strategy may not be the same. This means that when a certain strategy loses money, other strategies may have the opportunity to make a profit to hedge the risk of the losing strategy.
This approach also has the same effect in preventing over-fitting: Simple divergence is better than combine.
You are a developer, what should you do?
Don’t integrate too much of the strategy’s logic together as conditions (the conditions don’t need to be too strict, as this will create a high probability of over-fitting).
Write the long and short strategies separately. Don't write the logic of long and short together at the beginning. Long and short should be separated. After all, closing a long position does not mean a signal to go short.
There are multiple strategies but the correlation is low, and to do backtesting, all strategies need to be run together (but please note that the funds must be dispersed for testing).
Replenish
Long / short strategy is also a kind of multi-strategy diversification, because long and short orders may be opened at the same time, or like in pair trading, they are opened at the same time; in this case, one party will make a profit and the other party will lose money, but what pair trading wants to make money from is the change in the rise and fall of the two pairs (convergence or divergence), so multi-strategy has another advantage: the two strategies have the opportunity to generate new alpha (excess return), which comes from the low correlation between the two strategies.

From the above figure, we can see that hedge funds usually use long/short strategy as their main profit-making projects, and mainly focus on long, that is, the long/short direction will be used as a separate strategy.
Summarize
When developing strategies, use multiple strategies, low correlation, decentralized writing, decentralized execution (run together), and separation of long and short positions as the main axes. This can prevent the chance of subsequent over-fitting in the first step, make the logic of each strategy clearer and simpler, facilitate debugging, and enhance the robustness and risk diversification of the strategy.