//@version=4 study("Color Resolution", overlay=true) resolution = input(title="Resolution", type=input.resolution, defval="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("Color Resolution Vinni", overlay=true) rsl = input(title="Resolution", type=input.resolution, defval="D" ) resolution = timeframe.isweekly? "M": rsl resolution_high = security(syminfo.tickerid, resolution, high, barmerge.gaps_off, barmerge.lookahead_on) resolution_low = security(syminfo.tickerid, resolution, low, barmerge.gaps_off, barmerge.lookahead_on) p_high = plot(resolution_high, color=#000000, display=display.all, style=plot.style_stepline, transp = 100, title="High") p_low = plot(resolution_low, color=#000000, display=display.all, style=plot.style_stepline, transp = 100, title="Low") fill(p_high, p_low, color = #131722, transp = 80, title="Fill_High_low") 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=#000000, display=display.all, style=plot.style_stepline, transp = 100, title="Open") p_close = plot(resolution_close, color=#000000, display=display.all, style=plot.style_stepline, transp = 100, title="Close") fill(p_open, p_close, resolution_close >= resolution_open? #0cf8c4: #e91e63, transp = 90, title="Fill_Open_Close")
На 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 вчера.