RicardoSantos

[RS]Price Linear Sequence Counter

Simple green/red sequence counter, also gives current highest achieved sequence(black lines).
สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
study(title="[RS]Price Linear Sequence Counter", shorttitle="[RS]PLSC.V0")
length = input(24)

sa = open

sb = close

//difrange = abs(sa-sb)
posdifrange = sb-sa >= 0 ? sb-sa : 0
negdifrange = sb-sa <= 0 ? sb-sa : 0

//dfappex = nz(dfappex[1]) <= difrange ? difrange : nz(dfappex[1])

poslinearsequence = posdifrange > 0 ? nz(poslinearsequence[1]) + 1 : 0
neglinearsequence = negdifrange < 0 ? nz(neglinearsequence[1]) - 1 : 0

plinappex = nz(plinappex[1]) <= poslinearsequence ? poslinearsequence : nz(plinappex[1])
nlinappex = nz(nlinappex[1]) >= neglinearsequence ? neglinearsequence : nz(nlinappex[1])

plot(poslinearsequence, color=green, style=columns)
plot(neglinearsequence, color=red, style=columns)
//plot(difrange)
//colorf(v, c) => v != 0 ? c : na
//plot(posdifrange, color=colorf(posdifrange, green), style=circles, linewidth=2)
//plot(negdifrange, color=colorf(negdifrange, red), style=circles, linewidth=2)

plot(plinappex, color=black)
plot(nlinappex, color=black)
hline(0, color=black)