Kieranj

S & R RSi strat

In this updated version, a trend filter is applied using the Simple Moving Average (SMA) on the 4-hour timeframe. The trend is considered up when the 50-period SMA is below the 200-period SMA (ta.sma(trendFilterSource, 50) < ta.sma(trendFilterSource, 200)).

The buy condition (buyCondition) is triggered when the RSI crosses above the oversold threshold (ta.crossover(rsi, oversoldThreshold)), the trend filter confirms an uptrend (isUptrend is true), and the close price is greater than or equal to the support level (close >= supportLevel).

The sell condition (sellCondition) is triggered when the RSI crosses below the overbought threshold (ta.crossunder(rsi, overboughtThreshold)), the trend filter confirms a downtrend (isUptrend is false), and the close price is less than or equal to the resistance level (close <= resistanceLevel).

With this implementation, the signals will only be generated in the direction of the trend on the 4-hour timeframe.
Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?