Hello everyone,
I’ve been developing a risk management algorithm that adjusts the stop-loss dynamically based on previous trading performance. This algorithm responds to the trading results, expanding the stop-loss during winning streaks and contracting it after losses, allowing for more calculated risk-taking while aiming to preserve capital.
I’ve included two charts below to illustrate how this works:
- Top Chart: Trade outcomes over time, demonstrating a mix of winning and losing streaks.
- Bottom Chart: The stop-loss percentage over time, dynamically adjusting to the results of previous trades.
Additionally, I’ve shared the test data (visible in the screenshot) that reflects various market scenarios such as:
- Strong winning streaks
- Choppy market conditions
- Sharp reversals to losing streaks
- Sudden large losses
- Recoveries after losses
You can correlate the graphs with this test data to better understand how the algorithm responds in different market conditions.
Key features:
- Increases stop-loss after winning trades, allowing for more risk.
- Reduces stop-loss after losses, limiting further risk exposure.
- Minimum stop-loss is capped at 2%, ensuring a base level of risk management.
I’d love to hear your thoughts on this approach. Does this dynamic stop-loss strategy align with your risk tolerance and trading style? Are there any improvements or tweaks you would suggest?
What is the duration tested. What is the % of Profit and Loss trade. What is the pay off.
Best wishes thanks.
Hi Kasran! Thank you for your insightful questions.
I ran the simulation on the test dataset, and here are the key results (I’ve also attached the results in graph form in my original post):
- Duration Tested: The dataset includes a total of 41 trades.
- Profit and Loss Distribution:
- Win rate: 63.41% of the trades were profitable.
- Loss rate: 36.59% of the trades resulted in losses.
- Payoff Ratio: The average payoff ratio is 0.54, meaning that for every unit of loss, the corresponding profit is 0.54 units. This suggests that losses are typically larger than profits in this simulation.
The algorithm is designed with a long-term focus on increasing and preserving capital. The idea is to dynamically adjust risk based on performance: during a winning streak, the risk-taking ability increases, allowing for greater leverage, while during a losing streak, the risk appetite decreases to protect the core capital.
There’s a “secret sauce” within the algorithm to fine-tune the exact rewards for a trader’s previous profitable trade and the penalties imposed for a previous loss. The core of the algorithm lies in finding the right balance between how much extra reward should be given for a win and how much penalty should be imposed for a loss. This precise adjustment ensures the right incentives for winning trades and risk mitigation during losing periods.
hi Many thanks. My question about time frame 15 min, D, W or Monthly. for How many days or years you have tested. Thanks
I have tested this on D time frame as this algorithm is designed for swing traders for now
and I ran a simulation of 100 trades with random profit and losses