PROTECTED SOURCE SCRIPT
Zaktualizowano

Sangwan by wor100indy

116
sma cross 8 เส้น
8
15
65
125
185
295
500

ใช้ multitime frame

ดูรับต้าน high time frame แล้วเข้าดู Low timefram ให้รอย่อบายเด้งเซลล์

ใช้ Hige time frame เป็นแนวรับต้าน รอ แดง เหลือง เขียว เข้าออเดอร์
Informacje o Wersji
wma
Informacje o Wersji
//version=5
indicator("Sangwan by wor100indy", overlay=true)

// ตัวเลือกสำหรับประเภท Moving Average
maType1 = input.string(title="Type of MA 1", defval="SMA", options=["SMA", "EMA", "WMA", "HMA", "VWMA"])
maType2 = input.string(title="Type of MA 2", defval="SMA", options=["SMA", "EMA", "WMA", "HMA", "VWMA"])
maType3 = input.string(title="Type of MA 3", defval="SMA", options=["SMA", "EMA", "WMA", "HMA", "VWMA"])
maType4 = input.string(title="Type of MA 4", defval="SMA", options=["SMA", "EMA", "WMA", "HMA", "VWMA"])
maType5 = input.string(title="Type of MA 5", defval="SMA", options=["SMA", "EMA", "WMA", "HMA", "VWMA"])
maType6 = input.string(title="Type of MA 6", defval="SMA", options=["SMA", "EMA", "WMA", "HMA", "VWMA"])
maType7 = input.string(title="Type of MA 7", defval="SMA", options=["SMA", "EMA", "WMA", "HMA", "VWMA"])
maType8 = input.string(title="Type of MA 8", defval="SMA", options=["SMA", "EMA", "WMA", "HMA", "VWMA"])

// กำหนดค่า MA โดยให้สามารถปรับได้
maLength1 = input.int(8, title="Length of MA 1")
maLength2 = input.int(15, title="Length of MA 2")
maLength3 = input.int(25, title="Length of MA 3")
maLength4 = input.int(65, title="Length of MA 4")
maLength5 = input.int(125, title="Length of MA 5")
maLength6 = input.int(185, title="Length of MA 6")
maLength7 = input.int(295, title="Length of MA 7")
maLength8 = input.int(500, title="Length of MA 8")
// ฟังก์ชันคำนวณ HMA (Hull Moving Average)
hma(src, length) =>
wma1 = ta.wma(src, length)
wma2 = ta.wma(src, math.round(length / 2))
diff = 2 * wma2 - wma1
ta.wma(diff, math.round(math.sqrt(length)))

// ฟังก์ชันเลือกประเภท Moving Average
get_ma(src, length, maType) =>
if maType == "SMA"
ta.sma(src, length)
else if maType == "EMA"
ta.ema(src, length)
else if maType == "WMA"
ta.wma(src, length)
else if maType == "HMA"
hma(src, length)
else if maType == "VWMA"
ta.vwma(src, length)
else
na

// คำนวณ MA ตามประเภทที่เลือก
maLine1 = get_ma(close, maLength1, maType1)
maLine2 = get_ma(close, maLength2, maType2)
maLine3 = get_ma(close, maLength3, maType3)
maLine4 = get_ma(close, maLength4, maType4)
maLine5 = get_ma(close, maLength5, maType5)
maLine6 = get_ma(close, maLength6, maType6)
maLine7 = get_ma(close, maLength7, maType7)
maLine8 = get_ma(close, maLength8, maType8)
// เงื่อนไขการเปิด Long และ Short
//longCondition = ta.crossover(close, maLine1) // ราคาปิดข้ามขึ้นเหนือ MA 1
//shortCondition = ta.crossunder(close, maLine1) // ราคาปิดข้ามลงต่ำกว่า MA 1

// วาดเส้น MA บนกราฟ
plot(maLine1, color=color.rgb(255, 0, 0), linewidth=2, title="MA 1")
plot(maLine2, color=color.rgb(238, 234, 15), linewidth=2, title="MA 2")
plot(maLine3, color=color.rgb(74, 247, 6), linewidth=2, title="MA 3")
plot(maLine4, color=color.rgb(4, 247, 194), linewidth=2, title="MA 4")
plot(maLine5, color=color.rgb(0, 20, 241), linewidth=2, title="MA 5")
plot(maLine6, color=color.rgb(189, 6, 245), linewidth=2, title="MA 6")
plot(maLine7, color=color.rgb(247, 8, 167), linewidth=2, title="MA 7")
plot(maLine8, color=color.rgb(251, 249, 252), linewidth=2, title="MA 8")
// แสดงสัญญาณ Buy และ Sell บนกราฟ
//plotshape(series=longCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="Buy")
//plotshape(series=shortCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="Sell")
Informacje o Wersji
//version=5
indicator("Sangwan by wor100indy", overlay=true)

// ตัวเลือกสำหรับประเภท Moving Average
maType1 = input.string(title="Type of MA 1", defval="SSMA", options=["SMA", "EMA", "WMA", "HMA", "VWMA","SSMA"])
maType2 = input.string(title="Type of MA 2", defval="SSMA", options=["SMA", "EMA", "WMA", "HMA", "VWMA","SSMA"])
maType3 = input.string(title="Type of MA 3", defval="SSMA", options=["SMA", "EMA", "WMA", "HMA", "VWMA","SSMA"])
maType4 = input.string(title="Type of MA 4", defval="SSMA", options=["SMA", "EMA", "WMA", "HMA", "VWMA","SSMA"])
maType5 = input.string(title="Type of MA 5", defval="SSMA", options=["SMA", "EMA", "WMA", "HMA", "VWMA","SSMA"])
maType6 = input.string(title="Type of MA 6", defval="SSMA", options=["SMA", "EMA", "WMA", "HMA", "VWMA","SSMA"])
maType7 = input.string(title="Type of MA 7", defval="SSMA", options=["SMA", "EMA", "WMA", "HMA", "VWMA","SSMA"])
maType8 = input.string(title="Type of MA 8", defval="SSMA", options=["SMA", "EMA", "WMA", "HMA", "VWMA","SSMA"])

// กำหนดค่า MA โดยให้สามารถปรับได้
maLength1 = input.int(8, title="Length of MA 1")
maLength2 = input.int(15, title="Length of MA 2")
maLength3 = input.int(25, title="Length of MA 3")
maLength4 = input.int(65, title="Length of MA 4")
maLength5 = input.int(125, title="Length of MA 5")
maLength6 = input.int(185, title="Length of MA 6")
maLength7 = input.int(295, title="Length of MA 7")
maLength8 = input.int(500, title="Length of MA 8")
// ฟังก์ชันคำนวณ HMA (Hull Moving Average)
hma(src, length) =>
wma1 = ta.wma(src, length)
wma2 = ta.wma(src, math.round(length / 2))
diff = 2 * wma2 - wma1
ta.wma(diff, math.round(math.sqrt(length)))

// ฟังก์ชันคำนวณ SSMA (Smoothed Simple Moving Average)
ssma(src, length) =>
smma = 0.0
smma := na(smma[1]) ? ta.sma(src, length) : (smma[1] * (length - 1) + src) / length
smma

// ฟังก์ชันเลือกประเภท Moving Average
get_ma(src, length, maType) =>
if maType == "SMA"
ta.sma(src, length)
else if maType == "EMA"
ta.ema(src, length)
else if maType == "WMA"
ta.wma(src, length)
else if maType == "HMA"
hma(src, length)
else if maType == "VWMA"
ta.vwma(src, length)
else if maType == "SSMA"
ssma(src,length)
else
na

// คำนวณ MA ตามประเภทที่เลือก
maLine1 = get_ma(close, maLength1, maType1)
maLine2 = get_ma(close, maLength2, maType2)
maLine3 = get_ma(close, maLength3, maType3)
maLine4 = get_ma(close, maLength4, maType4)
maLine5 = get_ma(close, maLength5, maType5)
maLine6 = get_ma(close, maLength6, maType6)
maLine7 = get_ma(close, maLength7, maType7)
maLine8 = get_ma(close, maLength8, maType8)
// เงื่อนไขการเปิด Long และ Short
//longCondition = ta.crossover(close, maLine1) // ราคาปิดข้ามขึ้นเหนือ MA 1
//shortCondition = ta.crossunder(close, maLine1) // ราคาปิดข้ามลงต่ำกว่า MA 1

// วาดเส้น MA บนกราฟ
plot(maLine1, color=color.rgb(255, 0, 0), linewidth=2, title="MA 1")
plot(maLine2, color=color.rgb(238, 234, 15), linewidth=2, title="MA 2")
plot(maLine3, color=color.rgb(74, 247, 6), linewidth=2, title="MA 3")
plot(maLine4, color=color.rgb(4, 247, 194), linewidth=2, title="MA 4")
plot(maLine5, color=color.rgb(0, 20, 241), linewidth=2, title="MA 5")
plot(maLine6, color=color.rgb(189, 6, 245), linewidth=2, title="MA 6")
plot(maLine7, color=color.rgb(247, 8, 167), linewidth=2, title="MA 7")
plot(maLine8, color=color.rgb(251, 249, 252), linewidth=2, title="MA 8")
// แสดงสัญญาณ Buy และ Sell บนกราฟ
//plotshape(series=longCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="Buy")
//plotshape(series=shortCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="Sell")

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.