The "BuyOrDie" strategy is a backtesting strategy for trading. It uses several technical indicators to determine buy signals in the market. Here is a short description of how the strategy works:
Indicators:
Hull Moving Average (HMA): Calculates a moving average with reduced lag using the Hull Moving Average formula.
close_prev: The previous closing price.
hma_20_prev: The previous HMA value.
close_curr: The current closing price. hma_20_current: The current HMA value. Buy Signal:
A buy signal is generated when the current closing price is greater than the current HMA value, and the previous closing price is lower than the previous HMA value. This condition indicates a potential upward trend, and the strategy sets the "buy" signal to 1. Sell Signal:
The strategy does not populate a sell signal. Additional Parameters:
The strategy defines some additional parameters such as buy_params and sell_params, but they are left empty in this implementation. It sets a minimal return on investment (ROI) table, where a minimum return of 1000 is specified for all trades. A stop loss of -0.02 (2% loss) is defined, which triggers a sell if the price drops below this threshold. Trailing stop is enabled, with a positive threshold of 0.332 and an offset of 0.364. This means that the stop loss will be trailed if the price moves favorably, with a trailing offset to protect profits. The strategy operates on a 5-minute timeframe. The use of sell signals, selling only for profit, and ignoring ROI if a buy signal is present are disabled. The strategy aims to identify potential buying opportunities based on the relationship between the current closing price and the Hull Moving Average. It does not provide a specific sell strategy, and the implementation of selling is left open for customization.