16 lines
488 B
Plaintext
16 lines
488 B
Plaintext
//@version=5
|
|
indicator("TTM Trend (Solid Candles)", overlay=true)
|
|
|
|
length = input.int(20, "Trend Length")
|
|
ma = ta.sma(close, length)
|
|
|
|
// Define trend colors
|
|
trendColor = close > ma ? color.blue : close < ma ? color.red : color.gray
|
|
|
|
// Redraw candles with solid colors
|
|
plotcandle(open, high, low, close,
|
|
color=trendColor, // candle body
|
|
wickcolor=trendColor, // wick
|
|
bordercolor=trendColor, // outline
|
|
title="TTM Trend Candles")
|