AD

User info

Welcome, Guest! Please login or register.


You are here » AD » WOW.that's literally me » #8 investing.com


#8 investing.com

Posts 61 to 90 of 99

61

//
// @author LazyBear
// List of all my indicators: https://www.tradingview.com/v/4IneGo8h/
//
study("RSI Bands [LazyBear]", shorttitle="RSIBANDS_LB", overlay=true)
obLevel = input(70, title="RSI Overbought")
osLevel = input(30, title="RSI Oversold")
RSI Bands, RSI %B and RSI Bandwidth
https://www.tradingview.com/script/zWq2 … Bandwidth/


length = input(14, title="RSI Length")
src=close
ep = 2 * length - 1
auc = ema( max( src - src[1], 0 ), ep )
adc = ema( max( src[1] - src, 0 ), ep )
x1 = (length - 1) * ( adc * obLevel / (100-obLevel) - auc)
ub = iff( x1 >= 0, src + x1, src + x1 * (100-obLevel)/obLevel )
x2 = (length - 1) * ( adc * osLevel / (100-osLevel) - auc)
lb = iff( x2 >= 0, src + x2, src + x2 * (100-osLevel)/osLevel )

plot( ub, title="Resistance", color=red, linewidth=2)
plot( lb, title="Support", color=green, linewidth=2)
plot( avg(ub, lb), title="RSI Midline", color=gray, linewidth=1)

0

62

Середина индикатора
мувинг 28 експонент HL/2

0

63

// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ChartPrime

//@version=5
indicator("MA Multi-Timeframe [ChartPrime]", overlay = true, max_bars_back = 4000, max_polylines_count = 100)

// --------------------------------------------------------------------------------------------------------------------}
// 𝙐𝙎𝙀𝙍 𝙄𝙉𝙋𝙐𝙏𝙎
// --------------------------------------------------------------------------------------------------------------------{

int   length = input.int(20, "Length", inline = "-1")
float source = input.source(close, "", inline = "-1")

string typeMA0 = input.string(title = "MA1 >>", defval = "SMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], inline ="0")
string typeMA1 = input.string(title = "MA2 >>", defval = "SMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], inline="1")
string typeMA2 = input.string(title = "MA3 >>", defval = "SMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], inline="2")
string typeMA3 = input.string(title = "MA4 >>", defval = "SMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], inline="3")

string ma_tf0 = input.timeframe("360", "",  inline="0")
string ma_tf1 = input.timeframe("D",   "",  inline="1")
string ma_tf2 = input.timeframe("W",   "",  inline="2")
string ma_tf3 = input.timeframe("M",   "",  inline="3")

string styleMA0 = input.string(title = "", defval = "Solid", options=["Solid", "Dotted", "Dashed"], inline="0")
string styleMA1 = input.string(title = "", defval = "Solid", options=["Solid", "Dotted", "Dashed"], inline="1")
string styleMA2 = input.string(title = "", defval = "Solid", options=["Solid", "Dotted", "Dashed"], inline="2")
string styleMA3 = input.string(title = "", defval = "Solid", options=["Solid", "Dotted", "Dashed"], inline="3")

color color0 = input.color(#1bc6dd, "",  inline="0")
color color1 = input.color(#1b8fdd, "",  inline="1")
color color2 = input.color(#6f1bdd, "",  inline="2")
color color3 = input.color(#dd1bc3, "",  inline="3")

// --------------------------------------------------------------------------------------------------------------------}
// 𝙄𝙉𝘿𝙄𝘾𝘼𝙏𝙊𝙍 𝘾𝘼𝙇𝘾𝙐𝙇𝘼𝙏𝙄𝙊𝙉𝙎
// --------------------------------------------------------------------------------------------------------------------{

request(tf, expression)=>
    request.security(syminfo.tickerid, tf, expression[1], lookahead = barmerge.lookahead_on)

var tbl = table.new(position.top_right, 10, 10,
                     bgcolor      = color.new(color.gray, 90),
                     frame_color  = color.gray,
                     frame_width  = 2,
                     border_color = color.new(color.gray, 80),
                     border_width = 1)

table_cell(row, txt, tf, trend, color)=>
    table.cell(tbl, 0, 0, "MA Type:", text_color = chart.fg_color)
    table.cell(tbl, 1, 0, "Timeframe:", text_color = chart.fg_color)
    table.cell(tbl, 2, 0, "Price:", text_color = chart.fg_color)
    table.cell(tbl, 0, row, "🞛 " + txt, text_color = color)
    table.cell(tbl, 1, row, tf, text_color = color)
    table.cell(tbl, 2, row, trend ? "⮙" : "⮛", text_color = trend ? color.lime : color.fuchsia, text_size = size.large)

ma(tf, color, type, extend, styleMA, cell)=>
    color color_ = color.new(color, 85)

    string style = switch styleMA
        "Solid" => line.style_solid
        "Dashed"=> line.style_dashed
        "Dotted"=> line.style_dotted

    series float expression = switch type
        "SMA" => ta.sma(source, length)
        "EMA" => ta.ema(source, length)
        "SMMA (RMA)" => ta.rma(source, length)
        "WMA" => ta.wma(source, length)
        "VWMA" => ta.vwma(source, length)

    series float ma = request(tf, expression)

    line.delete(
         line.new(bar_index, ma, bar_index+extend, ma, color = color, style = style)[1]
               )
    line.delete(
         line.new(bar_index, ma, bar_index+extend, ma, color = color_, style = style, width = 5)[1]
               )

    label.delete(
         label.new(bar_index+extend, ma, type + ": " + tf,
                     style = label.style_diamond,
                     color = color_,
                     textcolor = chart.fg_color,
                     size = size.small
                     )[1]
               )
    label.delete(
         label.new(bar_index+extend, ma,
                     style = label.style_diamond,
                     color = color,
                     size = size.tiny
                     )[1]
               )
    if barstate.islast
        cp = array.new<chart.point>()
       
        for i = 0 to 4000
            cp.push(chart.point.from_index(bar_index[i], ma[i]))

        polyline.delete(polyline.new(cp, curved = false, line_color = color, line_style = style)[1])
        polyline.delete(polyline.new(cp, curved = false, line_color = color_, line_style = style, line_width = 5)[1])

        table_cell(cell, type, tf, close > ma, color)

// --------------------------------------------------------------------------------------------------------------------}
// 𝙑𝙄𝙎𝙐𝘼𝙇𝙄𝙕𝘼𝙏𝙄𝙊𝙉
// --------------------------------------------------------------------------------------------------------------------{

ma(ma_tf0, color0, typeMA0, 15, styleMA0, 1)
ma(ma_tf1, color1, typeMA1, 30, styleMA1, 2)
ma(ma_tf2, color2, typeMA2, 45, styleMA2, 3)
ma(ma_tf3, color3, typeMA3, 60, styleMA3, 4)

// --------------------------------------------------------------------------------------------------------------------}

0

64

Для хая на Трейдинг виев

// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ChartPrime

//@version=5
indicator("MA Multi-Timeframe [ChartPrime]", overlay = true, max_bars_back = 4000, max_polylines_count = 100)

// --------------------------------------------------------------------------------------------------------------------}
// 𝙐𝙎𝙀𝙍 𝙄𝙉𝙋𝙐𝙏𝙎
// --------------------------------------------------------------------------------------------------------------------{

int   length = input.int(8, "Length", inline = "-1")
float source = input.source(high, "", inline = "-1")

string typeMA0 = input.string(title = "MA1 >>", defval = "VWMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], inline ="0")
string typeMA1 = input.string(title = "MA2 >>", defval = "VWMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], inline="1")
string typeMA2 = input.string(title = "MA3 >>", defval = "VWMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], inline="2")
string typeMA3 = input.string(title = "MA4 >>", defval = "VWMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], inline="3")

string ma_tf0 = input.timeframe("30", "",  inline="0")
string ma_tf1 = input.timeframe("60",   "",  inline="1")
string ma_tf2 = input.timeframe("240",   "",  inline="2")
string ma_tf3 = input.timeframe("D",   "",  inline="3")

string styleMA0 = input.string(title = "", defval = "Solid", options=["Solid", "Dotted", "Dashed"], inline="0")
string styleMA1 = input.string(title = "", defval = "Solid", options=["Solid", "Dotted", "Dashed"], inline="1")
string styleMA2 = input.string(title = "", defval = "Solid", options=["Solid", "Dotted", "Dashed"], inline="2")
string styleMA3 = input.string(title = "", defval = "Solid", options=["Solid", "Dotted", "Dashed"], inline="3")

color color0 = input.color(color.rgb(236, 38, 38), "",  inline="0")
color color1 = input.color(#ddda1b, "",  inline="1")
color color2 = input.color(#42dd1b, "",  inline="2")
color color3 = input.color(#111011, "",  inline="3")

// --------------------------------------------------------------------------------------------------------------------}
// 𝙄𝙉𝘿𝙄𝘾𝘼𝙏𝙊𝙍 𝘾𝘼𝙇𝘾𝙐𝙇𝘼𝙏𝙄𝙊𝙉𝙎
// --------------------------------------------------------------------------------------------------------------------{

request(tf, expression)=>
    request.security(syminfo.tickerid, tf, expression[1], lookahead = barmerge.lookahead_on)

var tbl = table.new(position.top_right, 10, 10,
                     bgcolor      = color.new(color.gray, 90),
                     frame_color  = color.gray,
                     frame_width  = 2,
                     border_color = color.new(color.gray, 80),
                     border_width = 1)

table_cell(row, txt, tf, trend, color)=>
    table.cell(tbl, 0, 0, "MA Type:", text_color = chart.fg_color)
    table.cell(tbl, 1, 0, "Timeframe:", text_color = chart.fg_color)
    table.cell(tbl, 2, 0, "Price:", text_color = chart.fg_color)
    table.cell(tbl, 0, row, "🞛 " + txt, text_color = color)
    table.cell(tbl, 1, row, tf, text_color = color)
    table.cell(tbl, 2, row, trend ? "⮙" : "⮛", text_color = trend ? color.lime : color.fuchsia, text_size = size.large)

ma(tf, color, type, extend, styleMA, cell)=>
    color color_ = color.new(color, 85)

    string style = switch styleMA
        "Solid" => line.style_solid
        "Dashed"=> line.style_dashed
        "Dotted"=> line.style_dotted

    series float expression = switch type
        "SMA" => ta.sma(source, length)
        "EMA" => ta.ema(source, length)
        "SMMA (RMA)" => ta.rma(source, length)
        "WMA" => ta.wma(source, length)
        "VWMA" => ta.vwma(source, length)

    series float ma = request(tf, expression)

    line.delete(
         line.new(bar_index, ma, bar_index+extend, ma, color = color, style = style)[1]
               )
    line.delete(
         line.new(bar_index, ma, bar_index+extend, ma, color = color_, style = style, width = 5)[1]
               )

    label.delete(
         label.new(bar_index+extend, ma, type + ": " + tf,
                     style = label.style_diamond,
                     color = color_,
                     textcolor = chart.fg_color,
                     size = size.small
                     )[1]
               )
    label.delete(
         label.new(bar_index+extend, ma,
                     style = label.style_diamond,
                     color = color,
                     size = size.tiny
                     )[1]
               )
    if barstate.islast
        cp = array.new<chart.point>()
       
        for i = 0 to 4000
            cp.push(chart.point.from_index(bar_index[i], ma[i]))

        polyline.delete(polyline.new(cp, curved = false, line_color = color, line_style = style)[1])
        polyline.delete(polyline.new(cp, curved = false, line_color = color_, line_style = style, line_width = 5)[1])

        table_cell(cell, type, tf, close > ma, color)

// --------------------------------------------------------------------------------------------------------------------}
// 𝙑𝙄𝙎𝙐𝘼𝙇𝙄𝙕𝘼𝙏𝙄𝙊𝙉
// --------------------------------------------------------------------------------------------------------------------{

ma(ma_tf0, color0, typeMA0, 15, styleMA0, 1)
ma(ma_tf1, color1, typeMA1, 30, styleMA1, 2)
ma(ma_tf2, color2, typeMA2, 45, styleMA2, 3)
ma(ma_tf3, color3, typeMA3, 60, styleMA3, 4)

// --------------------------------------------------------------------------------------------------------------------}

0

65

Для лоу

// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ChartPrime

//@version=5
indicator("MA Multi-Timeframe [ChartPrime]", overlay = true, max_bars_back = 4000, max_polylines_count = 100)

// --------------------------------------------------------------------------------------------------------------------}
// 𝙐𝙎𝙀𝙍 𝙄𝙉𝙋𝙐𝙏𝙎
// --------------------------------------------------------------------------------------------------------------------{

int   length = input.int(8, "Length", inline = "-1")
float source = input.source(low, "", inline = "-1")

string typeMA0 = input.string(title = "MA1 >>", defval = "VWMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], inline ="0")
string typeMA1 = input.string(title = "MA2 >>", defval = "VWMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], inline="1")
string typeMA2 = input.string(title = "MA3 >>", defval = "VWMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], inline="2")
string typeMA3 = input.string(title = "MA4 >>", defval = "VWMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], inline="3")

string ma_tf0 = input.timeframe("30", "",  inline="0")
string ma_tf1 = input.timeframe("60",   "",  inline="1")
string ma_tf2 = input.timeframe("240",   "",  inline="2")
string ma_tf3 = input.timeframe("D",   "",  inline="3")

string styleMA0 = input.string(title = "", defval = "Solid", options=["Solid", "Dotted", "Dashed"], inline="0")
string styleMA1 = input.string(title = "", defval = "Solid", options=["Solid", "Dotted", "Dashed"], inline="1")
string styleMA2 = input.string(title = "", defval = "Solid", options=["Solid", "Dotted", "Dashed"], inline="2")
string styleMA3 = input.string(title = "", defval = "Solid", options=["Solid", "Dotted", "Dashed"], inline="3")

color color0 = input.color(color.rgb(236, 38, 38), "",  inline="0")
color color1 = input.color(#ddda1b, "",  inline="1")
color color2 = input.color(#42dd1b, "",  inline="2")
color color3 = input.color(#111011, "",  inline="3")

// --------------------------------------------------------------------------------------------------------------------}
// 𝙄𝙉𝘿𝙄𝘾𝘼𝙏𝙊𝙍 𝘾𝘼𝙇𝘾𝙐𝙇𝘼𝙏𝙄𝙊𝙉𝙎
// --------------------------------------------------------------------------------------------------------------------{

request(tf, expression)=>
    request.security(syminfo.tickerid, tf, expression[1], lookahead = barmerge.lookahead_on)

var tbl = table.new(position.top_right, 10, 10,
                     bgcolor      = color.new(color.gray, 90),
                     frame_color  = color.gray,
                     frame_width  = 2,
                     border_color = color.new(color.gray, 80),
                     border_width = 1)

table_cell(row, txt, tf, trend, color)=>
    table.cell(tbl, 0, 0, "MA Type:", text_color = chart.fg_color)
    table.cell(tbl, 1, 0, "Timeframe:", text_color = chart.fg_color)
    table.cell(tbl, 2, 0, "Price:", text_color = chart.fg_color)
    table.cell(tbl, 0, row, "🞛 " + txt, text_color = color)
    table.cell(tbl, 1, row, tf, text_color = color)
    table.cell(tbl, 2, row, trend ? "⮙" : "⮛", text_color = trend ? color.lime : color.fuchsia, text_size = size.large)

ma(tf, color, type, extend, styleMA, cell)=>
    color color_ = color.new(color, 85)

    string style = switch styleMA
        "Solid" => line.style_solid
        "Dashed"=> line.style_dashed
        "Dotted"=> line.style_dotted

    series float expression = switch type
        "SMA" => ta.sma(source, length)
        "EMA" => ta.ema(source, length)
        "SMMA (RMA)" => ta.rma(source, length)
        "WMA" => ta.wma(source, length)
        "VWMA" => ta.vwma(source, length)

    series float ma = request(tf, expression)

    line.delete(
         line.new(bar_index, ma, bar_index+extend, ma, color = color, style = style)[1]
               )
    line.delete(
         line.new(bar_index, ma, bar_index+extend, ma, color = color_, style = style, width = 5)[1]
               )

    label.delete(
         label.new(bar_index+extend, ma, type + ": " + tf,
                     style = label.style_diamond,
                     color = color_,
                     textcolor = chart.fg_color,
                     size = size.small
                     )[1]
               )
    label.delete(
         label.new(bar_index+extend, ma,
                     style = label.style_diamond,
                     color = color,
                     size = size.tiny
                     )[1]
               )
    if barstate.islast
        cp = array.new<chart.point>()
       
        for i = 0 to 4000
            cp.push(chart.point.from_index(bar_index[i], ma[i]))

        polyline.delete(polyline.new(cp, curved = false, line_color = color, line_style = style)[1])
        polyline.delete(polyline.new(cp, curved = false, line_color = color_, line_style = style, line_width = 5)[1])

        table_cell(cell, type, tf, close > ma, color)

// --------------------------------------------------------------------------------------------------------------------}
// 𝙑𝙄𝙎𝙐𝘼𝙇𝙄𝙕𝘼𝙏𝙄𝙊𝙉
// --------------------------------------------------------------------------------------------------------------------{

ma(ma_tf0, color0, typeMA0, 15, styleMA0, 1)
ma(ma_tf1, color1, typeMA1, 30, styleMA1, 2)
ma(ma_tf2, color2, typeMA2, 45, styleMA2, 3)
ma(ma_tf3, color3, typeMA3, 60, styleMA3, 4)

// --------------------------------------------------------------------------------------------------------------------}

0

66

//
// @author LazyBear
// List of all my indicators: https://www.tradingview.com/v/4IneGo8h/
//
study("RSI Bands [LazyBear]", shorttitle="RSI_BANDS_LOW", overlay=true)
obLevel = input(70, title="RSI Overbought")
osLevel = input(30, title="RSI Oversold")
length = input(14, title="RSI Length")
src=low
ep = 2 * length - 1
auc = ema( max( src - src[1], 0 ), ep )
adc = ema( max( src[1] - src, 0 ), ep )
x1 = (length - 1) * ( adc * obLevel / (100-obLevel) - auc)
ub = iff( x1 >= 0, src + x1, src + x1 * (100-obLevel)/obLevel )
x2 = (length - 1) * ( adc * osLevel / (100-osLevel) - auc)
lb = iff( x2 >= 0, src + x2, src + x2 * (100-osLevel)/osLevel )

plot( ub, title="Resistance", color=orange, linewidth=2)
plot( lb, title="Support", color=orange, linewidth=2)
plot( avg(ub, lb), title="RSI Midline", color=orange, linewidth=1)

-------------------------

//
// @author LazyBear
// List of all my indicators: https://www.tradingview.com/v/4IneGo8h/
//
study("RSI Bands [LazyBear]", shorttitle="RSI_BANDS_HIGH", overlay=true)
obLevel = input(70, title="RSI Overbought")
osLevel = input(30, title="RSI Oversold")
length = input(14, title="RSI Length")
src=high
ep = 2 * length - 1
auc = ema( max( src - src[1], 0 ), ep )
adc = ema( max( src[1] - src, 0 ), ep )
x1 = (length - 1) * ( adc * obLevel / (100-obLevel) - auc)
ub = iff( x1 >= 0, src + x1, src + x1 * (100-obLevel)/obLevel )
x2 = (length - 1) * ( adc * osLevel / (100-osLevel) - auc)
lb = iff( x2 >= 0, src + x2, src + x2 * (100-osLevel)/osLevel )

plot( ub, title="Resistance", color=blue, linewidth=2)
plot( lb, title="Support", color=blue, linewidth=2)
plot( avg(ub, lb), title="RSI Midline", color=orange, linewidth=1)

0

67

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © io72signals

//@version=4
study("72s: Linear Weighted Moving Average", shorttitle="LWMA Custom Weighted", overlay=true)

//{ LWMA Custom Weighted Function
get_lwma(src,period, weight) =>
    price = src
    sub = (weight/period)-1
    float p = na
    float d = na
    float sum = 0
    float divider = 0
    for i = 0 to period-1
        p := price[i] * ((weight-i)-sub)
        d := (weight-i)-sub
        sum := sum + p
        divider := divider + d
    sum / divider
//}--LWMA Custom Weighted

/// Sample Usage
lwma_source = input(close, title="LWMA Source:", type=input.source)
lwma_period = input (10, title = "LWMA Lookback Period:", minval=1, step=1)
lwma_weight = input (6, title = "LWMA Weight:", minval=1, step=1)
colorChange = input(true, title="Directional color change?", type=input.bool)

lwma = get_lwma(lwma_source, lwma_period, lwma_weight)

lwmaRise = lwma[1]<lwma
lwmaFall = lwma[1]>lwma
lColor = colorChange? lwmaRise ? color.green : color.red : color.blue

plot(lwma, color=lColor, linewidth=2)

// ALERTS
if lwmaRise and not lwmaRise[1]
    alert("LWMA is Rising", alert.freq_once_per_bar)
if lwmaFall and not lwmaFall[1]
    alert("LWMA is Falling", alert.freq_once_per_bar)


----------------

Самая большая коллекция лучших индикаторов и торговых систем MetaTrader
https://www.best-metatrader-indicators. … cator-mt4/
https://www.best-metatrader-indicators. … indicator/
https://gerchik.com/journal/foreks/chto … trejdinge/
https://ru.tradingview.com/u/LazyBear/# … ed-scripts
https://gerchik.com/journal/foreks/chto … trejdinge/

0

68

1. Color coded UO: https://www.tradingview.com/v/CDJHwbyx/
2. Wilson Relative Price Channel: https://www.tradingview.com/v/w0VlTHHV/ 
3. Keltner Channel with auto highlighting of Bear/Bull reversals; https://www.tradingview.com/v/WH1PVDTO/ 
4. Scalper's Channel: https://www.tradingview.com/v/hmfZ7SUf/ 
5. Trading Strategy based on BB/KC squeeze: https://www.tradingview.com/v/x9r2dOhI/ 
6. EMA Envelope: https://www.tradingview.com/v/jRrLUjPJ/ 
7. Volume ROC: https://www.tradingview.com/v/dB56X9AU/ 
8. Positive Volume Index: https://www.tradingview.com/v/GMW5uOvc/ 
9. Negative Volume Index: https://www.tradingview.com/v/GMW5uOvc/ 
10. Vertical Horizontal Filter (VHF): https://www.tradingview.com/v/cGtwC2C9/ 
11. Tirone Levels: https://www.tradingview.com/v/ZdbzUf9B/ 
12. Constance Brown Derivative Oscillator: https://www.tradingview.com/v/6wfwJ6To/ 
13. RSI enclosed by Bollinger Bands: https://www.tradingview.com/v/4hhFyZwm/ 
14. MFI enclosed by Bollinger Bands: https://www.tradingview.com/v/4hhFyZwm/ 
15. 8x MA with Cross-highlights: https://www.tradingview.com/v/np0rmAMB/ 
16. Bears/Bulls power: https://www.tradingview.com/v/0t5z9xe2/ 
17. Zero Lag EMA: https://www.tradingview.com/v/LTqZz3l9/ 
18. Kaufman AMA Binary Wave: https://www.tradingview.com/v/UFv7wX1B/ 
19. Rahul Mohindar Oscillator (RMO): https://www.tradingview.com/v/efHJsedw/ 
20. True Strength Index (TSI): https://www.tradingview.com/v/UQjj3yax/ 
21. Balance Of Power: https://www.tradingview.com/v/tzZx7dTy/ 
22. 4MACD: https://www.tradingview.com/v/nbx4UFZ6/ 
23. Tushar Chande's QStick Indicator: https://www.tradingview.com/v/ssL68jQu/ 
24. Fractal Adaptive Moving Average (FRAMA): https://www.tradingview.com/v/dGX0ADIk/ 
25. Forecast Oscillator: https://www.tradingview.com/v/CMSQGuGP/ 
26. ElliotWave Oscillator : https://www.tradingview.com/v/uculwCTj/ 
27. Ulcer Index: https://www.tradingview.com/v/QuqgdJgF/ 
28. Kaufmann Adaptive Moving Average: https://www.tradingview.com/v/wZGOIz9r/ 
29. Tushar Chande VIDYA: https://www.tradingview.com/v/wZGOIz9r/ 

30. Adaptive RSI: https://www.tradingview.com/v/wZGOIz9r/ 
31. OBV Oscillator: https://www.tradingview.com/v/Ox9gyUFA/ 
32. Kairi Relative Index (KRI): https://www.tradingview.com/v/xzRPAboO/ 
33. Schaff Trend Cycle (STC): https://www.tradingview.com/v/dbxXeuw2/ 
34. CCI coded OBV: https://www.tradingview.com/v/D8ld7sgR/ 
35. STARC Bands: https://www.tradingview.com/v/yTMOV9NM/ 
36. Pretty Good Oscillator: https://www.tradingview.com/v/GhxOzF0z/ 
37. RAVI Indicator: https://www.tradingview.com/v/GhxOzF0z/ 
38. Trade Intensity Indicator: https://www.tradingview.com/v/GhxOzF0z/ 
39. Inverse Fisher on RSI: https://www.tradingview.com/v/8OxW1SF4/ 
40. Inverse Fisher on MFI: https://www.tradingview.com/v/8OxW1SF4/ 
41. Inverse Fisher on CyberCycle: https://www.tradingview.com/v/8OxW1SF4/ 
42. Bear COG channel: https://www.tradingview.com/v/WNREeNU6/ 
43. Twiggs Money Flow : https://www.tradingview.com/v/Jccjg8CR/#tc73426 
44. Wilder's MA : https://www.tradingview.com/v/Jccjg8CR/#tc73426 
45. Bear COG Fib Channel: http://pastebin.com/CbxY31at 
46. Market Facilitation Index : https://www.tradingview.com/v/0BANZQhK/ 
47. Volatility Quality Index : https://www.tradingview.com/v/MbAO4zo0/ 
48. 11x EMA with Cross-highlights: http://pastebin.com/CeqUg7M1 
49. Projection Bands: https://www.tradingview.com/v/yAKD6bQA/ 
50. Projection Oscillator: https://www.tradingview.com/v/yAKD6bQA/ 
51. Projection Bands Bandwidth: https://www.tradingview.com/v/yAKD6bQA/ 
52. Hurst Bands: https://www.tradingview.com/v/yl3pK2zM/ 
53. Hurst Oscillator: https://www.tradingview.com/v/yl3pK2zM/ 
54. Inverse Fisher Transform on CCI: https://www.tradingview.com/v/oyfd86j2/ 
55. Z-Score: https://www.tradingview.com/v/oyfd86j2/ 
56. R-Squared: https://www.tradingview.com/v/oyfd86j2/ 
57. Guppy MMA: https://www.tradingview.com/v/kfFtIl1p/ 
58. Guppy Oscillator: https://www.tradingview.com/v/kfFtIl1p/ 
59. Linda Raschke Oscillator: https://www.tradingview.com/v/kfFtIl1p/ 
60. Ian Oscillator: https://www.tradingview.com/v/kfFtIl1p/ 
61. Constance Brown Composite Index: https://www.tradingview.com/v/qcmM1Ocn/ 
62. RSI+Avgs: https://www.tradingview.com/v/qcmM1Ocn/ 
63. Accumulative Swing Index: https://www.tradingview.com/v/ezHLOxrK/ 
64. ASI Oscillator: https://www.tradingview.com/v/ezHLOxrK/   

65. Tom Demark Range Expansion Index: https://www.tradingview.com/v/ezHLOxrK/ 
66. Correlation Coefficient + MA: http://pastebin.com/dqBYCpkP 
67. Elders Force Index with MA & BB on MA: http://pastebin.com/aUEGnLqC 
68. Traders Dynamic Index: https://www.tradingview.com/v/sQKGbRRi/ 
69. HLCTrends: https://www.tradingview.com/v/sQKGbRRi/ 
70. Trix Ribbon: https://www.tradingview.com/v/sQKGbRRi/ 
71. Volume Price Confirmation Indicator (VPCI): https://www.tradingview.com/v/lmTqKOsa/ 
72. Better Volume Indicator: https://www.tradingview.com/v/LfVJhuir/ 
73. Volume of any Instrument: https://www.tradingview.com/v/LfVJhuir/ 
74. 2 pole Butterworth filter: https://www.tradingview.com/v/mgxOwThP/ 
75. 3 pole Butterworth filter: https://www.tradingview.com/v/mgxOwThP/ 
76. 2 pole Super Smoother filter: https://www.tradingview.com/v/mgxOwThP/ 
77. 3 pole Super Smoother filter: https://www.tradingview.com/v/mgxOwThP/
78. RSI with Volume: https://www.tradingview.com/v/754ebrmb/ 
79. RSI using SMA: https://www.tradingview.com/v/754ebrmb/ 
80. RSI using EMA: https://www.tradingview.com/v/754ebrmb/ 
81. RSI using Last Open: https://www.tradingview.com/v/754ebrmb/ 
82. RSI of MACD: https://www.tradingview.com/v/754ebrmb/ 
83. RSI with Fibs: https://www.tradingview.com/v/754ebrmb/ 
84. Volume Zone Indicator: https://www.tradingview.com/v/eM057Bu5/ 
85: Price Zone Indicator: https://www.tradingview.com/v/eM057Bu5/ 
86. WaveTrend Oscillator: https://www.tradingview.com/v/2KE8wTuF/ 
87. Volume-Weighted MACD Histogram: https://www.tradingview.com/v/fhPYhWYA/ 
88. Sentiment Zone Indicator: https://www.tradingview.com/v/fhPYhWYA/
89. Elder Impulse System: https://www.tradingview.com/v/oCbEFfpg/ 
90. Time and Money Chart Channel: https://www.tradingview.com/v/qOdWLAxG/ 
91. Demark Pressure Ratio: https://www.tradingview.com/v/qOdWLAxG/ 
92. Relative Volume Indicator: https://www.tradingview.com/v/HT2zozvk/ 
93. Freedom Of Movement: https://www.tradingview.com/v/HT2zozvk/ 
94. Chartmill Value Indicator: https://www.tradingview.com/v/I271vJqF/ 
95. Random Walk Index: https://www.tradingview.com/v/I271vJqF/ 
96. KaseCD: https://www.tradingview.com/v/wIWnrc4i/ 
97. Kase Peak Oscillator: https://www.tradingview.com/v/wIWnrc4i/ 
98. Krivo Index : https://www.tradingview.com/v/jolsrMiN/ 
99. Rainbow Charts MAs: https://www.tradingview.com/v/gWYg0ti0/

100. Rainbow Charts Oscillator: https://www.tradingview.com/v/gWYg0ti0/ 
101. Rainbow Charts Binary UpWave: https://www.tradingview.com/v/gWYg0ti0/
102. Volume Flow Indicator: https://www.tradingview.com/v/MhlDpfdS/ 
103. ValueChart Indicator: https://www.tradingview.com/v/vqWXNNq2/ 
104. Kaufman Stress Indicator: https://www.tradingview.com/v/uKzpaELr/ 
105. HawkEye Volume Indicator: https://www.tradingview.com/v/gci6llVF/ 
106. Price Headley Accelaration Bands: https://www.tradingview.com/v/wM2yTTOq/ 
107. Trend Trigger Factor: https://www.tradingview.com/v/wSMZKu7B/ 
108. Premier Stochastic Oscillator: https://www.tradingview.com/v/xewuyTA1/ 
109. Squeeze Momentum Indicator: https://www.tradingview.com/v/nqQ1DT5a/ 
110. BBImpulse Indicator: https://www.tradingview.com/v/2gNjWqnv/ 
111. MAC-Z Indicator: https://www.tradingview.com/v/IHuR4jre/ 
112. DEnvelope : https://www.tradingview.com/v/dK1uhbN8/ 
113. DEnvelope Bandwidth: http://pastebin.com/jz6QL45G 
114. DEnvelope %B: http://pastebin.com/r4XfrDvd 
115. RSI Bands: https://www.tradingview.com/v/zWq2YfzA/
116. RSI %B: https://www.tradingview.com/v/zWq2YfzA/
117. RSI Bandwidth: https://www.tradingview.com/v/zWq2YfzA/
118. Vervoort Smoothed Oscillator: https://www.tradingview.com/v/EXtLf5PR/
119. Weis Wave Volume: https://www.tradingview.com/v/HFGx4ote/
120. Ehlers Smoothed Stochastic: https://www.tradingview.com/v/Tpv7Ld27/
121. RSI with Ehlers Roofing Filter: https://www.tradingview.com/v/Tpv7Ld27/
122. RSI++ (RSI+ROC+MACD+CCI+STOCHK): http://pastebin.com/SGurSgUG
123. Bulkowsky NR7/NR4 pattern identifier: http://pastebin.com/JR0hLdwq
124. StochRSI + Volatility Bands: http://pastebin.com/dg5HnYM6
125. Colored SMIIO: http://pastebin.com/BEAUNBmY
126. Intraday Momentum Index: https://www.tradingview.com/v/3CufgHsc/
127. Z distance from VWAP: https://www.tradingview.com/v/HraIjfKF/
128. Colored Volume Bars: https://www.tradingview.com/v/ppFnYLjh/
129. Enhanced Index: https://www.tradingview.com/v/aAjBxcjP/
130. MACZ-VWAP: https://www.tradingview.com/v/HNrsbpJ2/
131. Earnings S/R Levels: https://www.tradingview.com/v/fhhMS2b5/
132. Elastic Volume Weighted Moving Average: https://www.tradingview.com/v/YxzbpyLG/
133. CCT Bollinger Band Oscillator: https://www.tradingview.com/v/iA4XGCJW/
134. Vervoort Smoothed %b: https://www.tradingview.com/v/sDPe1PDd/

135. McGinley Dynamic Convergence / Divergence: http://pastebin.com/4TFRqpex
136. DT Oscillator: http://pastebin.com/c0sBYXyw
137. Leader of MACD: https://www.tradingview.com/v/y9HCZoQi/
138. ZeroLag EMA / KAMA MACD with Leader feature: http://pastebin.com/psW5bfGk
139. Volatility Based Trailing Stops: http://pastebin.com/PpVZvSXG
140. BTC All Exchanges Volume Averaged: http://pastebin.com/xTjZWxax
141. WMA on OBV: http://pastebin.com/nsYZjGPu
142. NYSE A/D line: http://pastebin.com/fYMzqj6z
143. Short-term Volume and Price Oscillator: https://www.tradingview.com/v/Nsgeq4iJ/
144. Vervoort Volatility Bands: https://www.tradingview.com/v/zXEjsttC/
145. Elder’s Market Thermometer: https://www.tradingview.com/v/HqvTuEMW/
146. Waddah Attar Explosion: https://www.tradingview.com/v/iu3kKWDI/
147. Vervoort Modified %b MTF version: http://pastebin.com/R7LihXPD
148. Market Facilitation Index MTF version: http://pastebin.com/NZRvLP7Y
149. Squeeze Momentum Indicator MTF version: http://pastebin.com/ZFpNuFfB
150. No Volume SVAPO: https://www.tradingview.com/v/TSDzwIwk/
151. Custom Bollinger Bands Width: http://pastebin.com/9wkQXqEQ
152. Vervoort Heiken-Ashi Candlestick Oscillator: https://www.tradingview.com/v/UyhY8FuQ/
153. Vervoort LT Heiken-Ashi Candlestick Osc: https://www.tradingview.com/v/4zuhGaAU/
154. VWAP Bands: http://pastebin.com/6VqZ8DQ3
155. Ehler’s Universal Oscillator: https://www.tradingview.com/v/ieFYbVdC/
156. Variable Moving Average: https://www.tradingview.com/v/6Ix0E5Yr/
157. VMA Bands: https://www.tradingview.com/v/HT99VkZb/
158. Market Direction Indicator: https://www.tradingview.com/v/wGAhnKHS/
159. Anchored Momentum: https://www.tradingview.com/v/TBTFDWDq/
160. Coral Trend Indicator: https://www.tradingview.com/v/qyUwc2Al/
161. EMA Wave Indicator: https://www.tradingview.com/v/5sofTZ6c/
162. Volatility Switch Indicator: https://www.tradingview.com/v/50YzpVDY/
163. SAR_ALARM script: http://pastebin.com/ak2M5Dte
164. Just Another Pivot: http://pastebin.com/MtsMLN2z (HLC3 from custom TF)
165. Price Volume Rank: https://www.tradingview.com/v/vho8gnBR/
166. LBR Paintbars: https://www.tradingview.com/v/PWOIfQ04/ (Updated code: http://pastebin.com/AhVQ1FBn )
167. Mirrored MACD: https://www.tradingview.com/v/EchwZVoz/

168. McClellan Oscillator: https://www.tradingview.com/v/8YstxIAf/
169. McClellan Summation Index: https://www.tradingview.com/v/m1SIvJNP/
170. Insync Index: https://www.tradingview.com/v/klczcNre/ [v02 - http://pastebin.com/fZ4PmemR ]
171. Hurst Cycle Channel Clone: https://www.tradingview.com/v/QmgtSIj5/
172. Cycle Channel Oscillator: https://www.tradingview.com/v/3yAQDB3h/
173. Volume Accumulation Percentage Indicator: https://www.tradingview.com/v/kVk6pN9z/
174. Belkhayate Timing: https://www.tradingview.com/v/az4eEBSC/ [v2 - http://pastebin.com/fVx5Bugi]
175. MFIndex overlay + histo: http://pastebin.com/Kwbv7qrT
176. Pipcollector Forex Strategy: https://www.tradingview.com/v/sfdQKGCn/
177. JMA RSX Clone: https://www.tradingview.com/script/XzcIRUHv/
178. Range Identifier: https://www.tradingview.com/script/FnFO … -LazyBear/ [v2: http://pastebin.com/xgweVbrC]
179. Impulse MACD: https://www.tradingview.com/script/qt6x … -LazyBear/
180: CCT StochRSI: https://www.tradingview.com/script/T1IH … -LazyBear/
181. Insync Index with BB: http://pastebin.com/QthKHEZa [v2: http://pastebin.com/4QKdCEs7 ]
182. Firefly Oscillator: https://www.tradingview.com/script/pgvR … -LazyBear/
183. Range Identifier with filtered ranges (v3):  http://pastebin.com/Z11JYVQK
184. Zweig Market Thrust Indicator: https://www.tradingview.com/script/NcNA … -LazyBear/
185. High-Low Index: https://www.tradingview.com/script/p7RB … -LazyBear/ [Fixed: http://pastebin.com/Z0uS17zD]
186. Composite Momentum Index: https://www.tradingview.com/script/BkHy … -LazyBear/
187. Fishnet: 150EMAs - http://pastebin.com/QQWkSZyV, 200 EMAs - http://pastebin.com/AcqLvfVn
188. Absolute Strength Index Oscillator: https://www.tradingview.com/script/E6xc … -LazyBear/
189. Absolute Strength Index: http://pastebin.com/YZVswCKJ
190. ATR in Pips: https://www.tradingview.com/script/O2Dd … -LazyBear/

191. Ehlers CyberCycle Indicator: https://www.tradingview.com/script/bJdq … -LazyBear/
192. Premier RSI Oscillator: https://www.tradingview.com/script/nExs … -LazyBear/
193. Ehlers Center of Gravity Oscillator: https://www.tradingview.com/script/gFkG … -LazyBear/
194. Ehlers Instantaneous Trendline: https://www.tradingview.com/script/DaHL … -LazyBear/
195. Ehlers Simple Cycle Indicator: https://www.tradingview.com/script/xQ4m … -LazyBear/
196. Ehlers MESA Adaptive Moving Average: https://www.tradingview.com/script/foQx … -LazyBear/
197. Ehlers Stochastic CG Oscillator:
https://www.tradingview.com/script/aX0y … -LazyBear/
198. Ehlers Adaptive Cyber Cycle Indicator: https://www.tradingview.com/script/3lV1 … -LazyBear/
199. Ehlers Adaptive CG Oscillator: https://www.tradingview.com/script/Nz4A … -LazyBear/
200. Ehlers Smoothed Adaptive Momentum Indicator: https://www.tradingview.com/script/vIE6 … -LazyBear/
201. Apirine Slow RSI: https://www.tradingview.com/script/3VDd … -LazyBear/
202. Adaptive Ergodic Candlestick Oscillator: https://www.tradingview.com/script/vWzB … -LazyBear/
203. Decisionpoint Price Momentum Oscillator: https://www.tradingview.com/script/5e9W … -LazyBear/
204. DecisionPoint Swenlin Trading Oscillator [Breadth]: https://www.tradingview.com/script/tSiv … -LazyBear/

205. DecisionPoint Swenlin Trading Oscillator [Volume]: https://www.tradingview.com/script/VZ6O … -LazyBear/

0

69

//+------------------------------------------------------------------+
//|                                       Candle Channel wArrows.mq4 |
//+------------------------------------------------------------------+
#property indicator_chart_window
#property indicator_buffers 8
#property indicator_color1  LimeGreen
#property indicator_color2  Orange
#property indicator_color3  Orange
#property indicator_color4  LimeGreen
#property indicator_color5  Orange
#property indicator_color6  Orange
#property indicator_color7  Green
#property indicator_color8  Red

#property indicator_width1  2
#property indicator_width2  2
#property indicator_width3  2
#property indicator_width4  2
#property indicator_width5  2
#property indicator_width6  2
#property indicator_width7  1
#property indicator_width8  1

int    Price       =  2;
int    Price2      =  3;
int    AdaptPeriod =  1;

extern double Length = 5;
extern bool ShowArrows=true;

double ssm[];
double ssmda[];
double ssmdb[];
double slope[];
double ssm2[];
double ssmda2[];
double ssmdb2[];
double slope2[];
double arr_up[];
double arr_dn[];
//------------------------------------------------------------------
//
//------------------------------------------------------------------
int init()
{
   IndicatorBuffers(10);
   SetIndexBuffer(0,ssm);
   SetIndexBuffer(1,ssmda);
   SetIndexBuffer(2,ssmdb);
   SetIndexBuffer(3,ssm2);
   SetIndexBuffer(4,ssmda2);
   SetIndexBuffer(5,ssmdb2);

   SetIndexBuffer(6, arr_up);
   SetIndexBuffer(7, arr_dn); 

   if(ShowArrows)
   {
      SetIndexStyle(6, DRAW_ARROW);
      SetIndexArrow(6, 233);
      SetIndexStyle(7, DRAW_ARROW);
      SetIndexArrow(7, 234);
   }
   else
   {
      SetIndexStyle(6, DRAW_NONE);
      SetIndexStyle(7, DRAW_NONE);   
   }   
   SetIndexBuffer(8,slope);
   SetIndexBuffer(9,slope2);
   IndicatorShortName ("super smoother");
   return(0);
}
int deinit() { return(0); }

//------------------------------------------------------------------
//
//------------------------------------------------------------------
int start()
{
   int counted_bars=IndicatorCounted();
   if(counted_bars<0) return(-1);
   if(counted_bars>0) counted_bars--;
   int limit = MathMin(Bars-counted_bars,Bars-1);

   int i;
   
   if (slope[limit]==-1) CleanPoint(limit,ssmda,ssmdb);
   for(i=limit; i >= 0; i--)
   {
      double dev = iStdDev(NULL,0,AdaptPeriod,0,MODE_SMA,Price,i);
      double avg = iSma(dev,AdaptPeriod,i,0);
      if (dev!=0)
          double period = Length*avg/dev;
      else          period = Length;
      if (period<3) period = 3;
      ssm[i] = iSmooth(iMA(NULL,0,1,0,MODE_SMA,Price,i),period,i,0);
      ssmda[i] = EMPTY_VALUE;
      ssmdb[i] = EMPTY_VALUE;
      slope[i] = slope[i+1];
      if (ssm[i]>ssm[i+1]) slope[i] =  1;
      if (ssm[i]<ssm[i+1]) slope[i] = -1;
      if (slope[i] == -1) PlotPoint(i,ssmda,ssmdb,ssm);
   }   
   
   if (slope2[limit]==-1) CleanPoint(limit,ssmda2,ssmdb2);
   for(i=limit; i >= 0; i--)
   {
      double dev2 = iStdDev(NULL,0,AdaptPeriod,0,MODE_SMA,Price2,i);
      double avg2 = iSma(dev,AdaptPeriod,i,1);
      if (dev2!=0)
          double period2 = Length*avg2/dev2;
      else          period2 = Length;
      if (period2<3) period2 = 3;
      ssm2[i] = iSmooth(iMA(NULL,0,1,0,MODE_SMA,Price2,i),period2,i,1);
      ssmda2[i] = EMPTY_VALUE;
      ssmdb2[i] = EMPTY_VALUE;
      slope2[i] = slope2[i+1];
      if (ssm2[i]>ssm2[i+1]) slope2[i] =  1;
      if (ssm2[i]<ssm2[i+1]) slope2[i] = -1;
      if (slope2[i] == -1) PlotPoint(i,ssmda2,ssmdb2,ssm2);
   }   

   for(i=limit-1; i>=1; i--)
   {
      int j=i;
      double var1 = 0;
      double var2 = 0;
      for (j = i; j <= i + 9; j++) var2 += MathAbs(iHigh(Symbol(),0,j) - iHigh(Symbol(),0,j));
      var1 = var2 / 10.0;
      arr_up[i] = arr_dn[i] = EMPTY_VALUE;
      double close1=iClose(Symbol(),0,i);
      if(close1>ssm[i])
      {
         arr_up[i]=ssm2[i] - (var1);
      }
      else if(close1<ssm2[i])
      {
         arr_dn[i]=ssm[i] + (var1);
      }
   }     

   return(0);
}

//------------------------------------------------------------------
//
//------------------------------------------------------------------
double workSmooth[][10];
double iSmooth(double price,int length,int r, int instanceNo=0)
{
   if (ArrayRange(workSmooth,0)!=Bars) ArrayResize(workSmooth,Bars); instanceNo *= 5; r = Bars-r-1;
if(r<=2) { workSmooth[r][instanceNo] = price; workSmooth[r][instanceNo+2] = price; workSmooth[r][instanceNo+4] = price; return(price); }

double alpha = 0.45*(length-1.0)/(0.45*(length-1.0)+2.0);
      workSmooth[r][instanceNo+0] =  price+alpha*(workSmooth[r-1][instanceNo]-price);
     workSmooth[r][instanceNo+1] = (price - workSmooth[r][instanceNo])*(1-alpha)+alpha*workSmooth[r-1][instanceNo+1];
     workSmooth[r][instanceNo+2] =  workSmooth[r][instanceNo+0] + workSmooth[r][instanceNo+1];
     workSmooth[r][instanceNo+3] = (workSmooth[r][instanceNo+2] - workSmooth[r-1][instanceNo+4])*MathPow(1.0-alpha,2) + MathPow(alpha,2)*workSmooth[r-1][instanceNo+3];
     workSmooth[r][instanceNo+4] =  workSmooth[r][instanceNo+3] + workSmooth[r-1][instanceNo+4];
   return(workSmooth[r][instanceNo+4]);
}

//-------------------------------------------------------------------
//
//-------------------------------------------------------------------
double workSma[][4];
double iSma(double price, int period, int r, int instanceNo=0)
{
   if (ArrayRange(workSma,0)!= Bars) ArrayResize(workSma,Bars); instanceNo *= 2; r = Bars-r-1;

   workSma[r][instanceNo] = price;
   if (r>=period)
          workSma[r][instanceNo+1] = workSma[r-1][instanceNo+1]+(workSma[r][instanceNo]-workSma[r-period][instanceNo])/period;
   else { workSma[r][instanceNo+1] = 0; for(int k=0; k<period && (r-k)>=0; k++) workSma[r][instanceNo+1] += workSma[r-k][instanceNo]; 
          workSma[r][instanceNo+1] /= k; }
   return(workSma[r][instanceNo+1]);
}

//-------------------------------------------------------------------
//
//-------------------------------------------------------------------
void CleanPoint(int i,double& first[],double& second[])
{
   if ((second[i]  != EMPTY_VALUE) && (second[i+1] != EMPTY_VALUE))
        second[i+1] = EMPTY_VALUE;
   else
      if ((first[i] != EMPTY_VALUE) && (first[i+1] != EMPTY_VALUE) && (first[i+2] == EMPTY_VALUE))
          first[i+1] = EMPTY_VALUE;
}

void PlotPoint(int i,double& first[],double& second[],double& from[])
{
   if (first[i+1] == EMPTY_VALUE)
      {
         if (first[i+2] == EMPTY_VALUE) {
                first[i]   = from[i];
                first[i+1] = from[i+1];
                second[i]  = EMPTY_VALUE;
            }
         else {
                second[i]   =  from[i];
                second[i+1] =  from[i+1];
                first[i]    = EMPTY_VALUE;
            }
      }
   else
      {
         first[i]  = from[i];
         second[i] = EMPTY_VALUE;
      }
}

//-------------------------------------------------------------------

0

70

https://forex-station.com/post129556636 … 1295566369

Trading View Программист
https://forexsystemru.com/threads/skrip … 51/page-20

0

71

//@version=6
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
//$                                                                                 $
//$ Благодарность приветствуется!                                                   $
//$ Gratitude is appreciated!                                                       $
//$                                                                                 $
//$ Вы можете сделать пожертвование через:                                          $
//$ You may donate via:                                                             $
//$                                                                                 $
//$ Крипто-мультивалютный кошелек                                                   $
//$ Crypto-multi-currency wallet                                                    $
//$                                                                                 $
//$ https://tinyurl.com/4f9dr9nw                                                    $
//$                                                                                 $
//$    - BTC: 1EpDN7pg1WqURcK7te5kQtgx3H17wuHiV7                                    $
//$                                                                                 $
//$    - LTC: MJyEtVt7EFmA18Bo1vjRMbguivHnVbbWvp                                    $
//$                                                                                 $
//$ Пожертвуйте столько, сколько считаете нужным.                                   $
//$ Donate as much as you see fit.                                                  $
//$                                                                                 $
//$ Сделайте это, если найдете этот материал полезным!                              $
//$ Do it if you find the stuff useful!                                             $
//$                                                                                 $
//$ Disclaimer: I am not a financial advisor.                                       $
//$ Отказ от ответственности: я не финансовый консультант.                          $
//$                                                                                 $
//$ For purpose educate only. Use at your own risk.                                 $
//$ Только в образовательных целях. Используйте на свой страх и риск.               $
//$                                                                                 $
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

indicator('<[RSI или WPR Bands]>', shorttitle = '<[RSI_WPR_BANDS]>', overlay = true)

// Переключатель
indicatorType = input.string(title = 'Выберите индикатор', defval = 'RSI', options = ['RSI', 'Williams %R'])

// Общие параметры
length = input.int(14, title = 'Длина', minval = 1)

// Уровни RSI
rsi_obLevel = input.int(70, title = 'RSI Уровень перекупленности', minval = 50, maxval = 100)
rsi_osLevel = input.int(30, title = 'RSI Уровень перепроданности', minval = 0, maxval = 50)

// Уровни WPR
wpr_obLevel = input.int(-20, title = 'WPR Уровень перекупленности', minval = -100, maxval = 0)
wpr_osLevel = input.int(-80, title = 'WPR Уровень перепроданности', minval = -100, maxval = 0)

src = close

// --- Расчет RSI Bands ---
ep = 2 * length - 1
auc = ta.ema(math.max(src - src[1], 0), ep)
adc = ta.ema(math.max(src[1] - src, 0), ep)
x1 = (length - 1) * (adc * rsi_obLevel / (100 - rsi_obLevel) - auc)
rsi_ub = x1 >= 0 ? src + x1 : src + x1 * (100 - rsi_obLevel) / rsi_obLevel
x2 = (length - 1) * (adc * rsi_osLevel / (100 - rsi_osLevel) - auc)
rsi_lb = x2 >= 0 ? src + x2 : src + x2 * (100 - rsi_osLevel) / rsi_osLevel
rsi_mid = math.avg(rsi_ub, rsi_lb)

// --- Расчет Williams %R Bands ---
H = ta.highest(high, length)
L = ta.lowest(low, length)
C = close

wpr = -((H - C) / (H - L)) * 100

dist_to_ob = wpr_obLevel - wpr
dist_to_os = wpr - wpr_osLevel

scale = (H - L) / 100

wpr_ub = close + dist_to_ob * scale
wpr_lb = close - dist_to_os * scale
wpr_mid = math.avg(wpr_ub, wpr_lb)

// Вывод в зависимости от выбора
ub = indicatorType == 'RSI' ? rsi_ub : wpr_ub
lb = indicatorType == 'RSI' ? rsi_lb : wpr_lb
mid = indicatorType == 'RSI' ? rsi_mid : wpr_mid

// Цвета для наглядности
plot(ub, title = 'Сопротивление', color = #ff5252, linewidth = 2)
plot(lb, title = 'Поддержка', color = #4caf50, linewidth = 2)
plot(mid, title = 'Midline', color = #787b86, linewidth = 1)

//=================================================================================//

0

72

Микроплатежный кошелек и платформа для заработка
Получайте мгновенные криптовалютные платежи с тысяч сайтов и выводите их на свой личный кошелек за очень низкую комиссию.

https://faucetpay.io/?r=64632

------------------------------
https://www.mql5.com/ru/users/satop
https://www.mql5.com/en/search#!keyword … amp;page=5
https://www.mql5.com/en/code/15084

0

73

//+------------------------------------------------------------------+
//|                                                   RSI_Bands_LB.mq4 |
//|                        Converted based on LazyBear's RSI Bands   |
//|                                     Fixed display issues         |
//+------------------------------------------------------------------+
#property copyright "Converted based on LazyBear's RSI Bands"
#property link      "https://www.tradingview.com/script/7qnR0LQn-RSI-Bands-LazyBear/"
#property version   "1.40"
#property strict
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 clrRed
#property indicator_color2 clrGreen
#property indicator_color3 clrGray
#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 1

// Input parameters
input int      Overbought_Level = 70;    // RSI Overbought
input int      Oversold_Level = 30;      // RSI Oversold
input int      RSI_Length = 14;          // RSI Length

// Indicator buffers
double ResistanceBuffer[];
double SupportBuffer[];
double MidlineBuffer[];

// Global variables
int ep;
double alpha;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
{
   // Initialize buffers
   SetIndexBuffer(0, ResistanceBuffer);
   SetIndexBuffer(1, SupportBuffer);
   SetIndexBuffer(2, MidlineBuffer);
   
   // Set indicator labels
   SetIndexLabel(0, "Resistance");
   SetIndexLabel(1, "Support");
   SetIndexLabel(2, "RSI Midline");
   
   // Set drawing settings
   IndicatorDigits(Digits);
   int drawBegin = RSI_Length * 2;
   SetIndexDrawBegin(0, drawBegin);
   SetIndexDrawBegin(1, drawBegin);
   SetIndexDrawBegin(2, drawBegin);
   
   // Set EMA period and alpha
   ep = 2 * RSI_Length - 1;
   alpha = 2.0 / (ep + 1.0);
   
   // Initialize as timeseries
   ArraySetAsSeries(ResistanceBuffer, true);
   ArraySetAsSeries(SupportBuffer, true);
   ArraySetAsSeries(MidlineBuffer, true);
   
   return(INIT_SUCCEEDED);
}

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
{
   // Set array directions
   ArraySetAsSeries(close, true);
   ArraySetAsSeries(open, true);
   ArraySetAsSeries(high, true);
   ArraySetAsSeries(low, true);
   
   // Check for minimum data
   if (rates_total <= ep + 1)
      return(0);
     
   // Calculate starting position
   int start;
   if (prev_calculated == 0)
   {
      // Full recalculation - start from beginning
      start = ep;
   }
   else
   {
      // Only calculate new bars
      start = prev_calculated - 1;
   }

   // Initialize EMA variables for this run
   double auc = 0, adc = 0;
   bool firstCalculation = true;
   
   // Main calculation loop from oldest to newest
   for (int i = start; i >= 0; i--)
   {
      // Skip bars without enough history
      if (i + ep >= rates_total)
      {
         ResistanceBuffer[i] = EMPTY_VALUE;
         SupportBuffer[i] = EMPTY_VALUE;
         MidlineBuffer[i] = EMPTY_VALUE;
         continue;
      }

      // Initialize EMAs on first run
      if (prev_calculated == 0 && firstCalculation)
      {
         firstCalculation = false;
         
         // Calculate initial SMA for AUC
         double sumUp = 0;
         double sumDn = 0;
         for (int j = i; j < i + ep; j++)
         {
            double delta = close[j] - close[j+1];
            sumUp += MathMax(delta, 0);
            sumDn += MathMax(-delta, 0);
         }
         auc = sumUp / ep;
         adc = sumDn / ep;
      }
     
      // Calculate price changes
      double delta = close[i] - close[i+1];
      double up = MathMax(delta, 0);
      double down = MathMax(-delta, 0);
     
      // Update EMAs
      auc = alpha * up + (1 - alpha) * auc;
      adc = alpha * down + (1 - alpha) * adc;
     
      // Avoid division by zero
      double obDivisor = MathMax(100 - Overbought_Level, 0.0001);
      double osDivisor = MathMax(100 - Oversold_Level, 0.0001);
     
      // Calculate bands
      double x1 = (RSI_Length - 1) * (adc * Overbought_Level / obDivisor - auc);
      double ub = (x1 >= 0) ? close[i] + x1 : close[i] + x1 * (100 - Overbought_Level) / Overbought_Level;
     
      double x2 = (RSI_Length - 1) * (adc * Oversold_Level / osDivisor - auc);
      double lb = (x2 >= 0) ? close[i] + x2 : close[i] + x2 * (100 - Oversold_Level) / Oversold_Level;
     
      // Store results
      ResistanceBuffer[i] = ub;
      SupportBuffer[i] = lb;
      MidlineBuffer[i] = (ub + lb) / 2.0;
   }

   return(rates_total);
}
//+------------------------------------------------------------------+

0

74

//+------------------------------------------------------------------+
//|                                              Williams_RSI_Bands.mq4 |
//|                  Adapted from LazyBear's RSI Bands with %R Williams |
//+------------------------------------------------------------------+
#property copyright "Adapted from LazyBear's RSI Bands"
#property link      "https://www.tradingview.com/script/7qnR0LQn-RSI-Bands-LazyBear/"
#property version   "2.0"
#property strict
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 clrRed
#property indicator_color2 clrGreen
#property indicator_color3 clrGray
#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 1

// Input parameters
input int      Overbought_Level = 70;    // Overbought level
input int      Oversold_Level = 30;      // Oversold level
input int      WR_Length = 14;           // Williams %R Length

// Indicator buffers
double ResistanceBuffer[];
double SupportBuffer[];
double MidlineBuffer[];

// Global variables
int ep;
double alpha;
double last_auc, last_adc;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
{
   // Initialize buffers
   SetIndexBuffer(0, ResistanceBuffer);
   SetIndexBuffer(1, SupportBuffer);
   SetIndexBuffer(2, MidlineBuffer);
   
   // Set indicator labels
   SetIndexLabel(0, "Resistance");
   SetIndexLabel(1, "Support");
   SetIndexLabel(2, "Midline");
   
   // Set drawing settings
   IndicatorDigits(Digits);
   SetIndexDrawBegin(0, WR_Length*3);
   SetIndexDrawBegin(1, WR_Length*3);
   SetIndexDrawBegin(2, WR_Length*3);
   
   // Set EMA period and alpha
   ep = 2 * WR_Length - 1;
   alpha = 2.0 / (ep + 1.0);
   
   // Initialize as timeseries
   ArraySetAsSeries(ResistanceBuffer, true);
   ArraySetAsSeries(SupportBuffer, true);
   ArraySetAsSeries(MidlineBuffer, true);
   
   return(INIT_SUCCEEDED);
}

//+------------------------------------------------------------------+
//| Calculate Williams %R value                                      |
//+------------------------------------------------------------------+
double CalculateWPR(int shift, const double &high[], const double &low[], const double &close[])
{
   double highestHigh = high[shift];
   double lowestLow = low[shift];
   
   // Find highest high and lowest low over the period
   for(int i = shift; i < shift + WR_Length; i++)
   {
      if(i >= ArraySize(high)) break;
      if(high[i] > highestHigh) highestHigh = high[i];
      if(low[i] < lowestLow) lowestLow = low[i];
   }
   
   // Avoid division by zero
   if(MathAbs(highestHigh - lowestLow) < 0.0001)
      return -50; // Neutral value when no range
   
   // Calculate Williams %R
   double wpr = -((highestHigh - close[shift]) / (highestHigh - lowestLow)) * 100;
   return wpr;
}

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
{
   // Set array directions
   ArraySetAsSeries(high, true);
   ArraySetAsSeries(low, true);
   ArraySetAsSeries(close, true);
   
   // Check for minimum data
   if(rates_total <= WR_Length * 3)
      return(0);
     
   // Calculate starting position
   int start;
   if(prev_calculated == 0)
   {
      start = rates_total - 1 - WR_Length; // Leave space for WR calculation
      last_auc = 0;
      last_adc = 0;
   }
   else start = prev_calculated - 1;

   // Main calculation loop
   for(int i = start; i >= 0; i--)
   {
      // Skip bars without enough history for WR calculation
      if(i + WR_Length >= rates_total)
      {
         ResistanceBuffer[i] = EMPTY_VALUE;
         SupportBuffer[i] = EMPTY_VALUE;
         MidlineBuffer[i] = EMPTY_VALUE;
         continue;
      }
     
      // Calculate Williams %R
      double wpr = CalculateWPR(i, high, low, close);
     
      // Convert to 0-100 scale (similar to RSI)
      double normalized = 100 + wpr;
     
      // Calculate components
      double up = MathMax(normalized - 50, 0.0); // Strength above neutral
      double down = MathMax(50 - normalized, 0.0); // Strength below neutral
     
      // Calculate EMAs
      double auc, adc;
     
      if(prev_calculated == 0 && i == start)
      {
         // Simple average initialization
         double sum_up = 0;
         double sum_dn = 0;
         int count = 0;
         
         for(int j = i; j < MathMin(i + ep, rates_total - 1); j++)
         {
            double w = CalculateWPR(j, high, low, close);
            double n = 100 + w;
            sum_up += MathMax(n - 50, 0.0);
            sum_dn += MathMax(50 - n, 0.0);
            count++;
         }
         
         if(count > 0)
         {
            auc = sum_up / count;
            adc = sum_dn / count;
         }
         else
         {
            auc = up;
            adc = down;
         }
      }
      else
      {
         // EMA calculation
         auc = alpha * up + (1 - alpha) * last_auc;
         adc = alpha * down + (1 - alpha) * last_adc;
      }
     
      // Store EMA values for next calculation
      last_auc = auc;
      last_adc = adc;
     
      // Avoid division by zero
      double obDivisor = MathMax(100 - Overbought_Level, 0.0001);
      double osDivisor = MathMax(100 - Oversold_Level, 0.0001);
     
      // Calculate bands
      double x1 = (WR_Length - 1) * (adc * Overbought_Level / obDivisor - auc);
      double ub;
      if(x1 >= 0)
         ub = close[i] + x1;
      else
         ub = close[i] + x1 * (100 - Overbought_Level) / Overbought_Level;
     
      double x2 = (WR_Length - 1) * (adc * Oversold_Level / osDivisor - auc);
      double lb;
      if(x2 >= 0)
         lb = close[i] + x2;
      else
         lb = close[i] + x2 * (100 - Oversold_Level) / Oversold_Level;
     
      // Store results
      ResistanceBuffer[i] = ub;
      SupportBuffer[i] = lb;
      MidlineBuffer[i] = (ub + lb) / 2.0;
   }

   return(rates_total);
}
//+------------------------------------------------------------------+

0

75

//+------------------------------------------------------------------+
//|                                                     WPR_Bands.mq4|
//+------------------------------------------------------------------+
#property copyright "Based on LazyBear's RSI Bands, adapted for WPR"
#property version   "1.00"

#property strict
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 clrRed
#property indicator_color2 clrGreen
#property indicator_color3 clrGray
#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 1

input int WPR_Length       = 14;
input int Overbought_Level = -20;
input int Oversold_Level   = -80;

double ResistanceBuffer[];
double SupportBuffer[];
double MidlineBuffer[];

double HighestValue(const double& arr[], int start, int length)
{
   double max_val = arr[start];
   for(int i = start; i < start + length; i++)
      if(arr[i] > max_val) max_val = arr[i];
   return max_val;
}

double LowestValue(const double& arr[], int start, int length)
{
   double min_val = arr[start];
   for(int i = start; i < start + length; i++)
      if(arr[i] < min_val) min_val = arr[i];
   return min_val;
}

int OnInit()
{
   SetIndexBuffer(0, ResistanceBuffer);
   SetIndexBuffer(1, SupportBuffer);
   SetIndexBuffer(2, MidlineBuffer);

   SetIndexLabel(0, "Resistance");
   SetIndexLabel(1, "Support");
   SetIndexLabel(2, "WPR Midline");

   IndicatorDigits(Digits);

   SetIndexDrawBegin(0, WPR_Length);
   SetIndexDrawBegin(1, WPR_Length);
   SetIndexDrawBegin(2, WPR_Length);

   ArraySetAsSeries(ResistanceBuffer, true);
   ArraySetAsSeries(SupportBuffer, true);
   ArraySetAsSeries(MidlineBuffer, true);

   return(INIT_SUCCEEDED);
}

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
{
   ArraySetAsSeries(close, true);
   ArraySetAsSeries(high, true);
   ArraySetAsSeries(low, true);

   if(rates_total < WPR_Length)
      return(0);

   // Цикл от 0 до rates_total - 1, обязательно
   for(int i = 0; i <= rates_total - WPR_Length; i++)
   {
      double highestHigh = HighestValue(high, i, WPR_Length);
      double lowestLow = LowestValue(low, i, WPR_Length);
      double closePrice = close[i];
      double range = highestHigh - lowestLow;

      if(range == 0)
      {
         ResistanceBuffer[i] = EMPTY_VALUE;
         SupportBuffer[i] = EMPTY_VALUE;
         MidlineBuffer[i] = EMPTY_VALUE;
         continue;
      }

      double wpr = -((highestHigh - closePrice) / range) * 100;

      double dist_to_ob = Overbought_Level - wpr;
      double dist_to_os = wpr - Oversold_Level;

      double scale = range / 100.0;

      double ub = closePrice + dist_to_ob * scale;
      double lb = closePrice - dist_to_os * scale;
      double mid = (ub + lb) / 2.0;

      ResistanceBuffer[i] = ub;
      SupportBuffer[i] = lb;
      MidlineBuffer[i] = mid;
   }

   return(rates_total);
}

0

76

//+------------------------------------------------------------------+
//|                        RSI или WPR Bands [LazyBear]              |
//|                          Объединенный индикатор на MT4           |
//+------------------------------------------------------------------+
#property copyright   "Converted based on LazyBear's RSI Bands"
#property description "DemaN_FxMen"
#property link        "https://www.tradingview.com/script/7qnR0LQn-RSI-Bands-LazyBear/"
#property version     "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 clrRed
#property indicator_color2 clrGreen
#property indicator_color3 clrGray
#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 1

// Входные параметры
input string IndicatorType = "RSI";   // "RSI" или "WPR" - выбор индикатора

// Параметры RSI
input int RSI_Length = 14;
input int RSI_Overbought = 70;
input int RSI_Oversold = 30;

// Параметры WPR
input int WPR_Length = 14;
input int WPR_Overbought = -20;
input int WPR_Oversold = -80;

// Буферы для рисования
double ResistanceBuffer[];
double SupportBuffer[];
double MidlineBuffer[];

// Вспомогательные глобальные для RSI EMA
int ep = 0;
double alpha = 0.0;

//--- Вспомогательные функции для поиска max/min с учётом серийности
double HighestValue(const double& arr[], int start, int length)
{
   double max_val = arr[start];
   for(int i = start + 1; i < start + length; i++)
      if(arr[i] > max_val) max_val = arr[i];
   return max_val;
}

double LowestValue(const double& arr[], int start, int length)
{
   double min_val = arr[start];
   for(int i = start + 1; i < start + length; i++)
      if(arr[i] < min_val) min_val = arr[i];
   return min_val;
}

//+------------------------------------------------------------------+
//| Инициализация                                                   |
//+------------------------------------------------------------------+
int OnInit()
{
   SetIndexBuffer(0, ResistanceBuffer);
   SetIndexBuffer(1, SupportBuffer);
   SetIndexBuffer(2, MidlineBuffer);

   SetIndexLabel(0, "Resistance");
   SetIndexLabel(1, "Support");
   SetIndexLabel(2, IndicatorType == "RSI" ? "RSI Midline" : "WPR Midline");

   IndicatorDigits(Digits);

   int drawBegin = 0;
   if (IndicatorType == "RSI")
      drawBegin = RSI_Length * 2;
   else if (IndicatorType == "WPR")
      drawBegin = WPR_Length;

   SetIndexDrawBegin(0, drawBegin);
   SetIndexDrawBegin(1, drawBegin);
   SetIndexDrawBegin(2, drawBegin);

   ArraySetAsSeries(ResistanceBuffer, true);
   ArraySetAsSeries(SupportBuffer, true);
   ArraySetAsSeries(MidlineBuffer, true);

   // Для RSI считаем ep и alpha
   if(IndicatorType == "RSI")
   {
      ep = 2 * RSI_Length - 1;
      alpha = 2.0 / (ep + 1.0);
   }
   Comment("Copyright © 2025,DemaN_FxMen");
   return(INIT_SUCCEEDED);
}

//+------------------------------------------------------------------+
//| Расчет индикатора                                               |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total, const int prev_calculated,
                const datetime &time[], const double &open[], const double &high[],
                const double &low[], const double &close[], const long &tick_volume[],
                const long &volume[], const int &spread[])
{
   ArraySetAsSeries(close,true);
   ArraySetAsSeries(high,true);
   ArraySetAsSeries(low,true);

   if(IndicatorType == "RSI")
   {
      if(rates_total <= ep + 1)
         return(0);

      int start = (prev_calculated == 0) ? ep : prev_calculated - 1;
      double auc=0, adc=0;
      bool firstCalculation = true;

      for(int i = start; i >= 0; i--)
      {
         if(i + ep >= rates_total)
         {
            ResistanceBuffer[i] = EMPTY_VALUE;
            SupportBuffer[i] = EMPTY_VALUE;
            MidlineBuffer[i] = EMPTY_VALUE;
            continue;
         }

         if(prev_calculated == 0 && firstCalculation)
         {
            firstCalculation = false;
            double sumUp=0, sumDn=0;
            for(int j = i; j < i + ep; j++)
            {
               double delta = close[j] - close[j+1];
               sumUp += MathMax(delta, 0);
               sumDn += MathMax(-delta, 0);
            }
            auc = sumUp / ep;
            adc = sumDn / ep;
         }

         double delta = close[i] - close[i+1];
         double up = MathMax(delta, 0);
         double down = MathMax(-delta, 0);

         auc = alpha * up + (1 - alpha) * auc;
         adc = alpha * down + (1 - alpha) * adc;

         double obDivisor = MathMax(100 - RSI_Overbought, 0.0001);
         double osDivisor = MathMax(100 - RSI_Oversold, 0.0001);

         double x1 = (RSI_Length - 1) * (adc * RSI_Overbought / obDivisor - auc);
         double ub = (x1 >= 0) ? close[i] + x1 : close[i] + x1 * (100 - RSI_Overbought) / RSI_Overbought;

         double x2 = (RSI_Length - 1) * (adc * RSI_Oversold / osDivisor - auc);
         double lb = (x2 >= 0) ? close[i] + x2 : close[i] + x2 * (100 - RSI_Oversold) / RSI_Oversold;

         ResistanceBuffer[i] = ub;
         SupportBuffer[i] = lb;
         MidlineBuffer[i] = (ub + lb) / 2.0;
      }
   }
   else if(IndicatorType == "WPR")
   {
      if(rates_total < WPR_Length)
         return(0);

      for(int i = 0; i <= rates_total - WPR_Length; i++)
      {
         double highestHigh = HighestValue(high, i, WPR_Length);
         double lowestLow = LowestValue(low, i, WPR_Length);
         double closePrice = close[i];
         double range = highestHigh - lowestLow;

         if(range == 0)
         {
            ResistanceBuffer[i] = EMPTY_VALUE;
            SupportBuffer[i] = EMPTY_VALUE;
            MidlineBuffer[i] = EMPTY_VALUE;
            continue;
         }

         double wpr = -((highestHigh - closePrice) / range) * 100;

         double dist_to_ob = WPR_Overbought - wpr;
         double dist_to_os = wpr - WPR_Oversold;

         double scale = range / 100.0;

         double ub = closePrice + dist_to_ob * scale;
         double lb = closePrice - dist_to_os * scale;
         double mid = (ub + lb) / 2.0;

         ResistanceBuffer[i] = ub;
         SupportBuffer[i] = lb;
         MidlineBuffer[i] = mid;
      }
   }

   return(rates_total);
}

0

77

//@version=3
study(title="Donchain Keltner Channels", shorttitle="DKC", overlay=true)
length = input(20, minval=1)
lower = lowest(length)
upper = highest(length)
basis = avg(upper, lower)
l = plot(lower, color=blue, title="Lower DC")
u = plot(upper, color=blue, title="Upper DC")
plot(basis, color=orange, title="Basis DC")
fill(u, l, color=blue)

useTrueRange = input(true)
length2 = input(20, minval=1)
mult = input(1.0)
src = input(close, title="Source")

ma = ema(src, length2)
range = useTrueRange ? tr : high - low
rangema = ema(range, length2)
upper2 = ma + rangema * mult
lower2 = ma - rangema * mult
c = blue
u2 = plot(upper2, color=c, title="Upper KC")
plot(ma, color=c, title="Basis KC")
l2 = plot(lower2, color=c, title="Lower KC")
fill(u2, l2, color=c)

0

78

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © supersignals

//@version=6
indicator('225k: Linear Weighted Moving Average', shorttitle = 'LWMA Custom Weighted', overlay = true)

//{ LWMA Custom Weighted Function
get_lwma(src, period, weight) =>
    price = src
    sub = weight / period - 1
    float p = na
    float d = na
    float sum = 0
    float divider = 0
    for i = 0 to period - 1 by 1
        p := price[i] * (weight - i - sub)
        d := weight - i - sub
        sum := sum + p
        divider := divider + d
        divider
    sum / divider
    //}--LWMA Custom Weighted

/// Sample Usage
lwma_source = input(close, title = 'LWMA Source:')
lwma_period = input.int(7, title = 'LWMA Lookback Period:', minval = 1, step = 1)
lwma_weight = input.int(8, title = 'LWMA Weight:', minval = 1, step = 1)
colorChange = input(true, title = 'Directional color change?')

lwma = get_lwma(lwma_source, lwma_period, lwma_weight)

lwmaRise = lwma[1] < lwma
lwmaFall = lwma[1] > lwma
lColor = colorChange ? lwmaRise ? color.green : color.green : color.green

plot(lwma, color = lColor, linewidth = 2)

// ALERTS
if lwmaRise and not lwmaRise[1]
    alert('LWMA is Rising', alert.freq_once_per_bar)
if lwmaFall and not lwmaFall[1]
    alert('LWMA is Falling', alert.freq_once_per_bar)

0

79

ENV MTF

https://www.tradingview.com/script/g0io … elope-MTF/

0

80

version=6



// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © 255k_signals

//@version=6
indicator('225k: Linear Weighted Moving Average', shorttitle = 'LWMA Custom Weighted', overlay = true)

//{ LWMA Custom Weighted Function
get_lwma(src, period, weight) =>
    price = src
    sub = weight / period - 1
    float p = na
    float d = na
    float sum = 0
    float divider = 0
    for i = 0 to period - 1 by 1
        p := price[i] * (weight - i - sub)
        d := weight - i - sub
        sum := sum + p
        divider := divider + d
        divider
    sum / divider
    //}--LWMA Custom Weighted

/// Sample Usage
lwma_source = input(close, title = 'LWMA Source:')
lwma_period = input.int(7, title = 'LWMA Lookback Period:', minval = 1, step = 1)
lwma_weight = input.int(8, title = 'LWMA Weight:', minval = 1, step = 1)
colorChange = input(true, title = 'Directional color change?')

lwma = get_lwma(lwma_source, lwma_period, lwma_weight)

lwmaRise = lwma[1] < lwma
lwmaFall = lwma[1] > lwma
lColor = colorChange ? lwmaRise ? color.green : color.green : color.green

plot(lwma, color = lColor, linewidth = 2)

// ALERTS
if lwmaRise and not lwmaRise[1]
    alert('LWMA is Rising', alert.freq_once_per_bar)
if lwmaFall and not lwmaFall[1]
    alert('LWMA is Falling', alert.freq_once_per_bar)

0

81

High-Low Difference Channels - SMA/EMA

//@version=2

study(title="High-Low Difference Channels - SMA/EMA", shorttitle="HLDC", overlay=true)

// Revision:    1
// Author:      JayRogers
// Reasoning:   I wrote this up as a potential replacement for my BB based strategies, and so far it's
//              looking pretty nifty.
//
// Description / Usage:
//
//  - Adjust length and multiplier much the same way you would expect with Bollinger Bands.
//  - multiplier of 1 gives you a base channel consisting of one high, and one low sourced SMA (or EMA)
//  - The outer channels are increments of the base channels width, away from the median hl2 sourced SMA (..or EMA)

hlc_length      = input(50, title="Channel Length", minval=1)
hlc_diffMult    = input(1.5, title="Difference Multiplier", minval=0.1, maxval=50)
hlc_useEMA      = input(false, title="Use EMA instead of SMA?")

hl2_line    = hlc_useEMA ? ema(hl2, hlc_length) : sma(hl2, hlc_length)
high_line   = hlc_useEMA ? ema(high, hlc_length) : sma(high, hlc_length)
low_line    = hlc_useEMA ? ema(low, hlc_length) : sma(low, hlc_length)

diffMult(num) =>
    hldm = (high_line - low_line) * hlc_diffMult
    r = hldm * num

midline     = plot(hl2_line, title="Midline", color=silver, transp=0)

highLine    = plot(hl2_line + (diffMult(1) / 2), title="Center Channel Upper", color=silver, transp=100)
lowLine     = plot(hl2_line - (diffMult(1) / 2), title="Center Channel Lower", color=silver, transp=100)

diffUp1     = plot(hl2_line + diffMult(1), title="High Diff 1", color=silver, transp=0)
diffUp2     = plot(hl2_line + diffMult(2), title="High Diff 2", color=silver, transp=0)
diffUp3     = plot(hl2_line + diffMult(3), title="High Diff 3", color=silver, transp=0)

diffDown1   = plot(hl2_line - diffMult(1), title="Low Diff 1", color=silver, transp=0)
diffDown2   = plot(hl2_line - diffMult(2), title="Low Diff 2", color=silver, transp=0)
diffDown3   = plot(hl2_line - diffMult(3), title="Low Diff 3", color=silver, transp=0)

fill(highLine, lowLine, title="Center High-Low Fill", color=silver, transp=50)

0

82

https://ru.tradingview.com/script/iaGKy … s-SMA-EMA/
https://www.tradingview.com/script/S01M … elope-MTF/
https://www.tradingview.com/script/g0io … elope-MTF/

https://ru.tradingview.com/script/kWp9a … furbished/

0

83

1
2
3
//@version=6
3
indicator("Williams Percent Range", shorttitle="Williams %R" format=format.price, precision-2, timeframe= length = input (title="Length", defval=14)
src = input(close, "Source")
_pr(length) =>
4
5
6
max = ta.highest (length)
7
minta.lowest (length)
8
100 * (src max) / (max
min)
9
percentR = _pr(length)
10
obplot = hline(-20, title="Upper Band", color=#787886)
11
12
osPlot = hline(-80, title="Lower Band", color=#787886)
13
14
hline (-50, title="Middle Level", linestyle-hline.style_dotted, color=#787B86)
fill(obPlot, osPlot, title="Background", color-color.rgb(126, 87, 194, 90)) plot(percentR, title="%R", color=#7E57C2)
3
timeframe_gaps=true)

0

84

LWMA

// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ChartPrime

//@version=6
indicator('MA Multi-Timeframe [ChartPrime]', overlay = true, max_bars_back = 4000, max_polylines_count = 100)

// --------------------------------------------------------------------------------------------------------------------}
// 𝙐𝙎𝙀𝙍 𝙄𝙉𝙋𝙐𝙏𝙎
// --------------------------------------------------------------------------------------------------------------------{

int length = input.int(20, 'Length', inline = '-1')
float source = input.source(close, '', inline = '-1')

string typeMA0 = input.string(title = 'MA1 >>', defval = 'SMA', options = ['SMA', 'EMA', 'SMMA (RMA)', 'WMA', 'VWMA', 'LWMA', 'HMA'], inline = '0')
string typeMA1 = input.string(title = 'MA2 >>', defval = 'SMA', options = ['SMA', 'EMA', 'SMMA (RMA)', 'WMA', 'VWMA', 'LWMA', 'HMA'], inline = '1')
string typeMA2 = input.string(title = 'MA3 >>', defval = 'SMA', options = ['SMA', 'EMA', 'SMMA (RMA)', 'WMA', 'VWMA', 'LWMA', 'HMA'], inline = '2')
string typeMA3 = input.string(title = 'MA4 >>', defval = 'SMA', options = ['SMA', 'EMA', 'SMMA (RMA)', 'WMA', 'VWMA', 'LWMA', 'HMA'], inline = '3')

string ma_tf0 = input.timeframe('360', '', inline = '0')
string ma_tf1 = input.timeframe('D', '', inline = '1')
string ma_tf2 = input.timeframe('W', '', inline = '2')
string ma_tf3 = input.timeframe('M', '', inline = '3')

string styleMA0 = input.string(title = '', defval = 'Solid', options = ['Solid', 'Dotted', 'Dashed'], inline = '0')
string styleMA1 = input.string(title = '', defval = 'Solid', options = ['Solid', 'Dotted', 'Dashed'], inline = '1')
string styleMA2 = input.string(title = '', defval = 'Solid', options = ['Solid', 'Dotted', 'Dashed'], inline = '2')
string styleMA3 = input.string(title = '', defval = 'Solid', options = ['Solid', 'Dotted', 'Dashed'], inline = '3')

color color0 = input.color(#1bc6dd, '', inline = '0')
color color1 = input.color(#1b8fdd, '', inline = '1')
color color2 = input.color(#6f1bdd, '', inline = '2')
color color3 = input.color(#dd1bc3, '', inline = '3')

// --------------------------------------------------------------------------------------------------------------------}
// 𝙄𝙉𝘿𝙄𝘾𝘼𝙏𝙊𝙍 𝘾𝘼𝙇𝘾𝙐𝙇𝘼𝙏𝙄𝙊𝙉𝙎
// --------------------------------------------------------------------------------------------------------------------{

// Custom MA functions
lwma(src, len) =>
    sum = 0.0
    weightSum = 0.0
    for i = 0 to len - 1 by 1
        weight = len - i
        sum := sum + src[i] * weight
        weightSum := weightSum + weight
        weightSum
    sum / weightSum

hma(src, len) =>
    halfLen = math.round(len / 2)
    sqrtLen = math.round(math.sqrt(len))
    wma1 = ta.wma(src, halfLen)
    wma2 = ta.wma(src, len)
    hma = ta.wma(2 * wma1 - wma2, sqrtLen)
    hma

request(tf, expression) =>
    request.security(syminfo.tickerid, tf, expression[1], lookahead = barmerge.lookahead_on)

var tbl = table.new(position.top_right, 10, 10, bgcolor = color.new(color.gray, 90), frame_color = color.gray, frame_width = 2, border_color = color.new(color.gray, 80), border_width = 1)

table_cell(row, txt, tf, trend, color) =>
    table.cell(tbl, 0, 0, 'MA Type:', text_color = chart.fg_color)
    table.cell(tbl, 1, 0, 'Timeframe:', text_color = chart.fg_color)
    table.cell(tbl, 2, 0, 'Price:', text_color = chart.fg_color)
    table.cell(tbl, 0, row, '🞛 ' + txt, text_color = color)
    table.cell(tbl, 1, row, tf, text_color = color)
    table.cell(tbl, 2, row, trend ? '⮙' : '⮛', text_color = trend ? color.lime : color.fuchsia, text_size = size.large)

ma(tf, color, type, extend, styleMA, cell) =>
    color color_ = color.new(color, 85)

    string style = switch styleMA
        'Solid' => line.style_solid
        'Dashed' => line.style_dashed
        'Dotted' => line.style_dotted

    series float expression = switch type
        'SMA' => ta.sma(source, length)
        'EMA' => ta.ema(source, length)
        'SMMA (RMA)' => ta.rma(source, length)
        'WMA' => ta.wma(source, length)
        'VWMA' => ta.vwma(source, length)
        'LWMA' => lwma(source, length)
        'HMA' => hma(source, length)

    series float ma = request(tf, expression)

    line.delete(line.new(bar_index, ma, bar_index + extend, ma, color = color, style = style)[1])
    line.delete(line.new(bar_index, ma, bar_index + extend, ma, color = color_, style = style, width = 5)[1])

    label.delete(label.new(bar_index + extend, ma, type + ': ' + tf, style = label.style_diamond, color = color_, textcolor = chart.fg_color, size = size.small)[1])
    label.delete(label.new(bar_index + extend, ma, style = label.style_diamond, color = color, size = size.tiny)[1])
    if barstate.islast
        cp = array.new<chart.point>()

        for i = 0 to 4000 by 1
            cp.push(chart.point.from_index(bar_index[i], ma[i]))

        polyline.delete(polyline.new(cp, curved = false, line_color = color, line_style = style)[1])
        polyline.delete(polyline.new(cp, curved = false, line_color = color_, line_style = style, line_width = 5)[1])

        table_cell(cell, type, tf, close > ma, color)

// --------------------------------------------------------------------------------------------------------------------}
// 𝙑𝙄𝙎𝙐𝘼𝙇𝙄𝙕𝘼𝙏𝙄𝙊𝙉
// --------------------------------------------------------------------------------------------------------------------{

ma(ma_tf0, color0, typeMA0, 15, styleMA0, 1)
ma(ma_tf1, color1, typeMA1, 30, styleMA1, 2)
ma(ma_tf2, color2, typeMA2, 45, styleMA2, 3)
ma(ma_tf3, color3, typeMA3, 60, styleMA3, 4)

// --------------------------------------------------------------------------------------------------------------------}

0

85

Интервал 1 час

//@version=6
indicator(title="Envelope", shorttitle="Env", overlay=true, timeframe="", timeframe_gaps=true)
len = input.int(3, title="Length", minval=1)
percent = input(0.54, "Percent")
src = input(close, title="Source")
exponential = input(false, "Exponential")
basis = exponential ? ta.ema(src, len) : ta.sma(src, len)
k = percent/100.0
upper = basis * (2 + k)
lower = basis * (2 - k)
plot(basis, "Basis", color=#FF6D00)
u = plot(upper, "Upper", color=#2962FF)
l = plot(lower, "Lower", color=#2962FF)
fill(u, l, color=color.rgb(33, 150, 243, 95), title="Background")

0

86

//@version=6

indicator('<[RSI или WPR Bands]>', shorttitle = '<[RSI_WPR_BANDS]>', overlay = true)

// Переключатель
indicatorType = input.string(title = 'Выберите индикатор', defval = 'RSI', options = ['RSI', 'Williams %R'])

// Общие параметры
length = input.int(14, title = 'Длина', minval = 1)

// Уровни RSI
rsi_obLevel = input.int(70, title = 'RSI Уровень перекупленности', minval = 50, maxval = 100)
rsi_osLevel = input.int(30, title = 'RSI Уровень перепроданности', minval = 0, maxval = 50)

// Уровни WPR
wpr_obLevel = input.int(-20, title = 'WPR Уровень перекупленности', minval = -100, maxval = 0)
wpr_osLevel = input.int(-80, title = 'WPR Уровень перепроданности', minval = -100, maxval = 0)

src = close

// --- Расчет RSI Bands ---
ep = 2 * length - 1
auc = ta.ema(math.max(src - src[1], 0), ep)
adc = ta.ema(math.max(src[1] - src, 0), ep)
x1 = (length - 1) * (adc * rsi_obLevel / (100 - rsi_obLevel) - auc)
rsi_ub = x1 >= 0 ? src + x1 : src + x1 * (100 - rsi_obLevel) / rsi_obLevel
x2 = (length - 1) * (adc * rsi_osLevel / (100 - rsi_osLevel) - auc)
rsi_lb = x2 >= 0 ? src + x2 : src + x2 * (100 - rsi_osLevel) / rsi_osLevel
rsi_mid = math.avg(rsi_ub, rsi_lb)

// --- Расчет Williams %R Bands ---
H = ta.highest(high, length)
L = ta.lowest(low, length)
C = close

wpr = -((H - C) / (H - L)) * 100

dist_to_ob = wpr_obLevel - wpr
dist_to_os = wpr - wpr_osLevel

scale = (H - L) / 100

wpr_ub = close + dist_to_ob * scale
wpr_lb = close - dist_to_os * scale
wpr_mid = math.avg(wpr_ub, wpr_lb)

// Вывод в зависимости от выбора
ub = indicatorType == 'RSI' ? rsi_ub : wpr_ub
lb = indicatorType == 'RSI' ? rsi_lb : wpr_lb
mid = indicatorType == 'RSI' ? rsi_mid : wpr_mid

// Цвета для наглядности
plot(ub, title = 'Сопротивление', color = #ff5252, linewidth = 2)
plot(lb, title = 'Поддержка', color = #4caf50, linewidth = 2)
plot(mid, title = 'Midline', color = #787b86, linewidth = 1)

//=================================================================================//

0

87

//@version=6
indicator('<[RSI или WPR BandsV2]>', shorttitle='<[RSI_WPR_BANDS2]>', overlay=true, precision=4)

// Переключатель индикатора
indicatorType = input.string('RSI', 'Выберите индикатор', options=['RSI', 'Williams %R'])

// Общие параметры
length = input.int(14, 'Длина', minval=1)

// Уровни RSI
rsi_obLevel = input.int(70, 'RSI Уровень перекупленности', minval=50, maxval=100)
rsi_osLevel = input.int(30, 'RSI Уровень перепроданности', minval=0, maxval=50)

// Уровни WPR (стандартные значения)
wpr_obLevel = input.int(-20, 'WPR Уровень перекупленности', minval=-99, maxval=0)
wpr_osLevel = input.int(-80, 'WPR Уровень перепроданности', minval=-100, maxval=-1)

// Источник данных
src = close

// --- Расчет RSI Bands ---
ep = 2 * length - 1
auc = ta.ema(math.max(src - src[1], 0), ep)
adc = ta.ema(math.max(src[1] - src, 0), ep)

x1 = (length - 1) * (adc * rsi_obLevel / (100 - rsi_obLevel) - auc)
rsi_ub = x1 >= 0 ? src + x1 : src + x1 * (100 - rsi_obLevel) / rsi_obLevel

x2 = (length - 1) * (adc * rsi_osLevel / (100 - rsi_osLevel) - auc)
rsi_lb = x2 >= 0 ? src + x2 : src + x2 * (100 - rsi_osLevel) / rsi_osLevel

rsi_mid = math.avg(rsi_ub, rsi_lb)

// --- Расчет Williams %R Bands ---
H = ta.highest(high, length)
L = ta.lowest(low, length)
C = close

// Защита от деления на ноль + расчет WPR
wpr = H != L ? -((H - C) / (H - L)) * 100 : na

// Расчет полос WPR
price_range = H - L
wpr_ub = H != L ? C + (wpr_obLevel - wpr)/100 * price_range : na
wpr_lb = H != L ? C - (wpr - wpr_osLevel)/100 * price_range : na
wpr_mid = H != L ? math.avg(wpr_ub, wpr_lb) : na

// Выбор отображаемых данных
ub = indicatorType == 'RSI' ? rsi_ub : wpr_ub
lb = indicatorType == 'RSI' ? rsi_lb : wpr_lb
mid = indicatorType == 'RSI' ? rsi_mid : wpr_mid

// Отрисовка линий
plot(ub, 'Сопротивление', #ff5252, 2)
plot(lb, 'Поддержка', #4caf50, 2)
plot(mid, 'Midline', #787b86, 1)

var table logo = table.new(position.bottom_right, 1, 1)
table.cell(logo, 0, 0, 'DM', text_size = size.normal, text_color = #00897b)

//=================================================================================//

0

88

https://love-tradingview.com/mtf-rsi-guppy-moto/

0

89

//@version=6

indicator('<[MOD_RSI_Bands MTF [LB]>', shorttitle='<[MOD_RSI_BANDS_MTF_LB]>', overlay=true)
// Функция для расчета полос
f_rsi_bands(src, length, obLevel, osLevel) =>
    ep = 2 * length - 1
    auc = ta.ema(math.max(src - src[1], 0), ep)
    adc = ta.ema(math.max(src[1] - src, 0), ep)
    x1 = (length - 1) * (adc * obLevel / (100 - obLevel) - auc)
    ub = x1 >= 0 ? src + x1 : src + x1 * (100 - obLevel) / obLevel
    x2 = (length - 1) * (adc * osLevel / (100 - osLevel) - auc)
    lb = x2 >= 0 ? src + x2 : src + x2 * (100 - osLevel) / osLevel
    [ub, lb]

// ————— ИНДИКАТОР №1 —————
tf1 = input.timeframe("", "Таймфрейм 1", group="Индикатор 1")
obLevel1 = input(70, "RSI Overbought 1", group="Индикатор 1")
osLevel1 = input(30, "RSI Oversold 1", group="Индикатор 1")
length1 = input(14, "RSI Length 1", group="Индикатор 1")
src1 = input(close, "Source 1", group="Индикатор 1")
show1 = input(true, "Показать Индикатор 1", group="Индикатор 1")

// Расчет для МТФ 1
[ub1_current, lb1_current] = f_rsi_bands(src1, length1, obLevel1, osLevel1)
[ub1_mtf, lb1_mtf] = request.security(syminfo.tickerid, tf1, f_rsi_bands(src1, length1, obLevel1, osLevel1))
ub1 = tf1 != "" ? ub1_mtf : ub1_current
lb1 = tf1 != "" ? lb1_mtf : lb1_current

plot(show1 ? ub1 : na, title = 'Resistance 1', color = #ff5252, linewidth = 2)
plot(show1 ? lb1 : na, title = 'Support 1', color = #4caf50, linewidth = 2)
plot(show1 ? math.avg(ub1, lb1) : na, title = 'RSI Midline 1', color = #787b86, linewidth = 1)

// ————— ИНДИКАТОР №2 —————
tf2 = input.timeframe("", "Таймфрейм 2", group="Индикатор 2")
obLevel2 = input(65, "RSI Overbought 2", group="Индикатор 2")
osLevel2 = input(35, "RSI Oversold 2", group="Индикатор 2")
length2 = input(20, "RSI Length 2", group="Индикатор 2")
src2 = input(close, "Source 2", group="Индикатор 2")
show2 = input(true, "Показать Индикатор 2", group="Индикатор 2")

// Расчет для МТФ 2
[ub2_current, lb2_current] = f_rsi_bands(src2, length2, obLevel2, osLevel2)
[ub2_mtf, lb2_mtf] = request.security(syminfo.tickerid, tf2, f_rsi_bands(src2, length2, obLevel2, osLevel2))
ub2 = tf2 != "" ? ub2_mtf : ub2_current
lb2 = tf2 != "" ? lb2_mtf : lb2_current

plot(show2 ? ub2 : na, title = 'Resistance 2', color = #ff9800, linewidth = 2)
plot(show2 ? lb2 : na, title = 'Support 2', color = #2196f3, linewidth = 2)
plot(show2 ? math.avg(ub2, lb2) : na, title = 'RSI Midline 2', color = #9c27b0, linewidth = 1)

// ————— ИНДИКАТОР №3 —————
tf3 = input.timeframe("", "Таймфрейм 3", group="Индикатор 3")
obLevel3 = input(75, "RSI Overbought 3", group="Индикатор 3")
osLevel3 = input(25, "RSI Oversold 3", group="Индикатор 3")
length3 = input(10, "RSI Length 3", group="Индикатор 3")
src3 = input(hl2, "Source 3", group="Индикатор 3")
show3 = input(true, "Показать Индикатор 3", group="Индикатор 3")

// Расчет для МТФ 3
[ub3_current, lb3_current] = f_rsi_bands(src3, length3, obLevel3, osLevel3)
[ub3_mtf, lb3_mtf] = request.security(syminfo.tickerid, tf3, f_rsi_bands(src3, length3, obLevel3, osLevel3))
ub3 = tf3 != "" ? ub3_mtf : ub3_current
lb3 = tf3 != "" ? lb3_mtf : lb3_current

plot(show3 ? ub3 : na, title = 'Resistance 3', color = #880e4f, linewidth = 2)
plot(show3 ? lb3 : na, title = 'Support 3', color = #00897b, linewidth = 2)
plot(show3 ? math.avg(ub3, lb3) : na, title = 'RSI Midline 3', color = #808000, linewidth = 1)

var table logo = table.new(position.bottom_right, 1, 1)
table.cell(logo, 0, 0, 'DM', text_size = size.normal, text_color = #00897b)

//===========================================================================//

0

90

ATR BANDS

//@version=6
indicator('MTF ATR Bands', overlay = true)

// Atr Settings Inputs
atrPeriod = input.int(title = 'ATR Period', defval = 14, minval = 1)
srcUpper = input.source(title = 'Source of the Upper Band', defval = high)
srcLower = input.source(title = 'Source of the Lower Band', defval = low)
atrMultiplier = input.float(title = 'ATR Multiplier', defval = 1.5)

tmf1 = input.timeframe("1D","Timeframe for secondary moving average")

// Color Inputs
upColor = input.color(color.green, title = 'Color for Up Trend')
downColor = input.color(color.purple, title = 'Color for Down Trend')
highBandColor = input.color(color.green, title = 'High Band Color')
lowBandColor = input.color(color.red, title = 'Low Band Color')

// ATR calculation
calculate(atrPeriod1) =>
    atr = ta.atr(atrPeriod1)
    meda  = ta.rma(ta.tr(true), atrPeriod) * atrMultiplier
    highBand = meda + srcUpper
    lowBand = srcLower - meda
    avgBandx = (highBand + lowBand) / 2
    avgBand = ta.sma(ta.wma(avgBandx, 7), 2)

    // Determine the color based on the conditions
    cx = close > avgBand and avgBand > avgBand[1] ? upColor : downColor
    [highBand, lowBand, avgBand, cx]

// Get ATR Bands from different timeframes
[highBand1, lowBand1, avgBand1, cc] = request.security(syminfo.tickerid , timeframe.period, calculate(atrPeriod))
[highBand2, lowBand2, avgBand2, xcolor] = request.security(syminfo.tickerid , tmf1, calculate(atrPeriod))

// Plot the bands with custom colors
ph1x = plot(highBand1, 'Current Timeframe Top Atr Band', color = cc)
pl1x = plot(lowBand1, 'Current Timeframe Low Atr Band', color = cc)
fill(ph1x, pl1x, color=color.new(cc, 85))

ph2 = plot(highBand2, 'Higher Timeframe Top Atr Band', color = highBandColor)
pl2 = plot(lowBand2, 'Higher Timeframe Low Atr Band', color = lowBandColor)

plot(avgBand1, 'Average of current timeframe Atr Bands', color = cc, linewidth = 2)
plot(avgBand2, 'Average of Higher timeframe Atr Bands', color = xcolor, linewidth = 4)

0

Quick post

Write and submit your message



You are here » AD » WOW.that's literally me » #8 investing.com