-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
Many thanks to you to bring MarketSmith view to TradingView.
Could you please assist to fix this issue on chart when using this indicator as close char '-' sometimes appears below/above the candle.
symbol : MGL240829C1780
Freq : intraday 5 mins
Code snippet below:
prevClose = input(true, title='Color Based On Previous Close', group='----------BARS----------', inline='x')
i_posColor = input(color.rgb(39, 54,233,0), title='Candle Color Positive', group='----------BARS----------', inline = '1')
i_negColor = input(color.rgb(222,50,174,0), title='Negative', group='----------BARS----------', inline = '1')
colorCandle = close>=open ? i_posColor:i_negColor
if(prevClose)
colorCandle := close>=close[1] ? i_posColor:i_negColor
// Full Body (without border without wick)
plotcandle(low, high, low, high, title='MarketSmith Bars', color = colorCandle, wickcolor = color.rgb(255,255,255,100), bordercolor = color.rgb(255,255,255,100), editable = true)
// PlotChar - on close
plotchar(close, char='-', location=location.absolute, size=size.normal, color=colorCandle, editable = true)
//------------------ SMA's ---------------------//
// Input SMA for Daily TF and others
iSma9 = input(true, title='MA 1', group='----------SMAs----------', inline='sma9')
iSmaV9 = input(9, title='Lenght', group='----------SMAs----------', inline='sma9')
iExp9 = input(true, title='Exponential', group='----------SMAs----------', inline='sma9')
iCol9 = input(color.rgb(68,186,76), title='', group='----------SMAs----------', inline='sma9')
iSma21 = input(true, title='MA 2', group='----------SMAs----------', inline='sma21')
iSmaV21 = input(21, title='Lenght', group='----------SMAs----------', inline='sma21')
iExp21 = input(true, title='Exponential', group='----------SMAs----------', inline='sma21')
iCol21 = input(color.rgb(0,0,0,0), title='', group='----------SMAs----------', inline='sma21')
// SMA calculation Daily & others TF
sma9 = iExp9 ? ta.ema(close,iSmaV9) :ta.sma(close,iSmaV9)
sma21 = iExp21 ? ta.ema(close,iSmaV21) :ta.sma(close,iSmaV21)
// Ploting SMA/EMA Daily and other TF
tfWeekly = timeframe.isweekly
psma9 = plot(iSma9 and not tfWeekly ? sma9:na, linewidth=1, color=iCol9)
pema21 = plot(iSma21 and not tfWeekly ? sma21:na, linewidth=1, color=iCol21)
Metadata
Metadata
Assignees
Labels
No labels