PROTECTED SOURCE SCRIPT
SMC + FVG + EMA + Trendlines

SMC + FVG + EMA + Trendlines legRange = math.abs(structureHigh - structureLow) // <-- เปลี่ยนชื่อจาก range -> legRange
if showCurrentStruct and not na(structureHigh) and not na(structureLow)
if na(curHighLine) == false
line.delete(curHighLine)
if na(curLowLine) == false
line.delete(curLowLine)
curHighLine := line.new(sHighIdx, structureHigh, bar_index, structureHigh, xloc.bar_index, color=currentStructColor, style=currentStructStyle, width=currentStructWidth)
curLowLine := line.new(sLowIdx, structureLow, bar_index, structureLow, xloc.bar_index, color=currentStructColor, style=currentStructStyle, width=currentStructWidth)
// ---------- Fibonacci on current leg ----------
if showFibo and legRange > 0
for k = 0 to array.size(fLevels) - 1
lvl = array.get(fLevels, k)
price = sDir == 1 ? structureHigh - (legRange - legRange * lvl)
: structureLow + (legRange - legRange * lvl)
l = line.new(sDir == 1 ? sHighIdx : sLowIdx, price, bar_index, price, xloc.bar_index, color=fiboColorMain, style=fiboStyle, width=fiboWidth)
label.new(bar_index + 10, price, str.tostring(lvl) + " (" + str.tostring(price) + ")", style=label.style_none, textcolor=fiboColorMain)
if showCurrentStruct and not na(structureHigh) and not na(structureLow)
if na(curHighLine) == false
line.delete(curHighLine)
if na(curLowLine) == false
line.delete(curLowLine)
curHighLine := line.new(sHighIdx, structureHigh, bar_index, structureHigh, xloc.bar_index, color=currentStructColor, style=currentStructStyle, width=currentStructWidth)
curLowLine := line.new(sLowIdx, structureLow, bar_index, structureLow, xloc.bar_index, color=currentStructColor, style=currentStructStyle, width=currentStructWidth)
// ---------- Fibonacci on current leg ----------
if showFibo and legRange > 0
for k = 0 to array.size(fLevels) - 1
lvl = array.get(fLevels, k)
price = sDir == 1 ? structureHigh - (legRange - legRange * lvl)
: structureLow + (legRange - legRange * lvl)
l = line.new(sDir == 1 ? sHighIdx : sLowIdx, price, bar_index, price, xloc.bar_index, color=fiboColorMain, style=fiboStyle, width=fiboWidth)
label.new(bar_index + 10, price, str.tostring(lvl) + " (" + str.tostring(price) + ")", style=label.style_none, textcolor=fiboColorMain)
受保护脚本
此脚本以闭源形式发布。 但是,您可以自由使用它,没有任何限制 — 在此处了解更多信息。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
受保护脚本
此脚本以闭源形式发布。 但是,您可以自由使用它,没有任何限制 — 在此处了解更多信息。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。