0% found this document useful (0 votes)
10 views2 pages

Humble LinReg Trading Indicator

This document is a Pine Script code for a trading indicator called 'Humble LinReg – Large Status Table'. It includes inputs for signal length, moving average type, linear regression length, and minimum distance percentage to generate buy and sell signals based on price movements. The script also visualizes these signals on a chart and includes alert conditions for trading actions.

Uploaded by

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

Humble LinReg Trading Indicator

This document is a Pine Script code for a trading indicator called 'Humble LinReg – Large Status Table'. It includes inputs for signal length, moving average type, linear regression length, and minimum distance percentage to generate buy and sell signals based on price movements. The script also visualizes these signals on a chart and includes alert conditions for trading actions.

Uploaded by

vishnu raj
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

//@version=5

indicator("Humble LinReg – Large Status Table", overlay=true)

// ───── INPUTS ─────

signalLength = [Link](11, "Signal Length", minval=1)

useSMA = [Link](true, "Use SMA")

useLinReg = [Link](true, "Use LinReg Source")

linregLen = [Link](11, "LinReg Length", minval=1)

minDistance = [Link](0.1, "Min Distance (%)", step=0.1)

// ───── SOURCE ─────

src = useLinReg ? [Link](close, linregLen, 0) : close

// ───── SIGNAL ─────

signal = useSMA ? [Link](src, signalLength) : [Link](src, signalLength)

// ───── FILTER ─────

distance = [Link](close - signal) / signal * 100

validMove = distance >= minDistance

// ───── SIGNALS ─────

buySignal = close > signal and close[1] <= signal[1] and validMove

sellSignal = close < signal and close[1] >= signal[1] and validMove

// ───── READY STATE ─────

readyBuy = close > signal

readySell = close < signal

// ───── VISUALS ─────

barcolor(readyBuy ? [Link] : readySell ? [Link] : [Link])

plot(signal, title="Signal Line", color=[Link], linewidth=2)


plotshape(buySignal, title="BUY", style=[Link], location=[Link],
color=[Link], size=[Link])

plotshape(sellSignal, title="SELL", style=[Link], location=[Link],


color=[Link], size=[Link])

// ───── ALERTS ─────

alertcondition(buySignal, title="BUY Alert", message="BUY: Candle closed above signal")

alertcondition(sellSignal, title="SELL Alert", message="SELL: Candle closed below signal")

// ───── LARGE STATUS TABLE (TOP CENTER) ─────

var table statusTable = [Link](position.top_center, 1, 1, border_width=3)

if [Link]

[Link](statusTable, 0, 0, readyBuy ? "READY FOR BUY" : readySell ? "READY FOR SELL" : "WAIT",
bgcolor = readyBuy ? [Link] : readySell ? [Link] : [Link], text_color = [Link], text_size
= [Link], text_halign = text.align_center, text_valign = text.align_center)

You might also like