Hi,
I just want to check my RSI has increased from the previous period. How do I do so?
Currently, the comparison is based on:-
- Golden Cross
- Death Cross
- Top Divergence
- Bottom Divergence.
Is there a function for it?
Thanks!
I just want to check my RSI has increased from the previous period. How do I do so?
Currently, the comparison is based on:-
- Golden Cross
- Death Cross
- Top Divergence
- Bottom Divergence.
Is there a function for it?
Thanks!
3
102627090 OP : // Function to calculate RSI (implementation depends on your platform) function calculateRSI(period, data):
// RSI calculation logic here return rsi_value
// Main logic
period = 14
upper_threshold = 70
lower_threshold = 30
// Get the closing prices for the last 16 candles (14 + 2 extra for comparison) close_prices = getLastNClosingPrices
// Calculate RSI for the current candle and two candles ago
current_rsi = calculateRSI(period, close_prices
rsi_two_candles_ago = calculateRSI(period, close_prices
// Check if RSI has increased
rsi_increased = current_rsi > rsi_two_candles_ago
if rsi_increased: print("RSI has increased from two candlesticks ago")
else: print("RSI has not increased from two candlesticks ago")