The RSIDivergence strategy is a trading strategy that utilizes the Relative Strength Index (RSI) and other indicators to identify potential buying and selling opportunities. Here is a breakdown of how the strategy works:
Indicator Population:
The strategy populates various indicators, including RSI, Stochastic Oscillator (STOCH), SAR, and others, based on the provided price data. It also calculates the Simple Moving Average (SMA) of the RSI with a time period of 5 and a rolling window of 3.
Bullish Conditions:
The strategy identifies potential bullish conditions based on specific criteria:
Oscillation (osc) values reaching a new low (oscLL) while price (low) simultaneously reaches a higher low (priceHL).
Oscillation (osc) values reaching a new high (oscHH) while price (high) simultaneously reaches a lower high (priceLH).
The presence of bullish conditions (bullCond) and hidden bullish conditions (hiddenBullCond). Confirmation from the EWO (Elliott Wave Oscillator) indicator. RSI values falling below a certain threshold (high_rsi_buy). Positive volume. Bearish Conditions:
The strategy identifies potential bearish conditions based on the following criteria:
Oscillation (osc) values reaching a new low (oscLL) while price (low) simultaneously reaches a higher low (priceHL). Oscillation (osc) values reaching a new high (oscHH) while price (high) simultaneously reaches a lower high (priceLH). The presence of bearish conditions (bearCond) and hidden bearish conditions (hiddenBearCond). Confirmation from the EWO (Elliott Wave Oscillator) indicator. Negative volume. Stop Loss Adjustment:
The strategy adjusts the stop loss (sl_new) based on the current profit. If the current profit is above 0.2, the stop loss is set to 0.05. If the current profit is between 0.1 and 0.2, the stop loss is set to 0.03. If the current profit is between 0.06 and 0.1, the stop loss is set to 0.02. If the current profit is between 0.03 and 0.06, the stop loss is set to 0.01. Overall, the RSIDivergence strategy aims to identify potential buy and sell signals based on RSI divergence and other conditions, with additional confirmation from the EWO indicator. It also dynamically adjusts the stop loss based on the current profit to manage risk.