The SMAOffset strategy is a trading strategy that uses Simple Moving Averages (SMA) to generate buy and sell signals. Here is a brief description of how the strategy works:
The strategy is designed to operate on 5-minute candlestick data. It uses two SMA indicators: one for determining buy signals and another for sell signals.
The length of the SMAs can be optimized using the parameters sma_len_buy and sma_len_sell.
The strategy defines a range for the offset values (low_offset and high_offset) that are multiplied with the respective SMA values to determine the buy and sell thresholds.
If the closing price falls below the buy threshold (SMA multiplied by low_offset), and the volume is positive, a buy signal is generated. If the closing price exceeds the sell threshold (SMA multiplied by high_offset), and the volume is positive, a sell signal is generated. The strategy includes a stop loss of -0.25, which means that if the current profit of a trade drops below -25%, the trade will be closed with a stop loss. The strategy does not use a trailing stop. The strategy includes a custom stop loss condition where, if the trade has been open for more than 1200 minutes (20 hours) and the current profit is below -5%, a smaller stop loss of -0.001 is applied. The minimal ROI (Return on Investment) is set to 1, which means the strategy aims for a minimum of 100% profit on each trade. The strategy plots the SMA indicators on the main plot in orange color. Please note that this description provides a high-level overview of the strategy, and there may be additional implementation details and considerations.