На TradingView нужно открыть COVID19:CONFIRMED, скрыть текущий график и применить скрипт.
//@version=4 study("COVID19 HISTOGRAM", overlay=true) confirmed_prev = security("COVID19:CONFIRMED", "D", close[1]) confirmed = security("COVID19:CONFIRMED", "D", close) deaths_prev = security("COVID19:DEATHS", "D", close[1]) deaths = security("COVID19:DEATHS", "D", close) recovered_prev = security("COVID19:RECOVERED", "D", close[1]) recovered = security("COVID19:RECOVERED", "D", close) c = confirmed_prev ? confirmed - confirmed_prev : confirmed r = recovered_prev ? recovered - recovered_prev : recovered d = deaths_prev ? deaths - deaths_prev : deaths plot(c, color=color.blue, style=plot.style_columns) plot(r, color=color.green, style=plot.style_columns) plot(d, color=color.red, style=plot.style_columns)Синие — подтверждены.
//@version=4 study("Dayli Gaps Percentange") resolution = timeframe.isdwm and timeframe.isdaily == false ? "M" : "D" close_prev = security(syminfo.tickerid, resolution, close[1], barmerge.gaps_off, barmerge.lookahead_on) open_today = security(syminfo.tickerid, resolution, open, barmerge.gaps_off, barmerge.lookahead_on) pr = open_today >= close_prev ? ((open_today - close_prev) / close_prev) * 100.00 : ((close_prev - open_today) / open_today) * 100.00 plot(pr, color=(open_today >= close_prev ? color.green : color.red), style=plot.style_columns)V2
//@version=4 study("Dayli Gaps Percentange", precision=2) resolution = timeframe.isdwm and timeframe.isdaily == false ? "M" : "D" close_prev = security(syminfo.tickerid, resolution, close[1], barmerge.gaps_off, barmerge.lookahead_on) close_today = security(syminfo.tickerid, resolution, close, barmerge.gaps_off, barmerge.lookahead_on) open_today = security(syminfo.tickerid, resolution, open, barmerge.gaps_off, barmerge.lookahead_on) pr = open_today >= close_prev ? ((open_today - close_prev) / close_prev) * 100.00 : ((close_prev - open_today) / open_today) * 100.00 plot(close_today >= close_prev ? pr : -pr, color=(close_today >= close_prev ? color.green : color.red), style=plot.style_columns)Добавил отрицательную гистограмму, определяется по close сегодня минус close вчера.
//@version=4 study("Color Month Week Day", overlay=true) resolution = timeframe.isweekly ? "M" : timeframe.isdwm ? "W" : "D" resolution_open = security(syminfo.tickerid, resolution, open, barmerge.gaps_off, barmerge.lookahead_on) resolution_close = security(syminfo.tickerid, resolution, close, barmerge.gaps_off, barmerge.lookahead_on) p_open = plot(resolution_open, color=#00000080, display=display.all, style=plot.style_stepline) p_close = plot(resolution_close, color=#00000080, display=display.all, style=plot.style_stepline) fill(p_open, p_close, resolution_close >= resolution_open ? color.green : color.red, 75)
//@version=4 study("Volume Base Unit", format=format.volume) plot(volume / ohlc4, color=(close >= open ? color.green : color.red), style=plot.style_columns)
//@version=4 study('Percentage Movement', format=format.volume, precision=2) _open = close[1] == na ? open : close[1] cl = _open > close ? color.red : color.green pr = _open > close ? ((_open - close) / _open) * 100.00 : ((close - _open) / _open) * 100.00 plot(pr, color=cl, style=plot.style_columns)