OPEN-SOURCE SCRIPT
Aggiornato

RSI Crosses SMA Buy/Sell Strategy

257
Disclaimer:
// This script is for educational and informational purposes only.
// It does not constitute financial or investment advice.
// Trading involves substantial risk and may not be suitable for all investors.
// Always do your own research or consult with a licensed financial advisor
// before making any trading or investment decisions.
// The author is not responsible for any losses incurred using this script

Key Changes:
Buy at High of the Signal Candle:

The strategy.entry("Buy", strategy.long, limit=high, comment="Buy at High of Signal Candle") line places a buy order at the high of the candle that triggered the signal (i.e., the candle where the RSI crosses above the SMA).

How it works:

When the RSI crosses above the SMA and the buy condition is true, the strategy will place a buy order at the high of that candle.

Exit:

The strategy will exit the position if the RSI crosses below the SMA as usual using strategy.close("Buy").

Example:
If the RSI crosses above the SMA at a specific candle, the strategy will enter a buy order at the high of that candle.

When the RSI crosses below the SMA, it will close the long position.

This should now execute a buy order at the high of the signal candle when the RSI crosses above the SMA, as requested.
Note di rilascio
Disclaimer:
// This script is for educational and informational purposes only.
// It does not constitute financial or investment advice.
// Trading involves substantial risk and may not be suitable for all investors.
// Always do your own research or consult with a licensed financial advisor
// before making any trading or investment decisions.
// The author is not responsible for any losses incurred using this script

Key Changes:
Buy at High of the Signal Candle:

The strategy.entry("Buy", strategy.long, limit=high, comment="Buy at High of Signal Candle") line places a buy order at the high of the candle that triggered the signal (i.e., the candle where the RSI crosses above the SMA).

How it works:

When the RSI crosses above the SMA and the buy condition is true, the strategy will place a buy order at the high of that candle.

Exit:

The strategy will exit the position if the RSI crosses below the SMA as usual using strategy.close("Buy").

Example:
If the RSI crosses above the SMA at a specific candle, the strategy will enter a buy order at the high of that candle.

When the RSI crosses below the SMA, it will close the long position.

This should now execute a buy order at the high of the signal candle when the RSI crosses above the SMA, as requested.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.