PROTECTED SOURCE SCRIPT

ECG Sanbot Indicator

50
Not my best but my first strategy to pass prop firms. Strength based signals. Change the length and repainting settings before setting alerts up.

First strategy to pass my prop firm. Change the tf and length to see reliable signals. Option to remove repainting if you want to set alerts. Not the best compared to my other scripts but will always get you in the green.

Core Logic

Calculates a double-smoothed EMA source on a higher timeframe (tf input).

Builds two RSI streams:

Repainting RSI (lookahead on) → reacts quickly to market changes.

Non-repainting RSI (lookahead off) → provides stable, confirmed values.

Computes the ECG difference between the two RSI streams.

Generates a buy signal when the ECG difference crosses above the upper threshold.

Generates a sell signal when the ECG difference crosses below the lower threshold.

Risk Management

Each trade uses a fixed trade size (trade_size).

Built-in stop-loss and take-profit controls:

Stop Loss: default 0.1% from entry price.

Take Profit: default 0.2% from entry price.

Both long and short entries are supported (direction selectable).

Customization Options

Adjustable timeframe (tf) for RSI source.

Fully configurable thresholds, lengths, and EMA smoothing.

Toggle between repainting vs. non-repainting behavior.

Backtest period controls (start and end date).

Visualization

Plots the ECG difference line in red.

Displays horizontal threshold lines for signal reference.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.