Why combine indicators and how to structure the merge
TradingView subscription tiers restrict the maximum number of simultaneous indicators you can add to a single chart (e.g. 2 indicators on Basic/Free, 5 on Essential). By merging the source code of multiple indicators into one script, you consume only a single indicator slot while enjoying all of your customary tools. Beyond saving slots, merging allows indicators to communicate directly, allowing you to create confluence rules such as buying only when an EMA crossover occurs and RSI is oversold and price touches the lower Bollinger Band.
| Challenge during merge | Cause | Technical solution in Pine Script v6 |
|---|---|---|
| Variable name collision | Both scripts use identical names like len, ma, rsi | Prefix variables with indicator acronyms (e.g. ema_len, rsi_len) |
| Overlay conflict | One script is overlay = true, the other is an oscillator in a separate pane | Keep script overlay = true and normalize pane oscillator values or plot on main chart with scale = scale.none |
| Version mismatches | One script is v4 or v5, while the other is v6 | Upgrade all logic to //@version=6 using modern ta.* namespaces |
| Unorganized settings | Dozens of inputs appear mixed randomly in settings | Add group = "Indicator Name" to every input() call |