OPEN-SOURCE SCRIPT

EMA Trend Dashboard

//version=6
indicator("Line Extension Example", overlay=true)

// Kullanıcı girişi
extendLeftInput = input.bool(false, title="Extend Left", group="Line Settings")
extendRightInput = input.bool(true, title="Extend Right", group="Line Settings")

// extendStyle için durum belirleyicisi
extendStyle = switch
extendLeftInput and extendRightInput => extend.both
extendLeftInput => extend.left
extendRightInput => extend.right
=> extend.none

// Slope hesaplaması ve çizgiyi oluşturma
startPrice = 1000
endPrice = 1050
lengthInput = 20

baseLine := line.new(bar_index - lengthInput + 1, startPrice, bar_index, endPrice, width=1, extend=extendStyle, color=color.new(color.blue, 0))

Aviso legal