tux

TUX 4 MA

This indicator uses the 21, 55, 100 and 200 SMA.

Strategy:
When the 21 SMA crosses the 55 and 100 SMA it creates either a buy or sell symbol dependent on which way it crossed.
สคริปต์โอเพนซอร์ซ

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

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

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

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
study(title="TUX 4 MA", shorttitle="TUX 4 MA", overlay=true)
len = input(21, minval=1, title="SMA 1")
src = input(close, title="Source")
out = sma(src, len)
plot(out, color=green, title="SMA 1")


len1 = input(55, minval=1, title="SMA 2")
out1 = sma(src, len1)
plot(out1, color=orange, title="SMA 2")

len2 = input(100, minval=1, title="SMA 3")
out2 = sma(src, len2)
plot(out2, color=red, title="SMA 3")

len3 = input(200, minval=1, title="SMA 4")
out3 = sma(src, len3)
plot(out3, color=blue, title="SMA 4")

macrossabove = out < close and cross(close,out2) and out2 < close and out2 > close[1] 
macrossbelow = out > close and cross(close,out2) and out2 > close and out2 < close[1] 

plotshape(macrossabove, color=green, style=shape.arrowup, text="Buy", location=location.belowbar)
plotshape(macrossbelow, color=red, style=shape.arrowdown, text="Sell", location=location.abovebar)