UnknownUnicorn100591

Candlestick Math

This is an updated version of my previous post, with the option to specify which symbol you want it to show up on.

This is a script I made to do what is called candlestick math (if you're not sure, Google it). It will take the first open, the last close, and the highest high and lowest low from a range of candlesticks, and plot it on top of the chart.

Unfortunately, there is no way to make it so you can move it with your mouse, and the bar numbering is not the same as the regular drawing tools, so to figure out what the line number is, create a new script with the text:
study("Plot N")
plot(n)

This will create another chart that will show you the bar numbers that correspond to the script's bar numbers. From there, figure out where you want to start the candlestick math, and enter that number in the "Start" field in the inputs for this script.
オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。

チャートでこのスクリプトを利用したいですか?
study("Candlestick Math","CndlMth",overlay=true)
inStart = input(2610,"Start",integer,minval=0)
inLen = input(3,"Length",integer,minval=2)
inSym = input("*","Symbol",symbol)

len = inLen-1
start = inStart
end = inStart + len
isIn = (n >= start) and (n <= end) and (inSym == tickerid)

o = isIn ? (na(o[1]) ? fixnan(open[0]) : o[1]) : na
c = isIn ? (na(c[1]) ? fixnan(close[round(-len)]) : c[1]) : na
h = isIn ? (na(h[1]) ? highest(fixnan(high[round(-len)]),len+1) : h[1]) : na
l = isIn ? (na(l[1]) ? lowest(fixnan(low[round(-len)]),len+1) : l[1]) : na

fill(plot(h,title="High"),plot(l,title="Low"),color=gray,transp=50)
plot(o,title="Open",color=iff(o > c,red,green),linewidth=4)
plot(c,title="Close",color=iff(o > c,red,green),linewidth=4)