← К каталогу
Исходный код · ID 3810

indicator easy money for tradingview_5807933503848848137.txt

Похожие материалы по тегам

ea robofibo source v.11.2.mq4MetaTrader 4 · 1 общих теговᴇɴᴛʀʏ.txtTradingView · 1 общих теговzonestrategy.mqhMetaTrader 5 · 1 общих теговxauusd_simple_strategy7.mq4MetaTrader 4 · 1 общих теговxauusd_grok_presisi_scalper_v1.4 - anti detach.mq5MetaTrader 5 · 1 общих теговxauusd_gold_perfect.mq4MetaTrader 4 · 1 общих тегов
Вы автор или правообладатель?

Сообщите нам, если считаете, что материал размещён без разрешения.

Получить полный код

Поиск по коду файла

indicator(title = 'Easy money', shorttitle = 'Easy money', overlay = false, max_labels_count = 500, max_lines_count = 500, max_boxes_count = 500, max_bars_back = 5000)

a = input.int(10, "Percent K Length", minval=1)
b = input.int(3, "Percent D Length", minval=1)
c = input.int(10, "EMA Signal Length", minval=1)
smooth_period = input.int(5, "Smoothing Period", minval=1)
ob = input.float(40, "Overbought", minval=-100, maxval=100)
os = input.float(-40, "Oversold", minval=-100, maxval=100)

ll = ta.lowest(low, a)
hh = ta.highest(high, a)
diff = hh - ll
rdiff = close - (hh+ll)/2

avgrel = ta.ema(rdiff, b)
avgdiff = ta.ema(diff, b)

SMI = avgdiff != 0 ? (avgrel/(avgdiff/2)*100) : 0.0

SMI_smoothed = ta.sma(SMI, smooth_period)

SMIsignal = ta.ema(SMI_smoothed, b)
emasignal = ta.ema(SMI_smoothed, c)

plot(SMI_smoothed, "Stochastic", color=color.black)
plot(emasignal, "EMA", color=color.red)

h0 = hline(ob, "Overbought", color=color.gray)
h1 = hline(os, "Oversold", color=color.gray)

level_ob = ob
level_obsmi = SMI_smoothed > level_ob ? SMI_smoothed : level_ob

level_os = os
level_ossmi = SMI_smoothed < level_os ? SMI_smoothed : level_os

p1 = plot(level_ob, display=display.none)
p2 = plot(level_obsmi, display=display.none)

p3 = plot(level_os, display=display.none)
p4 = plot(level_ossmi, display=display.none)

fill(p1, p2, color=color.new(color.red, 60), title='OverBought')
fill(p3, p4, color=color.new(color.green, 60), title='OverSold')

bullC       = input.color(defval = #14D990, title = "Bull Color", group = "Smart Money Concepts", inline = "7")
bearC       = input.color(defval = #F24968, title = "Bear Color", group = "Smart Money Concepts", inline = "7")
showInt     = input.bool(defval = true, title = "Show Internals", group = "Smart Money Concepts")
intSens     = input.int(3, "Internals Sensitivity", options =  [3 , 5 , 8 ], group = "Smart Money Concepts", inline = "20")
intStru     = input.string(defval = "All", title = "Internal Structure", options = ["All", "BoS", "CHoCH"], inline = "30", group = "Smart Money Concepts")
showExt     = input.bool(defval = true, title = "Show Externals" ,group = "Smart Money Concepts")
extSens     = input.int(25, "Externals Sensitivity", options = [10, 25, 50],group = "Smart Money Concepts", inline = "21")
extStru     = input.string(defval = "All", title = "External Structure", options = ["All", "BoS", "CHoCH"], inline = "31", group = "Smart Money Concepts")
showOB      = input.bool(defval = true, title = "Show Order Blocks" ,group = "Swing Blocks")
showLast    = input.int(defval = 10, title = "Swing Order Blocks", minval = 0, group = "Swing Blocks")
showHHLH    = input.bool(defval = true, title = "Show HH/LH", group = "Swing Blocks")
showHLLL    = input.bool(defval = true, title = "Show LH/LL", group = "Swing Blocks")
showAOE     = input.bool(defval = true, title = "Show Area of Interest", group = "Swing Blocks")
show1D      = input.bool(defval = true, title = "Show Previous Day High", group = "High/Low")
show1DLab   = input.bool(defval = true, title = "Show 1 Day Labels", group = "High/Low")
show4H      = input.bool(defval = true, title = "Show 4 Hour High", group = "High/Low")
show4hLab   = input.bool(defval = true, title = "Show 4 Hour Labels", group = "High/Low")
showFVG     = input.bool(defval = true, title = "Show Fair Value Gaps", group = "FVG")
contract    = input.bool(defval = false, title = "Contract Violated FVG", group = "FVG")
fib_0       = input.float(0.382, "Fib Level 0")
fib_1       = input.float(0.618, "Fib Level 1")
closeOnly   = input.bool(defval = false, title = "Show Closest Up/Down FVG Only", group = "FVG")
fvgcol      = input.color(defval = #F2B807, title = "FVG Color", group = "FVG")
fvgtra      = input.int(defval = 80, minval = 0, maxval = 100, title = "FVG Transparency", group = "FVG")

showFibs    = input.bool(defval = true, title = "Show Auto Fibs", group = "Auto Fibs")

show236     = input.bool(defval = true,  title = "", inline = "1", group = "Auto Fibs")
show382     = input.bool(defval = true,  title = "", inline = "2", group = "Auto Fibs")
show5       = input.bool(defval = true,    title = "", inline = "3", group = "Auto Fibs")
show618     = input.bool(defval = true,  title = "", inline = "4", group = "Auto Fibs")
show786     = input.bool(defval = true,  title = "", group = "Auto Fibs", inline = "5")
fib1        = input.float(defval = .236, title = "", minval = 0, step = 0.01, inline = "1", group = "Auto Fibs")
fib2        = input.float(defval = .382, title = "", minval = 0, step = 0.01, inline = "2", group = "Auto Fibs")
fib3        = input.float(defval = .5,   title = "", minval = 0, step = 0.01, inline = "3", group = "Auto Fibs")
fib4        = input.float(defval = .618, title = "", minval = 0, step = 0.01, inline = "4", group = "Auto Fibs")
fib5        = input.float(defval = .786, title = "", minval = 0, step = 0.01, group = "Auto Fibs", inline = "5")
fib1col     = input.color(title = "", defval = color.gray, inline = "1"  , group = "Auto Fibs")
fib2col     = input.color(title = "", defval = color.lime, inline = "2"  , group = "Auto Fibs")
fib3col     = input.color(title = "", defval = color.yellow, inline = "3", group = "Auto Fibs")
fib4col     = input.color(title = "", defval = color.orange, inline = "4", group = "Auto Fibs")
fib5col     = input.color(title = "", defval = color.red   , group = "Auto Fibs", inline = "5")

var bigData = map.new<string, float>()

if bigData.size() == 0

    bigData.put("moving", 0)
    bigData.put("upaxis", 0.0) 
    bigData.put("upaxis2", 0)
    bigData.put("dnaxis", 0.0) 
    bigData.put("dnaxis2", 0)
    bigData.put("upside", 1)
    bigData.put("downside", 1)

[pdHigh, pdLow, dayHigh, dayLow, pdBar, dayBar] = request.security(syminfo.tickerid, "1D", [high[1], low[1], high, low, time[1], time])

var highArr = array.new_float(), var lowArr  = array.new_float()
var timeArr = array.new_int  (), var volArr  = array.new_float()
var closeArr = array.new_float(), var openArr = array.new_float()

highArr.unshift(high), lowArr.unshift(low)
timeArr.unshift(time), volArr.unshift(volume)
closeArr.unshift(close), openArr.unshift(open)

type rollingTF 

    float highTF                  = 0
    float lowTF                   = 1e8
    int   highTFt                 = 0
    int   lowTFt                  = 0
    float volTF                   = 0
    map   <string, line >         rTFdraw
    map   <string, label>         rTFlabel

method tfDraw(int tfDiff, bool showRollingLab, string tf, bool showLevels) => 

    TFhrdata = rollingTF.new(), var volRolling = array.new<float>()

    if highArr.size() > tfDiff

        for i = 0 to tfDiff

            if showLevels and barstate.islast

                getHigh = highArr.get(i), getLow = lowArr.get(i), 
                             getTime = timeArr.get(i)

                TFhrdata.highTF := math.max(TFhrdata.highTF, getHigh)
                TFhrdata.lowTF  := math.min(TFhrdata.lowTF , getLow )

                if TFhrdata.highTF == getHigh 

                    TFhrdata.highTFt := timeArr.get(i)

                if TFhrdata.lowTF == getLow

                    TFhrdata.lowTFt  := timeArr.get(i)

            TFhrdata.volTF += volArr.get(i)

        volRolling.push(TFhrdata.volTF)

        var lineDraw = rollingTF.new(rTFdraw = map.new<string, line>(), rTFlabel = map.new<string, label>())

        if showLevels

            switch lineDraw.rTFdraw.size() == 0

                true =>  lineDraw.rTFdraw.put("High", line.new(TFhrdata.highTFt, TFhrdata.highTF, time, TFhrdata.highTF, 
                                                 xloc = xloc.bar_time, color = color.aqua)),
                         lineDraw.rTFdraw.put("Low" , line.new(TFhrdata.lowTFt , TFhrdata.lowTF , time, TFhrdata.lowTF , 
                                                 xloc = xloc.bar_time, color = color.aqua))  

                =>       lineDraw.rTFdraw.get("High").set_xy1(TFhrdata.highTFt, TFhrdata.highTF),
                         lineDraw.rTFdraw.get("High").set_xy2(time, TFhrdata.highTF),

                         lineDraw.rTFdraw.get("Low").set_xy1(TFhrdata.lowTFt, TFhrdata.lowTF),
                         lineDraw.rTFdraw.get("Low").set_xy2(time, TFhrdata.lowTF)

            if showRollingLab 

                switch lineDraw.rTFlabel.size() == 0

                    true =>  lineDraw.rTFlabel.put("High", label.new(time, TFhrdata.highTF, xloc = xloc.bar_time, 
                                                         textcolor = color.aqua, 
                                                         text      = tf + "H", 
                                                         size      = size.tiny, 
                                                         style     = label.style_label_left, 
                                                         color     = #00000000
                                                         )),
                             lineDraw.rTFlabel.put("Low" , label.new(time, TFhrdata.lowTF , xloc = xloc.bar_time, 
                                                         textcolor = color.aqua, 
                                                         text      = tf + "L", 
                                                         size      = size.tiny, 
                                                         style     = label.style_label_left, 
                                                         color     = #00000000
                                                         ))  

                    =>       lineDraw.rTFlabel.get("High") .set_xy(time, TFhrdata.highTF),
                             lineDraw.rTFlabel.get("Low")  .set_xy(time, TFhrdata.lowTF)

    [TFhrdata.volTF, volRolling]

tfDrawLower(bool showRollingLab, simple string tf, bool showLevels) => 

    simple int end = switch tf 

        "240" => 240
        "1D"  => 1440

    [o, h, l, c, v, t] = request.security_lower_tf(syminfo.tickerid, "1", [open, high, low, close, volume, time])

    var oArr = array.new_float()
    var hArr = array.new_float()
    var lArr = array.new_float()
    var cArr = array.new_float()
    var vArr = array.new_float()
    var tArr = array.new_int()

    TFhrdata = rollingTF.new(), var volRolling = array.new<float>()

    if h.size() > 0

        for i = 0 to h.size() - 1

            oArr.push(o.get(i))
            hArr.push(h.get(i))
            lArr.push(l.get(i))
            cArr.push(c.get(i))
            vArr.push(v.get(i))
            tArr.push(t.get(i))

            if hArr.size() > end 

                oArr.shift()
                hArr.shift()
                lArr.shift()
                cArr.shift()
                vArr.shift()
                tArr.shift()

        for i = 0 to hArr.size() - 1

            if showLevels

                getHigh = hArr.get(i), getLow = lArr.get(i), 
                             getTime = tArr.get(i)

                TFhrdata.highTF := math.max(TFhrdata.highTF, getHigh)
                TFhrdata.lowTF  := math.min(TFhrdata.lowTF , getLow)

                if TFhrdata.highTF == getHigh 

                    TFhrdata.highTFt := tArr.get(i)

                if TFhrdata.lowTF == getLow

                    TFhrdata.lowTFt  := tArr.get(i)

            TFhrdata.volTF  += vArr.get(i)

        volRolling.push(TFhrdata.volTF)

        var lineDraw = rollingTF.new(rTFdraw = map.new<string, line>(), rTFlabel = map.new<string, label>())

        if showLevels

            switch lineDraw.rTFdraw.size() == 0

                true =>  lineDraw.rTFdraw.put("High", line.new(TFhrdata.highTFt, TFhrdata.highTF, time, TFhrdata.highTF, xloc = xloc.bar_time, color = color.aqua, force_overlay=true)),
                         lineDraw.rTFdraw.put("Low" , line.new(TFhrdata.lowTFt , TFhrdata.lowTF , time, TFhrdata.lowTF , xloc = xloc.bar_time, color = color.aqua, force_overlay=true))  

                =>       lineDraw.rTFdraw.get("High").set_xy1(TFhrdata.highTFt, TFhrdata.highTF),
                         lineDraw.rTFdraw.get("High").set_xy2(time, TFhrdata.highTF),

                         lineDraw.rTFdraw.get("Low").set_xy1(TFhrdata.lowTFt, TFhrdata.lowTF),
                         lineDraw.rTFdraw.get("Low").set_xy2(time, TFhrdata.lowTF)

            if showRollingLab 

                switch lineDraw.rTFlabel.size() == 0

                    true =>  lineDraw.rTFlabel.put("High", label.new(time, TFhrdata.highTF, xloc = xloc.bar_time, 
                                                         textcolor = color.aqua, 
                                                         text      = tf + "H", 
                                                         size      = size.tiny, 
                                                         style     = label.style_label_left, 
                                                         color     = #00000000, force_overlay=true
                                                         )),
                             lineDraw.rTFlabel.put("Low" , label.new(time, TFhrdata.lowTF , xloc = xloc.bar_time, 
                                                         textcolor = color.aqua, 
                                                         text      = tf + "L", 
                                                         size      = size.tiny, 
                                                         style     = label.style_label_left, 
                                                         color     = #00000000, force_overlay=true
                                                         ))  

                    =>       lineDraw.rTFlabel.get("High") .set_xy(time, TFhrdata.highTF),
                             lineDraw.rTFlabel.get("Low")  .set_xy(time, TFhrdata.lowTF)

    [TFhrdata.volTF, volRolling]

var r4hrbars = math.floor(timeframe.in_seconds("240") / timeframe.in_seconds(timeframe.period))
var rDbars   = math.floor(timeframe.in_seconds("1D") / timeframe.in_seconds(timeframe.period))

[vol4hr, vol4hrArr] = switch 

    timeframe.in_seconds() <= 60 => r4hrbars.tfDraw(show4hLab, "240", show4H)
    =>                              tfDrawLower(show4hLab, "240", show4H)

[vol1D, vol1DArr] = switch

    timeframe.in_seconds() <= 60 => rDbars.tfDraw(show1DLab, "1D", show1D) 
    =>                              tfDrawLower(show1DLab, "1D", show1D)

calculatePivots(length)=>

    var int intraCalc = 0

    if bar_index > length + 1

        up  = highArr.slice(0, length).max()
        dn  = lowArr .slice(0, length).min() 

        cHi = highArr.get(length)
        cLo = lowArr .get(length)

        intraCalc := switch 

            cHi > up => 0 
            cLo < dn => 1 
            =>          intraCalc[1]

        topSwing = switch 

            intraCalc == 0 and intraCalc[1] != 0 => cHi 
            =>                                      0 

        botSwing = switch 

            intraCalc == 1 and intraCalc[1] != 1 => cLo
            =>                                      0 

        [topSwing, botSwing]

[bigUpper    , bigLower   ]     = calculatePivots(extSens)
[smallUpper  , smallLower ]     = calculatePivots(intSens)

var label [] upLabel = array.new_label(1)
var label [] dnLabel = array.new_label(1)

var box [] highBlock = array.new_box()
var box [] lowBlock  = array.new_box()

drawChar(x, y, str, col, down) =>

    style = switch down 

        true => label.style_label_down
        =>      label.style_label_up

    line.new (int(x), y, bar_index, y, color = col, style = line.style_dashed, force_overlay=true)
    label.new(math.round(math.avg(x, bar_index)), y, str, color = #00000000, textcolor = col, style = style, size = size.small, force_overlay=true)

drawStructureExt() => 

    var int counter = 0

    if bigUpper != 0
        bigData.put("upside", 1)
        x1 = bar_index - extSens

        txt = switch bigUpper > bigData.get("upaxis")

            true => 'HH'
            =>      'LH'

        if showHHLH

            upLabel.set(0, label.new(x1, bigUpper, txt,

                          color     = color.new(color.white, 100), 
                          textcolor = bearC, 
                          style     = label.style_label_down, 
                          size      = size.small, force_overlay=true
                          ))
        if showOB
            highBlock.push(box.new(x1, bigUpper, last_bar_index + 5, bigUpper * .998, 
                         border_color = color.new(color.red, 75), 
                         bgcolor      = color.new(color.red, 95), force_overlay=true
                         ))

        bigData.put("upaxis" , bigUpper)
        bigData.put("upaxis2", x1)

        counter := 1

    if bigLower != 0
        bigData.put("downside", 1)

        x1 = bar_index - extSens

        txt = switch bigLower < bigData.get("dnaxis") 

            true => "LL" 
            =>      "HL"

        if showHLLL == true 
            dnLabel.set(0, label.new(x1, bigLower, txt, color = #ffffff00, 
                         textcolor = bullC, 
                         style     = label.style_label_up, 
                         size      = size.small, force_overlay=true
                         ))
        if showOB
            lowBlock.push(box.new(x1, bigLower, last_bar_index + 5, bigLower * 1.002,
                          border_color = color.new(color.blue, 75), 
                          bgcolor      = color.new(color.blue, 95), force_overlay=true
                          ))    

        bigData.put("dnaxis" , bigLower)
        bigData.put("dnaxis2", x1)

        counter := -1

    if showExt
        if ta.crossover(close, bigData.get("upaxis"))
            if bigData.get("upside") != 0

                str = switch bigData.get("moving") < 0

                    true => extStru != "BoS"   ? 'CHoCH' : "" 
                    =>      extStru != 'CHoCH' ? 'BoS'   : ""

                if extStru == "All" or str.contains(extStru, str)
                    drawChar(bigData.get("upaxis2"), bigData.get("upaxis"), str, bullC, true)

                bigData.put("upside", 0)
                bigData.put("moving", 1)

        if ta.crossunder(close, bigData.get("dnaxis"))

            if bigData.get("downside") != 0

                str = switch bigData.get("moving") > 0

                    true => extStru != "BoS"   ? 'CHoCH' : "" 
                    =>      extStru != 'CHoCH' ? 'BoS'   : ""

                if extStru == "All" or str.contains(extStru, str)
                    drawChar

Показано первые 50% кода (символов: 24837)

Что вы получите после оплаты

На этой странице откроется полный исходный код файла вместо ознакомительного фрагмента.

Чтобы оформить заказ, введите email и перейдите к оплате.

Стоимость полного кода: 2 484 ₽