The last Predefined Algorithm tested in 2024!? The VWAP Strategy (Patreon)
Downloads
Content
This post is probably the last one that I will do concerning algorithmic trading strategies that you can readily download from the Internet for the Freqtrade bot. Some of the more important reasons are that most of the files you can download are just version or iterations of older ones, are just not good (and more experiments), contain many errors so debugging and fixing takes too much time and effort, and also not compatible anymore with the current and future versions of the Freqtrade trading bot.
I’m not completely guaranteeing to never download these algo files and test them anymore. Because it could be a missed opportunity if it suddenly happened to be a real good one. But I want to focus my energy more to these Youtube video’s or other Blog posts on the internet where big promises are made and want to test these strategies to find out if they are really worth your (and my) time.
Nonetheless, let’s do this ‘show’ one more time with this VWAP-based trading strategy. Thank you author @jilv220 for creating this one!
This algo revolves around leveraging the Volume-Weighted Average Price (VWAP) and related technical indicators to identify profitable trade opportunities.
Here's a detailed breakdown of the strategy's setup, including its essential settings, key indicators, and the buy/sell logic:
Basic Settings
ROI (Return on Investment): The strategy sets a minimal ROI target of 2%, encouraging quick turnaround trades.
Stop Loss: The stop loss is set at 15% below the entry price to protect against significant losses.
Timeframe: The strategy operates on a 5-minute timeframe, which suggests it is optimized for short-term trading and quick market movements.
Indicators Used in the Strategy
VWAP (Volume-Weighted Average Price): A rolling VWAP calculation with standard deviation bands (high and low) is employed. These bands provide dynamic support and resistance levels:
CTI (Chande Trend Index): A momentum oscillator that measures price trends. It helps identify overbought and oversold conditions.
RSI (Relative Strength Index): 14-period RSI: Evaluates short-term price momentum and overbought/oversold conditions.
84-period and 112-period RSI: Used to confirm longer-term trends and add depth to trend analysis.
TCP Percent Change: Measures the percentage change of the current close from the maximum open price over a specified look-back period (4 candles).
Volume: Ensures that trades are only placed when the market has sufficient trading activity.
Buy and Sell parameters
The strategy triggers a buy signal when the following conditions are met:
Price below VWAP Low: The current close price must be below the lower VWAP band, indicating a potential undervalued condition.
Positive TCP Percent Change: A >4% change in the close price relative to the maximum open price over the last 4 candles.
CTI Confirmation: The CTI must be less than -0.8, signaling a strong bearish trend likely nearing a reversal.
RSI Levels: Short-term RSI is less than 35, indicating oversold conditions.
Long-term RSI values (84-period and 112-period) are below 60, suggesting an absence of excessive upward momentum.
Volume: Trades are only considered when trading volume is greater than zero.
Interestingly, the sell logic is left intentionally blank in the provided code. This implies the strategy might rely on external sell triggers such as manual interventions, a trailing stop loss, or other dynamic exit mechanisms not defined in the script.
So to summarize this trading algorithm, it is a high-frequency, short-term approach that combines the power of VWAP bands with momentum and trend indicators to identify undervalued buying opportunities. The reliance on multiple RSIs and CTI ensures that the signals are robust and filtered for quality. But the absence of an explicit sell logic indicates a significant area for further customization, where traders can refine the exit strategy to align with their risk tolerance and profit goals.
Backtest Results
I have tested this algorithm on the well known dataset and got the following results:
The backtest results for the VWAP strategy reveal strong performance on the 5-minute timeframe (5m) but a steep decline in effectiveness as the timeframe increases. On the 5m, the strategy achieves an impressive 93.43% win rate, a profit factor of 1.68, and a CAGR of 2.32, generating a massive profit percentage of 3565.46%. These numbers align with the high-frequency nature of the strategy, which relies on short-term movements and precise VWAP-based signals.
The strategy is coded to exploit short-term oversold conditions via VWAP and RSI thresholds. This design inherently fits the 5m timeframe, where price movements are volatile and frequent. The performance drop at longer timeframes suggests the indicators fail to capture momentum effectively in slower, less volatile markets.
The cumulative profit chart for the VWAP strategy on the 5-minute timeframe confirms its strong alignment with short-term market opportunities. The cumulative wins (green line) consistently rise over time, reflecting the strategy's high win rate of over 93%. The cumulative losses (red line) remain relatively flat, suggesting effective filtering of poor trades. However, the sharp increase in cumulative profits (orange line) around the 2021 bull market top indicates that the strategy benefits significantly from high-volatility, bullish market conditions.
The drawdown chart reveals critical insights into the VWAP strategy’s risk profile on the 5-minute timeframe. While the average drawdown of 3.25% (green line) appears moderate, there are significant spikes, notably exceeding 9% during specific periods. These high drawdowns often coincide with volatile market conditions or incorrect entries where the strategy’s recovery mechanism struggles to contain losses.
The winrate and profit distribution charts for the VWAP strategy provide additional depth to its performance analysis. The winrate box plot shows a consistently high median winrate close to 1 (100%), with a tight interquartile range. This reinforces the strategy's ability to identify successful trades. However, the occasional outliers, including a few near 0%, highlight instances where the strategy fails entirely, likely due to unexpected market conditions.
The profit distribution plot reveals a more complex picture. While most weekly profits cluster within a modest range, significant outliers on both ends indicate periods of exceptional gains or severe losses. These extremes suggest the strategy's dependency on volatile market phases, which can amplify both positive and negative outcomes.
Although the strategy shows an impressive winrate, the variability in profit highlights its reliance on favorable market conditions and the absence of a robust mechanism to cap losses during adverse scenarios. This inconsistency in profit suggests the need for stricter risk management, especially during less predictable market conditions.
The comparison chart positions the VWAP strategy as a standout performer in several key metrics but reveals critical weaknesses in others. The profit percentage is exceptional, surpassing most other strategies and highlighting VWAP's ability to generate substantial gains in volatile markets. Similarly, the win percentage is among the highest, demonstrating the strategy's consistency in capturing profitable trades.
Both the Sortino and Sharpe ratios are robust, reflecting favorable risk-adjusted returns and highlighting the strategy's ability to manage volatility effectively during successful periods. However, the drawdown is significantly larger than its peers, indicating vulnerability to substantial losses in adverse market conditions, a clear red flag for risk management.
The Calmar ratio is underwhelming due to the drawdown, signaling inefficiency in balancing risk against returns. This weakness undermines the otherwise strong results. VWAP’s high profit factor reflects efficiency in extracting profits relative to losses, but the strategy is notably weaker in longer-term measures like CAGR, which is dwarfed by several competitors.
Conclusion
The VWAP strategy looks to be a strong performer for short-term, high-frequency trading on volatile markets. Its key strengths lie in its exceptional win rate, profit percentage, and risk-adjusted returns as reflected by strong Sharpe and Sortino ratios. These attributes make it highly effective in capturing consistent gains in favorable conditions, particularly on the 5-minute timeframe.
So overall, the VWAP strategy is well-suited for traders who can monitor the market closely and tolerate occasional drawdowns in exchange for strong short-term profits. For broader applicability and sustainability, especially in less volatile or bearish markets, it would benefit from enhancements to its exit logic, risk management, and adaptive measures to handle changing conditions. But its current design excels in specific scenarios, these improvements would make it a more robust and versatile strategy.
It’s recommended that you first test this algorithm on your own setup by doing backtests and then forward tests. After you are certain that this could be a profitable strategy, dip your toes in the real market by using a small amount of real money and gradually add more if you are certain that the bot will not lose your money big time.
Always ALWAYS do your own research first please!
And this this very important message and this last precoded strategy file I’m at the end of this year cycle and tests. Many many thanks for being a Patron! I hope that 2024 ended well and your in profit now in this bull market. Let’s make 2025 even better!! I will return 😊
See you in the next post!
Goodbye