wildhorse3

[strategy][1H] SPY slow stochastics


SPY slow stochastics

Overview

The "SPY Auto RSI Stochastics" strategy is designed to leverage a combination of Relative Strength Index (RSI) and Stochastic indicators to identify potential entry and exit points in trading the SPY $SP:SPX.

The technicals:

A simple yet effective strategy for identifying (reversal) trends on SPY (or any asset).
The logic is as follows:

1. Slow stochastics are effective at predicting momentum. They can also be used to effectively identify reversals.
2. A combination of slow and fast RSI (along with an SMA for the fast RSI) can be used to see potential changes in the directional trend of the underlying asset.
3. In order to reduce noise, a band in the middle of RSI values is ignored; think of this as the price converging and potential explosions (sometimes fake) on either side.
4. Outside this noise band, a crossover of fast RSI on slow RSI indicates an upward trend incoming.
5. A crossunder of fast RSI on slow RSI indicates a downward trend incoming.

Strategy Specific Notes -

1. Load this strategy on SPREADEX:SPX on an hourly chart for the best results.
2. This is a generic strategy, use it on anything - index, stocks, etc. You will need to adjust the parameters for the best results.
3. The RSI Upper defines the cutoff for two things -- threshold for entering a long AND exit signal for short. Likewise for RSI Lower.
4. To have alerts on the strategy, add this to your chart, be content with the backtesting results, select "strategy tester", the alert icon, replace the message body with "{{strategy.order.alert_message}}" without the ".
5. In my experience, the strategy won't be immediately profitable upon a signal but it does get there in the backtested results. Intuitively, this makes sense. Reversals take some time to kick in completely.

Inputs

- **slowRSILength**: Length parameter for the slow RSI calculation.
- **fastRSILength**: Length parameter for the fast RSI calculation.
- **smaRSILength**: Length parameter for the Simple Moving Average (SMA) of the fast RSI.
- **RSIUpperThreshold**: Upper threshold for the RSI, used in exit conditions.
- **RSILowerThreshold**: Lower threshold for the RSI, used in exit conditions.
- **RSIUpperDeadzone**: Upper deadzone threshold for the RSI.
- **RSILowerDeadzone**: Lower deadzone threshold for the RSI.

Strategy Logic

- **RSI Calculation**: The script calculates both slow and fast RSI values based on the provided lengths.
- **Entry Condition**: Entry conditions for long and short positions are based on the crossing of fast RSI over slow RSI and SMA RSI, respectively, along with avoidance of RSI deadzones and validation of trade time.
- **Exit Condition**: Exit conditions for both long and short positions are based on crossing RSI thresholds or opposite entry conditions.

Trade Management

- **Position Entry**: Long and short positions are entered based on predefined entry conditions.
- **Position Exit**: Positions are exited based on predefined exit conditions.
- **Alerts**: The script provides alert messages for entry and exit points.

Plotting

- **Slow RSI**: Plots the slow RSI on the chart.
- **SMA RSI**: Plots the Simple Moving Average of fast RSI on the chart.

Example Usage

The defaults work well for SPY on a 1H timeframe.
If you apply this to anything else DAX, EUSTX50, FTSE, CAC (these are what i have); tweak the input parameters.

Plotting
plot(slowRSI, "Slow RSI", color=color.green) //or fastRSI
plot(smaRSI, "SMA RSI", color=color.white)


Conclusion

The "SPY Auto RSI Stochastics" strategy combines RSI and Stochastic indicators to provide potential trade signals for the SPY ETF. Traders can use this strategy with proper risk management and analysis to enhance their trading decisions.
Script protegido
Este script é publicado como de código fechado e você pode usá-lo livremente. Você pode favoritá-lo para utilizá-lo em um gráfico. Você não pode visualizar ou modificar seu código fonte.
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?