0% found this document useful (0 votes)
118 views1 page

Separate Section Indicator PineScript

This document is a TradingView Pine Script that creates an indicator displaying volume, MACD, and RSI in a separate panel. It includes calculations for MACD and RSI, plots their respective lines and histograms, and marks long and short trading signals based on specific conditions. The visual elements are color-coded to indicate trends and signal conditions.

Uploaded by

raza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
118 views1 page

Separate Section Indicator PineScript

This document is a TradingView Pine Script that creates an indicator displaying volume, MACD, and RSI in a separate panel. It includes calculations for MACD and RSI, plots their respective lines and histograms, and marks long and short trading signals based on specific conditions. The visual elements are color-coded to indicate trends and signal conditions.

Uploaded by

raza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

//@version=5

indicator("Indicators in Separate Panel", overlay=false)

// Volume
volume_color = close > open ? color.green : color.red
plot(volume, style=plot.style_columns, color=volume_color, title="Volume")

// MACD Calculation
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)
macdHist = macdLine - signalLine

// MACD Plot
plot(macdLine, color=color.blue, linewidth=2, title="MACD Line")
plot(signalLine, color=color.orange, linewidth=2, title="Signal Line")
histoColor = macdHist > 0 ? color.green : color.red
plot(macdHist, style=plot.style_columns, color=histoColor, title="MACD Histogram")

// RSI Calculation
rsi = ta.rsi(close, 14)
hline(70, "Overbought", color=color.red)
hline(30, "Oversold", color=color.green)
plot(rsi, color=color.purple, linewidth=2, title="RSI")

// Signal Conditions
longCondition = ta.crossover(macdLine, signalLine) and rsi < 30
shortCondition = ta.crossunder(macdLine, signalLine) and rsi > 70

// Signal Markers
plotshape(series=longCondition, location=location.absolute, color=color.green,
style=shape.labelup, title="Long Signal", text="Long")
plotshape(series=shortCondition, location=location.absolute, color=color.red,
style=shape.labeldown, title="Short Signal", text="Short")

You might also like