The "Obelisk_3EMA_StochRSI_ATR" strategy is a backtesting strategy used for trading. It utilizes various indicators such as Exponential Moving Averages (EMAs), Stochastic Relative Strength Index (StochRSI), and Average True Range (ATR) to make trading decisions. The strategy has several components:
"populate_indicators": This function is responsible for populating the indicators on the provided dataframe.
It checks the timeframe and ensures it is either 5 minutes or 1 minute for backtesting.
It then retrieves informative data and merges it with the current dataframe.
Columns with duplicate names are renamed to avoid conflicts. "populate_buy_trend": This function identifies buy signals based on the condition of the "go_long" indicator crossing above 0. It sets the "buy" column to 1 for the corresponding rows. "populate_sell_trend": This function initializes the "sell" column with 0 for all rows, indicating no sell signals. "should_cancel": This function determines whether a trade should be canceled based on the current rate, current profit, and other parameters. It retrieves additional information specific to the trading pair and checks for a take-profit target and a stop percentage. If the current rate surpasses the take-profit target, the function returns a value close to 0, indicating a desire to cancel the trade. If a stop percentage is defined, it calculates a new stop-loss value based on the current profit and returns it. The strategy also includes a configuration for plotting the main indicators (EMA50, EMA14, EMA8, take-profit, and stop-loss) as well as subplots for SRSI (Stochastic RSI) and ATR (Average True Range). The colors of the indicators are specified in the plot configuration. Overall, the strategy combines multiple indicators and conditions to determine buy and sell signals, and it also considers trade cancellation based on the current rate and profit.