Statistics: Posted by macd & rsi — Thu Mar 28, 2024 8:32 pm
Statistics: Posted by macd & rsi — Thu Mar 28, 2024 8:04 pm
Statistics: Posted by xpf2003 — Thu Mar 28, 2024 7:54 pm
Code: Select all
//@version=4study(title="Average True Range Stop Loss Finder", shorttitle="ATR", overlay=true)length = input(title="Length", defval=14, minval=1)smoothing = input(title="Smoothing", defval="RMA", options=["RMA", "SMA", "EMA", "WMA"])m = input(1.5, "Multiplier")src1 = input(high)src2 = input(low)pline = input(true, "Show Price Lines")col1 = input(color.blue, "ATR Text Color")col2 = input(color.teal, "Low Text Color",inline ="1")col3 = input(color.red, "High Text Color",inline ="2")collong = input(color.teal, "Low Line Color",inline ="1")colshort = input(color.red, "High Line Color",inline ="2")ma_function(source, length) =>if smoothing == "RMA"rma(source, length)elseif smoothing == "SMA"sma(source, length)elseif smoothing == "EMA"ema(source, length)elsewma(source, length)a = ma_function(tr(true), length) * mx = ma_function(tr(true), length) * m + src1x2 = src2 - ma_function(tr(true), length) * mp1 = plot(x, title = "ATR Short Stop Loss", color= colshort, transp=20, trackprice = pline ? true : false)p2 = plot(x2, title = "ATR Long Stop Loss", color= collong, transp=20, trackprice = pline ? true : false)var table Table = table.new(position.bottom_center, 3, 1, border_width = 3) f_fillCell(_table, _column, _row, _value, _timeframe) =>_cellText = _timeframe+ tostring(_value, "#.#") table.cell(_table, _column, _row, _cellText, text_color = col1) table.cell_set_text_color(Table, 1, 0, color.new(col3, transp = 0)) ... [/quote]Atr bands as I posted in 2018 here is similar.
Statistics: Posted by friend4you — Thu Mar 28, 2024 7:50 pm
Statistics: Posted by charli — Thu Mar 28, 2024 7:48 pm
Statistics: Posted by Jimmy — Thu Mar 28, 2024 7:26 pm
Statistics: Posted by Lenovo — Thu Mar 28, 2024 7:25 pm
Statistics: Posted by Lenovo — Thu Mar 28, 2024 7:16 pm
Statistics: Posted by charli — Thu Mar 28, 2024 6:53 pm
Statistics: Posted by vvFish — Thu Mar 28, 2024 6:48 pm
Statistics: Posted by Ogee — Thu Mar 28, 2024 6:28 pm
Statistics: Posted by Ogee — Thu Mar 28, 2024 6:18 pm
Statistics: Posted by Ogee — Thu Mar 28, 2024 6:06 pm
Statistics: Posted by Ogee — Thu Mar 28, 2024 5:59 pm
Statistics: Posted by ixion700 — Thu Mar 28, 2024 5:15 pm