Can you write a pine script for tradingview that combines Twin Range Filter indicator…
- User
Can you write a pine script for tradingview that combines Twin Range Filter indicator and SALMA indicator? The settings for Twin Range Filter are: Fast period=12 Fast range=1 Slow period=4 Slow range=2 and the settings for the SALMA indicator are: Length=45 Extra Smooth=1
- Assistant
- User
Can you replace the characters ” and “ with "
- Assistant
Certainly! Here is the revised Pine Script with the corrected quotation marks:
//@version=5 indicator("Custom Twin Range Filter & SALMA", overlay=true) // Twin Range Filter Parameters fastPeriod = 12 fastRange = 1 slowPeriod = 4 slowRange = 2 // SALMA Parameters length = 45 extraSmooth = 1 // Twin Range Filter Calculation fastEMA = ta.ema(close, fastPeriod) slowEMA = ta.ema(close, slowPeriod) fastUpper = fastEMA + (ta.stdev(close, fastPeriod) * fastRange) fastLower = fastEMA - (ta.stdev(close, fastPeriod) * fastRange) slowUpper = slowEMA + (ta.stdev(close, slowPeriod) * slowRange) slowLower = slowEMA - (ta.stdev(close, slowPeriod) * slowRange) twinRangeFilterValue = (fastUpper + fastLower + slowUpper + slowLower) / 4 // SALMA Calculation salmaSrc = close salmaEMA = ta.ema(salmaSrc, length) smoothedSalma = ta.ema(salmaEMA, extraSmooth) // Plotting plot(twinRangeFilterValue, color=color.red, title="Twin Range Filter") plot(smoothedSalma, color=color.blue, title="Smoothed SALMA") // Generate Trade Signals buySignal = ta.crossover(smoothedSalma, twinRangeFilterValue) sellSignal = ta.crossunder(smoothedSalma, twinRangeFilterValue) // Plot buy and sell signals plotshape(series=buySignal, location=location.belowbar, color=color.green, style=shape.triangleup, title="Buy Signal") plotshape(series=sellSignal, location=location.abovebar, color=color.red, style=shape.triangledown, title="Sell Signal") - User
Can you show the signals for the both indicators separately? I don't want the signals combined, just I want to show them on the chart
- Assistant