Sayfa 204/276 İlkİlk ... 104154194202203204205206214254 ... SonSon
Arama sonucu : 2208 madde; 1,625 - 1,632 arası.

Konu: Tradingview

  1. https://tr.tradingview.com/script/n4...nvelope-ATRTS/



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

    //@version=5
    strategy(title='Moving Average Displaced Envelope & ATRTS'shorttitle='MADE+ATR'overlay=truemax_lines_count 100max_labels_count 100)
    tradeDirection input.string('Both'title='Trade Direction'options=['Both''Long''Short'])
    import Fontiramisu/fontilab/12 as fontilab

    // ] —————— Input Vars —————— [
    timeframe       input.timeframe(defval '60'group="Pivot Settings")
    leftBars        input.int(defval 2title "Left Bars"minval 1group="Pivot Settings")
    rightBars       input.int(defval 2title "Right Bars"minval 1group="Pivot Settings")

    // Fibo.
    isColorAll      input.bool(true""group="UI Settings"inline="color")
    colorAll        input.color(color.white"Color All Lines ----"group="UI Settings"inline="color")

    rightOffset     input.int(20"Label Offset Right"group="UI Settings"inline="offset")

    isfib0000       input.bool(true""group="UI Settings"inline="0")
    nFib0000        input.float(0""step=0.01group="UI Settings"inline="0")
    colorFib0000    input.color(color.white""group="UI Settings"inline="0")

    isfib0206       input.bool(false""group="UI Settings"inline="0")
    nFib0206        input.float(0.206""step=0.01group="UI Settings"inline="0")
    colorFib0206    input.color(color.white""group="UI Settings"inline="0")

    isfib0382       input.bool(false""group="UI Settings"inline="0.382")
    nFib0382        input.float(0.382""step=0.01group="UI Settings"inline="0.382")
    colorFib0382    input.color(color.white""group="UI Settings"inline="0.382")

    isfib0500       input.bool(true""group="UI Settings"inline="0.382")
    nFib0500        input.float(0.5""step=0.01group="UI Settings"inline="0.382")
    colorFib0500    input.color(color.white""group="UI Settings"inline="0.382")

    isfib0618       input.bool(false""group="UI Settings"inline="0.618")
    nFib0618        input.float(0.618""step=0.01group="UI Settings"inline="0.618")
    colorFib0618    input.color(color.white""group="UI Settings"inline="0.618")

    isfib0786       input.bool(false""group="UI Settings"inline="0.618")
    nFib0786        input.float(0.718""step=0.01group="UI Settings"inline="0.618")
    colorFib0786    input.color(color.white""group="UI Settings"inline="0.618")

    isfib1000       input.bool(true""group="UI Settings"inline="1")
    nFib1000        input.float(1""step=0.01group="UI Settings"inline="1")
    colorFib1000    input.color(color.white""group="UI Settings"inline="1")

    isfib1414       input.bool(false""group="UI Settings"inline="1")
    nFib1414        input.float(1.414""step=0.01group="UI Settings"inline="1")
    colorFib1414    input.color(color.white""group="UI Settings"inline="1")

    isfib1618       input.bool(false""group="UI Settings"inline="1.618")
    nFib1618        input.float(1.618""step=0.01group="UI Settings"inline="1.618")
    colorFib1618    input.color(color.white""group="UI Settings"inline="1.618")

    isfib2000       input.bool(false""group="UI Settings"inline="1.618")
    nFib2000        input.float(2""step=0.01group="UI Settings"inline="1.618")
    colorFib2000    input.color(color.white""group="UI Settings"inline="1.618")

    isfib2618       input.bool(false""group="UI Settings"inline="2.618")
    nFib2618        input.float(2.618""step=0.01group="UI Settings"inline="2.618")
    colorFib2618    input.color(color.white""group="UI Settings"inline="2.618")

    // ] —————— Vars —————— [
    var fib0000     close
    var fib0206     close
    var fib0382     close
    var fib0500     close
    var fib0618     close
    var fib0786     close
    var fib1000     close
    var fib1414     close
    var fib1618     close
    var fib2000     close
    var fib2618     close

    // ] —————— Find Dev Pivots —————— [

    getMultiTfPivots()=>
        
    float ph    ta.pivothigh(leftBarsrightBars)
        
    float pl    ta.pivotlow(leftBarsrightBars)
        
    phBIndexS   ph time[rightBars] : na
        plBIndexS   
    pl time[rightBars] : na

        
    [phphBIndexSplplBIndexS]

    // get if there if Pivot High/low and their start/end times
    [phphBIndexSplplBIndexS] = request.security(syminfo.tickeridtimeframegetMultiTfPivots(), lookahead barmerge.lookahead_on)

    // ] —————— Fibs Handles —————— [
    // Get last highs/lows.
    pivothigh           na(ph[1]) and ph ph na
    pivotlow            
    na(pl[1]) and pl pl na
    var isHighLast      true
    var curPivotP       0.    
    var lastPivotP      0. 
    var curPivotBi      0    
    var lastPivotBi     0

    // Special case: where high & low detected at the same time.
    if not na(pivothigh) and not na(pivotlow)
        
    lastPivotP          := isHighLast pl ph
        curPivotP           
    := isHighLast ph pl
        lastPivotBi         
    := isHighLast plBIndexS phBIndexS
        curPivotBi          
    := isHighLast phBIndexS plBIndexS
    // All cases
    else 
        
    isHighLast          := not na(pivothigh) ? true not na(pivotlow) ? false isHighLast
        
        lastPivotP          
    := not na(pivothigh) and not isHighLast[1] or not na(pivotlow) and isHighLast[1] ? curPivotP lastPivotP
        curPivotP           
    := not na(pivothigh) ? ph not na(pivotlow) ? pl curPivotP
        
        lastPivotBi         
    := not na(pivothigh) and not isHighLast[1] or not na(pivotlow) and isHighLast[1] ? curPivotBi lastPivotBi
        curPivotBi          
    := not na(pivothigh) ? phBIndexS not na(pivotlow) ? plBIndexS curPivotBi

    // Logic fibo direction.
    fiboDirUp           isHighLast

    // Last Update Barindex.
    var barLastUpdate 0
    barLastUpdate       
    := lastPivotBi

    // Calculate fibs levels.
    rangeD          isHighLast curPivotP lastPivotP lastPivotP curPivotP
    fib0000         
    := fiboDirUp curPivotP nFib0000 rangeD curPivotP nFib0000 rangeD
    fib0206         
    := fiboDirUp curPivotP nFib0206 rangeD curPivotP nFib0206 rangeD
    fib0382         
    := fiboDirUp curPivotP nFib0382 rangeD curPivotP nFib0382 rangeD
    fib0500         
    := fiboDirUp curPivotP nFib0500 rangeD curPivotP nFib0500 rangeD
    fib0618         
    := fiboDirUp curPivotP nFib0618 rangeD curPivotP nFib0618 rangeD
    fib0786         
    := fiboDirUp curPivotP nFib0786 rangeD curPivotP nFib0786 rangeD
    fib1000         
    := fiboDirUp curPivotP nFib1000 rangeD curPivotP nFib1000 rangeD
    fib1414         
    := fiboDirUp curPivotP nFib1414 rangeD curPivotP nFib1414 rangeD
    fib1618         
    := fiboDirUp curPivotP nFib1618 rangeD curPivotP nFib1618 rangeD
    fib2000         
    := fiboDirUp curPivotP nFib2000 rangeD curPivotP nFib2000 rangeD
    fib2618         
    := fiboDirUp curPivotP nFib2618 rangeD curPivotP nFib2618 rangeD

    // ] —————— Plot —————— [
    var fib0000Line     line.new(0lowbar_indexhigh)
    var 
    fib0000Label    label.new(bar_indexlowtext="Init")

    var 
    fib0206Line     line.new(0lowbar_indexhigh)
    var 
    fib0206Label    label.new(bar_indexlowtext="Init")

    var 
    fib0382Line     line.new(0lowbar_indexhigh)
    var 
    fib0382Label    label.new(bar_indexlowtext="Init")

    var 
    fib0500Line     line.new(0lowbar_indexhigh)
    var 
    fib0500Label    label.new(bar_indexlowtext="Init")

    var 
    fib0618Line     line.new(0lowbar_indexhigh)
    var 
    fib0618Label    label.new(bar_indexlowtext="Init")

    var 
    fib0786Line     line.new(0lowbar_indexhigh)
    var 
    fib0786Label    label.new(bar_indexlowtext="Init")

    var 
    fib1000Line     line.new(0lowbar_indexhigh)
    var 
    fib1000Label    label.new(bar_indexlowtext="Init")

    var 
    fib1414Line     line.new(0lowbar_indexhigh)
    var 
    fib1414Label    label.new(bar_indexlowtext="Init")

    var 
    fib1618Line     line.new(0lowbar_indexhigh)
    var 
    fib1618Label    label.new(bar_indexlowtext="Init")

    var 
    fib2000Line     line.new(0lowbar_indexhigh)
    var 
    fib2000Label    label.new(bar_indexlowtext="Init")

    var 
    fib2618Line     line.new(0lowbar_indexhigh)
    var 
    fib2618Label    label.new(bar_indexlowtext="Init")

    labelOffset rightOffset

    if isfib0000
        line
    .delete(fib0000Line)
        
    label.delete(fib0000Label)
        
    fib0000Line     := line.new(barLastUpdatefib0000timefib0000xloc=xloc.bar_timecolor=isColorAll colorAll colorFib0000,  width=1)
        
    fib0000Label    := label.new(x=bar_index labelOffsetfib0000xloc=xloc.bar_indextext=str.tostring(nFib0000), style=label.style_nonesize=size.smalltextcolor=isColorAll colorAll colorFib0000textalign=text.align_center)

    if 
    isfib0206
        line
    .delete(fib0206Line)
        
    label.delete(fib0206Label)
        
    fib0206Line     := line.new(barLastUpdatefib0206timefib0206xloc=xloc.bar_timecolor=isColorAll colorAll colorFib0206,  width=1)
        
    fib0206Label    := label.new(x=bar_index labelOffsetfib0206xloc=xloc.bar_indextext=str.tostring(nFib0206), style=label.style_nonesize=size.smalltextcolor=isColorAll colorAll colorFib0206textalign=text.align_center)

    if 
    isfib0382
        line
    .delete(fib0382Line)
        
    label.delete(fib0382Label)
        
    fib0382Line     := line.new(barLastUpdatefib0382timefib0382xloc=xloc.bar_timecolor=isColorAll colorAll colorFib0382,  width=1)
        
    fib0382Label    := label.new(x=bar_index labelOffsetfib0382xloc=xloc.bar_indextext=str.tostring(nFib0382), style=label.style_nonesize=size.smalltextcolor=isColorAll colorAll colorFib0382textalign=text.align_center)

    if 
    isfib0500
        line
    .delete(fib0500Line)
        
    label.delete(fib0500Label)
        
    fib0500Line     := line.new(barLastUpdatefib0500timefib0500xloc=xloc.bar_timecolor=isColorAll colorAll colorFib0500,  width=1)
        
    fib0500Label    := label.new(x=bar_index labelOffsetfib0500xloc=xloc.bar_indextext=str.tostring(nFib0500), style=label.style_nonesize=size.smalltextcolor=isColorAll colorAll colorFib0500textalign=text.align_center)

    if 
    isfib0618
        line
    .delete(fib0618Line)
        
    label.delete(fib0618Label)
        
    fib0618Line     := line.new(barLastUpdatefib0618timefib0618xloc=xloc.bar_timecolor=isColorAll colorAll colorFib0618,  width=1)
        
    fib0618Label    := label.new(x=bar_index labelOffsetfib0618xloc=xloc.bar_indextext=str.tostring(nFib0618), style=label.style_nonesize=size.smalltextcolor=isColorAll colorAll colorFib0618textalign=text.align_center)

    if 
    isfib0786
        line
    .delete(fib0786Line)
        
    label.delete(fib0786Label)
        
    fib0786Line     := line.new(barLastUpdatefib0786timefib0786xloc=xloc.bar_timecolor=isColorAll colorAll colorFib0786,  width=1)
        
    fib0786Label    := label.new(x=bar_index labelOffsetfib0786xloc=xloc.bar_indextext=str.tostring(nFib0786), style=label.style_nonesize=size.smalltextcolor=isColorAll colorAll colorFib0786textalign=text.align_center)

    if 
    isfib1000
        line
    .delete(fib1000Line)
        
    label.delete(fib1000Label)
        
    fib1000Line     := line.new(barLastUpdatefib1000timefib1000xloc=xloc.bar_timecolor=isColorAll colorAll colorFib1000,  width=1)
        
    fib1000Label    := label.new(x=bar_index labelOffsetfib1000xloc=xloc.bar_indextext=str.tostring(nFib1000), style=label.style_nonesize=size.smalltextcolor=isColorAll colorAll colorFib1000textalign=text.align_center)

    if 
    isfib1414
        line
    .delete(fib1414Line)
        
    label.delete(fib1414Label)
        
    fib1414Line     := line.new(barLastUpdatefib1414timefib1414xloc=xloc.bar_timecolor=isColorAll colorAll colorFib1414,  width=1)
        
    fib1414Label    := label.new(x=bar_index labelOffsetfib1414xloc=xloc.bar_indextext=str.tostring(nFib1414), style=label.style_nonesize=size.smalltextcolor=isColorAll colorAll colorFib1414textalign=text.align_center)

    if 
    isfib1618
        line
    .delete(fib1618Line)
        
    label.delete(fib1618Label)
        
    fib1618Line     := line.new(barLastUpdatefib1618timefib1618xloc=xloc.bar_timecolor=isColorAll colorAll colorFib1618,  width=1)
        
    fib1618Label    := label.new(x=bar_index labelOffsetfib1618xloc=xloc.bar_indextext=str.tostring(nFib1618), style=label.style_nonesize=size.smalltextcolor=isColorAll colorAll colorFib1618textalign=text.align_center)

    if 
    isfib2000
        line
    .delete(fib2000Line)
        
    label.delete(fib2000Label)
        
    fib2000Line     := line.new(barLastUpdatefib2000timefib2000xloc=xloc.bar_timecolor=isColorAll colorAll colorFib2000,  width=1)
        
    fib2000Label    := label.new(x=bar_index labelOffsetfib2000xloc=xloc.bar_indextext=str.tostring(nFib2000), style=label.style_nonesize=size.smalltextcolor=isColorAll colorAll colorFib2000textalign=text.align_center)

    if 
    isfib2618
        line
    .delete(fib2618Line)
        
    label.delete(fib2618Label)
        
    fib2618Line     := line.new(barLastUpdatefib2618timefib2618xloc=xloc.bar_timecolor=isColorAll colorAll colorFib2618,  width=1)
        
    fib2618Label    := label.new(x=bar_index labelOffsetfib2618xloc=xloc.bar_indextext=str.tostring(nFib2618), style=label.style_nonesize=size.smalltextcolor=isColorAll colorAll colorFib2618textalign=text.align_center)

    // linefill.new(fib0786Line, fib1000Line, color.blue)

    // ]
    Price input(title='Source'defval=close)
    Period input.int(defval=9minval=1)
    perAb input.float(title='Percent above'defval=.5minval=0.01step=0.1)
    perBl input.float(title='Percent below'defval=.5minval=0.01step=0.1)
    disp input.int(title='Displacement'defval=13minval=1)

    nATRPeriod input(15)
    nATRMultip input(2)
    useATR input(truetitle='ATR Filter')
    reverse input(truetitle='Trade reverse')

    longAllowed tradeDirection == 'Long' or tradeDirection == 'Both'
    shortAllowed tradeDirection == 'Short' or tradeDirection == 'Both'
    pos 0
    sEMA 
    ta.ema(PricePeriod)
    top sEMA[disp] * ((100 perAb) / 100)
    bott sEMA[disp] * ((100 perBl) / 100)

    xATR ta.atr(nATRPeriod)
    xHHs =ta.sma(ta.highest(nATRPeriod), nATRPeriod)
    xLLs =ta.sma(ta.lowest(nATRPeriod),nATRPeriod)
    nSpread = (xHHs xLLs) / 2
    nLoss 
    nATRMultip xATR
    var xATRTrailingStop 0.0
    xATRTrailingStop 
    := close nz(xATRTrailingStop[1], 0) and close[1] > nz(xATRTrailingStop[1], 0) ? math.max(nz(xATRTrailingStop[1]), close nLoss) :
         
    close nz(xATRTrailingStop[1], 0) and close[1] < nz(xATRTrailingStop[1], 0) ? math.min(nz(xATRTrailingStop[1]), close nLoss) : 
         
    close nz(xATRTrailingStop[1], 0) ? close nLoss close nLoss

    ATRLong 
    close xATRTrailingStop true false
    ATRShort 
    close xATRTrailingStop true false

    iff_1 
    close top pos[1]
    pos := close bott ? -iff_1
    iff_2 
    reverse and pos == -pos
    possig 
    reverse and pos == ? -iff_2
    clr 
    strategy.position_size
    if possig == 
        
    if longAllowed and ATRLong
            strategy
    .entry('Long'strategy.long)
        else
            if 
    ATRLong or strategy.position_size 0
                strategy
    .close_all()
    if 
    possig == -
        
    if shortAllowed and ATRShort
            strategy
    .entry('Short'strategy.short)
        else    
            if 
    ATRShort or strategy.position_size 0
                strategy
    .close_all()
    if 
    possig == 0
        strategy
    .close_all()
        
    //plot(xATRTrailingStop[1], color=color.blue, title='ATR Trailing Stop')
    barcolor(clr #b50404 : clr > 0 ? #079605 : #0536b3) 
    16.07.2024 - 10.12.2024

  2. https://tr.tradingview.com/v/CEyNpwaS/
    aklınıza gelebilecek tüm ortalama çeşitlerini.....
    kütüphane yapıp...çağıran çok çok güzel bir kod.......
    16.07.2024 - 10.12.2024

  3. deneme...
    strateji eklenmedi....
    PHP Code:
      //@version=5
    indicator("*"overlay truemax_lines_count 500max_labels_count 500max_bars_back=3000)

    timeframe input.timeframe(defval 'D'title="Source"tooltip="Must be higher than your chart timeframe\nThis chooses the most recent candle of that timeframe for the olhc levels\nIf the levels look wrong, check the last candle in that timeframe!")
    input.int(0'Display nth Candle'minval=0maxval 100tooltip "Number of the candle to use, counting backwards, 0 is the current candle, 1 is the previous, etc")
    display input.string("Lines""Display Style"options=["Lines""Boxes","None"])
    high_level input.color(defval color.new(color.green25), title="High to Open/Close")
    oc_level input.color(defval color.new(#d7da4c, 25), title="Open to Close")
    low_level input.color(defval color.new(color.maroon25), title="Open/Close to Low")
    markhl input.bool(defval truetitle="Mark High and Low with â–¼ â–²")
    markoc input.bool(defval truetitle="Mark Open Close with O C")
    open_border_style input.string(line.style_solid'Line Style'options=[line.style_solidline.style_dottedline.style_dashed])
    open_border_width input.int(1'Line Width'minval=0)
    extend input.bool(defval falsetitle "Extend?")
    template input.bool(defval truetitle="Draw Separate OxxC Template")
    alerthigh input.bool(defval falsetitle="Alerts when high is crossed?")
    alertlow input.bool(defval falsetitle="Alerts when low is crossed?")
    alertopen input.bool(defval falsetitle="Alerts when new open price is created?")

    extd = (extend == true extend.right extend.none)

    ResolutionToSec(res)=>
        
    mins res == "1" :
               
    res == "3" :
               
    res == "5" :
               
    res == "10" 10 :
               
    res == "15" 15 :
               
    res == "30" 30 :
               
    res == "45" 45 :
               
    res == "60" 60 :
               
    res == "120" 120 :
               
    res == "180" 180 :
               
    res == "240" 240 :
               
    res == "D" or res == "1D" 1440 :
               
    res == "W" or res == "1W" 10080 :
               
    res == "M" or res == "1M" 43200 :
               
    res == "" int(str.tonumber(timeframe.period)) : 
               
    str.substring(timeframe.period23) == "S" int(str.tonumber(str.substring(timeframe.period02)))/60 int(str.tonumber(res))
        
    ms mins 60 1000

    bar 
    ResolutionToSec(timeframe.period

    get_OHLC_day()=>
        
    highshigh[p]
        
    lowslow[p]
        
    opensopen[p]
        
    closesclose[p]
        
    bartimestime[p]
        
        [
    highslowsopensclosesbartimes]
        
    [
    dhighsdlowsdopensdclosesdbartimes] = request.security(syminfo.tickeridtimeframeget_OHLC_day(), lookahead barmerge.lookahead_on)
    [
    dayhighsdaylowsdayopensdayclosesdaybartimes] = request.security(syminfo.tickerid"1D"get_OHLC_day(), lookahead barmerge.lookahead_on)
    [
    whighswlowswopenswcloseswbartimes] = request.security(syminfo.tickerid"1W"get_OHLC_day(), lookahead barmerge.lookahead_on)

    ext 0

    if (bar_index == last_bar_index)  
        
    sesshigh 0.0
        sesslow 
    high*10
        sesshighx 
    0
        sesslowx 
    0
        above 
    0.0
        below 
    0.0
        
    // sess = "0000-0000"
        // s = time(timeframe.period, sess, zone)
        
    var bool isTime false
        
    var label sessionopenlabel na
        
    var label sessioncloselabel na
        
    var line template_oc_line na
        
    var line template_high_line na
        
    var line template_low_line na
        
        
    for 0 to 2880
            
            isTime 
    := time[x] >= dbartimes
            
            
    if (isTime)
                if (
    high[x] > sesshigh)    
                    
    sesshigh := high[x]
                    
    sesshighx := x
                
    if (low[x] < sesslow)    
                    
    sesslow := low[x]    
                    
    sesslowx := x
                    
        
    if (markhl == true)
            
            
    sessionhighlabel label.new(time[sesshighx], sesshightext="â–¼"color=color.whitexloc=xloc.bar_timestyle=label.style_nonetextcolor=high_levelsize=size.smalltextalign=text.align_center)
            
    sessionlowlabel label.new(time[sesslowx], sesslow*0.9999text="â–²"color=color.whitexloc=xloc.bar_timestyle=label.style_nonetextcolor=low_levelsize=size.smalltextalign=text.align_center)
            
    label.delete(sessionhighlabel[1])
            
    label.delete(sessionlowlabel[1])
            
        if (
    markoc == true)
            
            
    sessionopenlabel label.new(time+(bar*2), dopenstext="O"color=color.whitexloc=xloc.bar_timestyle=label.style_nonetextcolor=oc_levelsize=size.smalltextalign=text.align_center)
            
    sessioncloselabel label.new(time+(bar*2), closetext="C"color=color.whitexloc=xloc.bar_timestyle=label.style_nonetextcolor=oc_levelsize=size.smalltextalign=text.align_center)
            
    label.delete(sessionopenlabel[1])
            
    label.delete(sessioncloselabel[1])
            
        
        
    ext := time
            
        
    if (display == "Boxes")
            
    open_close_box box.new(dbartimesdopens close dopens closeextdopens close close dopenscolor.new(oc_level65), extend=extdxloc=xloc.bar_timeborder_width=open_border_widthborder_style=open_border_stylebgcolor=oc_level)
            
    high_box box.new(dbartimessesshighextdopens close dopens closecolor.new(high_level65), extend=extdxloc=xloc.bar_timeborder_width=open_border_widthborder_style=open_border_stylebgcolor=high_level)
            
    low_box box.new(dbartimesdopens close close dopensextsesslowcolor.new(low_level65), extend=extdxloc=xloc.bar_timeborder_width=open_border_widthborder_style=open_border_stylebgcolor=low_level)
            
    box.delete(open_close_box[1])     
            
    box.delete(high_box[1])     
            
    box.delete(low_box[1])     
        else if (
    display == "Lines")
            
    open_line line.new(dbartimesdopensextdopensextend=extdxloc=xloc.bar_timecolor=oc_levelwidth=open_border_widthstyle=open_border_style)
            
    high_line line.new(dbartimessesshighextsesshighextend=extdxloc=xloc.bar_timecolor=high_levelwidth=open_border_widthstyle=open_border_style)
            
    low_line line.new(dbartimessesslowextsesslowextend=extdxloc=xloc.bar_timecolor=low_levelwidth=open_border_widthstyle=open_border_style)
            
    close_line line.new(dbartimescloseextcloseextend=extdxloc=xloc.bar_timecolor=oc_levelwidth=open_border_widthstyle=open_border_style)
            
    // debug label.new(bar_index, high, text=str.tostring(int(str.tonumber(str.substring(timeframe.period, 0, 2)))))
            
    line.delete(open_line[1])     
            
    line.delete(close_line[1])     
            
    line.delete(high_line[1])     
            
    line.delete(low_line[1])
                
        
        if (
    template == true)
            
    mid 10
            template_open_line 
    line.new(time + (bar * (mid-3)), dopenstime+(bar*mid), dopensxloc=xloc.bar_timecolor=oc_levelwidth=open_border_width*2style=line.style_solid)
            
    template_close_line line.new(time + (bar mid), closetime+(bar*(mid+3)), closexloc=xloc.bar_timecolor=oc_levelwidth=open_border_width*2style=line.style_solid)
            
    template_oc_line line.new(time + (bar mid), dopenstime+(bar*mid), closexloc=xloc.bar_timecolor=oc_levelwidth=open_border_width*2style=line.style_solid)
            
    template_high_line line.new(time + (bar mid), dopens close dopens closetime+(bar*mid), sesshighxloc=xloc.bar_timecolor=high_levelwidth=open_border_width*2style=line.style_solid)
            
    template_low_line line.new(time + (bar mid), dopens close close dopenstime+(bar*mid), sesslowxloc=xloc.bar_timecolor=low_levelwidth=open_border_width*2style=line.style_solid)
            
    line.delete(template_oc_line[1])     
            
    line.delete(template_high_line[1])     
            
    line.delete(template_low_line[1])
            
    line.delete(template_close_line[1])
            
    line.delete(template_open_line[1])

        if (
    high == sesshigh and alerthigh)
            
    alert("OHLC Price made new High of "+str.tostring(sesshigh), alert.freq_once_per_bar)

        if (
    low == sesslow and alertlow)
            
    alert("OHLC Price made new Low of "+str.tostring(sesslow), alert.freq_once_per_bar)

        if (
    time == dbartimes and alertopen)
            
    alert("New OHLC has been created with Open price "+str.tostring(open), alert.freq_once_per_bar)

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

    //@version=5
    import loxx/loxxexpandedsourcetypes/4

    greencolor 
    #2DD204
    redcolor #D2042D 

    fdip(float srcint perint speedin)=>
        
    float fmax ta.highest(srcper)
        
    float fmin ta.lowest(src,  per)
        
    float length 0
        float diff 
    0
        
    for 1 to per 1
            diff 
    := (nz(src[i]) - fmin) / (fmax fmin)
            if 
    0
                length 
    += math.sqrtmath.pow(nz(diff[i]) - nz(diff[1]), 2) + (math.pow(per2)))
        
    float fdi + (math.log(length) + math.log(2)) / math.log(per)
        
    float traildim / (fdi)
        
    float alpha traildim 2
        int speed 
    math.round(speedin alpha)
        
    speed
        
    nonlagma
    (float srcfloat len)=>
        
    float cycle 4.0
        float coeff 
    3.0 math.pi
        float phase 
    len 1.0
        int _len 
    int(len cycle phase)
        
    float weight 0.float alfa 0.float out 0.
        float
    [] alphas = array.new_float(_len0.)
        for 
    0 to _len 1
            float t 
    0.
            t 
    := <= phase ?  1.0 / (phase 1) : 1.0 + (phase 1) * (2.0 cycle 1.0) / (cycle len -1.0)
            
    float beta math.cos(math.pi t)
            
    float g 1.0/(coeff 1)
            
    := <= 0.5  g
            
    array.set(alphaskbeta)
            
    weight += array.get(alphask)
        if (
    weight 0)  
            
    float sum 0.
            
    for 0 to _len 1
                sum 
    += array.get(alphask) * nz(src[k])
            
    out := (sum weight)
        
    out

    smthtype 
    input.string("Kaufman""Heikin-Ashi Better Caculation Type"options = ["AMA""T3""Kaufman"], group "Source Settings")
    srcin input.string("Median""Source"group"Source Settings"
         
    options 
         [
    "Close""Open""High""Low""Median""Typical""Weighted""Average""Average Median Body""Trend Biased""Trend Biased (Extreme)"
         
    "HA Close""HA Open""HA High""HA Low""HA Median""HA Typical""HA Weighted""HA Average""HA Average Median Body""HA Trend Biased""HA Trend Biased (Extreme)",
         
    "HAB Close""HAB Open""HAB High""HAB Low""HAB Median""HAB Typical""HAB Weighted""HAB Average""HAB Average Median Body""HAB Trend Biased""HAB Trend Biased (Extreme)"])

    per input.int(30"Fractal Period Ingest"group "Adaptive Settings")
    speed input.int(20"Speed"group "Adaptive Settings")
    ColorSteps input.int(50"Color Period"group "Adaptive Settings")

    colorbars input.bool(true"Color bars?"group "UI Options")

    kfl=input.float(0.666title="* Kaufman's Adaptive MA (KAMA) Only - Fast End"group "Moving Average Inputs")
    ksl=input.float(0.0645title="* Kaufman's Adaptive MA (KAMA) Only - Slow End"group "Moving Average Inputs")
    amafl input.int(2title="* Adaptive Moving Average (AMA) Only - Fast"group "Moving Average Inputs")
    amasl input.int(30title="* Adaptive Moving Average (AMA) Only - Slow"group "Moving Average Inputs")

    haclose request.security(ticker.heikinashi(syminfo.tickerid), timeframe.periodclose)
    haopen request.security(ticker.heikinashi(syminfo.tickerid), timeframe.periodopen)
    hahigh request.security(ticker.heikinashi(syminfo.tickerid), timeframe.periodhigh)
    halow request.security(ticker.heikinashi(syminfo.tickerid), timeframe.periodlow)
    hamedian request.security(ticker.heikinashi(syminfo.tickerid), timeframe.periodhl2)
    hatypical request.security(ticker.heikinashi(syminfo.tickerid), timeframe.periodhlc3)
    haweighted request.security(ticker.heikinashi(syminfo.tickerid), timeframe.periodhlcc4)
    haaverage request.security(ticker.heikinashi(syminfo.tickerid), timeframe.periodohlc4)

    src = switch srcin
        
    "Close" => loxxexpandedsourcetypes.rclose()
        
    "Open" => loxxexpandedsourcetypes.ropen()
        
    "High" => loxxexpandedsourcetypes.rhigh()
        
    "Low" => loxxexpandedsourcetypes.rlow()
        
    "Median" => loxxexpandedsourcetypes.rmedian()
        
    "Typical" => loxxexpandedsourcetypes.rtypical()
        
    "Weighted" => loxxexpandedsourcetypes.rweighted()
        
    "Average" => loxxexpandedsourcetypes.raverage()
        
    "Average Median Body" => loxxexpandedsourcetypes.ravemedbody()
        
    "Trend Biased" => loxxexpandedsourcetypes.rtrendb()
        
    "Trend Biased (Extreme)" => loxxexpandedsourcetypes.rtrendbext()
        
    "HA Close" => loxxexpandedsourcetypes.haclose(haclose)
        
    "HA Open" => loxxexpandedsourcetypes.haopen(haopen)
        
    "HA High" => loxxexpandedsourcetypes.hahigh(hahigh)
        
    "HA Low" => loxxexpandedsourcetypes.halow(halow)
        
    "HA Median" => loxxexpandedsourcetypes.hamedian(hamedian)
        
    "HA Typical" => loxxexpandedsourcetypes.hatypical(hatypical)
        
    "HA Weighted" => loxxexpandedsourcetypes.haweighted(haweighted)
        
    "HA Average" => loxxexpandedsourcetypes.haaverage(haaverage)
        
    "HA Average Median Body" => loxxexpandedsourcetypes.haavemedbody(haclosehaopen)
        
    "HA Trend Biased" => loxxexpandedsourcetypes.hatrendb(haclosehaopenhahighhalow)
        
    "HA Trend Biased (Extreme)" => loxxexpandedsourcetypes.hatrendbext(haclosehaopenhahighhalow)
        
    "HAB Close" => loxxexpandedsourcetypes.habclose(smthtypeamaflamaslkflksl)
        
    "HAB Open" => loxxexpandedsourcetypes.habopen(smthtypeamaflamaslkflksl)
        
    "HAB High" => loxxexpandedsourcetypes.habhigh(smthtypeamaflamaslkflksl)
        
    "HAB Low" => loxxexpandedsourcetypes.hablow(smthtypeamaflamaslkflksl)
        
    "HAB Median" => loxxexpandedsourcetypes.habmedian(smthtypeamaflamaslkflksl)
        
    "HAB Typical" => loxxexpandedsourcetypes.habtypical(smthtypeamaflamaslkflksl)
        
    "HAB Weighted" => loxxexpandedsourcetypes.habweighted(smthtypeamaflamaslkflksl)
        
    "HAB Average" => loxxexpandedsourcetypes.habaverage(smthtypeamaflamaslkflksl)
        
    "HAB Average Median Body" => loxxexpandedsourcetypes.habavemedbody(smthtypeamaflamaslkflksl)
        
    "HAB Trend Biased" => loxxexpandedsourcetypes.habtrendb(smthtypeamaflamaslkflksl)
        
    "HAB Trend Biased (Extreme)" => loxxexpandedsourcetypes.habtrendbext(smthtypeamaflamaslkflksl)
        => 
    haclose
        
    len 
    fdip(srcperspeed)
    nonlag nonlagma(srclen)

    min ta.lowest(nonlagColorSteps
    max ta.highest(nonlagColorSteps
    mid = (max min) / 2

    colorBuffer 
    color.from_gradient(nonlagminmidredcolorgreencolor)

    //plot(nonlag, "Adaptive Non-Lag MA", color = colorBuffer, linewidth = 3)

    barcolor(colorbars colorBuffer na)
        
    // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // © HasanRifat

    //@version=5

    look_back input.int(defval 20title "Candle Lookback")
    confirm_in input.int(defval 3title "Confirm Within")

    bull_candle 0
    bear_candle 
    0

    v_up 
    false
    v_dn 
    false

    var bull_active_candle      false
    var bull_active_candle_low  0.0
    var bull_active_candle_high 0.0
    var bull_signal_active      false
    var bull_candle_count       0

    var bear_active_candle      false
    var bear_active_candle_low  0.0
    var bear_active_candle_high 0.0
    var bear_signal_active      false
    var bear_candle_count       0

    for 0 to (look_back 1)
        if 
    close low[i]
            
    bull_candle := bull_candle 1
        
    if close high[i]
            
    bear_candle := bear_candle 1

    if bull_candle              == (look_back 1)
        
    bull_active_candle      := true
        bull_active_candle_low  
    := low
        bull_active_candle_high 
    := high
        bull_signal_active      
    := false
        bull_candle_count       
    := 0

    if bull_active_candle == true
        bull_candle_count 
    := bull_candle_count 1

    if bear_candle              == (look_back 1)
        
    bear_active_candle      := true
        bear_active_candle_low  
    := low
        bear_active_candle_high 
    := high
        bear_signal_active      
    := false
        bear_candle_count       
    := 0

    if bear_active_candle == true
        bear_candle_count 
    := bear_candle_count 1

    if close bull_active_candle_low
        bull_active_candle 
    := false

    if close bear_active_candle_high
        bear_active_candle 
    := false

    if bull_active_candle  == true and close bull_active_candle_high and bull_signal_active == false and bull_candle_count <= (confirm_in+1) and barstate.isconfirmed
        bull_signal_active 
    := true
        v_up 
    := true

    if bear_active_candle  == true and close bear_active_candle_low and bear_signal_active == false and bear_candle_count <= (confirm_in+1) and barstate.isconfirmed
        bear_signal_active 
    := true
        v_dn 
    := true

    plotshape
    (v_uptitle "V Up"style shape.triangleuplocation location.belowbarcolor color.greensize size.small)
    plotshape(v_dntitle "V Dn"style shape.triangledownlocation location.abovebarcolor color.redsize size.small)

    alertcondition(v_up"Bullish Revarsal""Bullish Revarsal")
    alertcondition(v_dn"Bearish Revarsal""Bearish Revarsal")


    // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // © jdehorty
    // @version=5

    // A non-repainting implementation of Nadaraya–Watson Regression using a Rational Quadratic Kernel. 


    // Settings
    src66 input.source(close'Source')
    input.float(8.'Lookback Window'minval=3.tooltip='The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars. Recommended range: 3-50')
    input.float(8.'Relative Weighting'step=0.25tooltip='Relative weighting of time frames. As this value approaches zero, the longer time frames will exert more influence on the estimation. As this value approaches infinity, the behavior of the Rational Quadratic Kernel will become identical to the Gaussian kernel. Recommended range: 0.25-25')
    x_0 input.int(25"Start Regression at Bar"tooltip='Bar index on which to start regression. The first bars of a chart are often highly volatile, and omission of these initial bars often leads to a better overall fit. Recommended range: 5-25')
    smoothColors input.bool(false"Smooth Colors"tooltip="Uses a crossover based mechanism to determine colors. This often results in less color transitions overall."inline='1'group='Colors')
    lag input.int(2"Lag"tooltip="Lag for crossover detection. Lower values result in earlier crossovers. Recommended range: 1-2"inline='1'group='Colors')
    size = array.size(array.from(src66)) // size of the data series

    // Further Reading:
    // The Kernel Cookbook: Advice on Covariance functions. David Duvenaud. Published June 2014.
    // Estimation of the bandwidth parameter in Nadaraya-Watson kernel non-parametric regression based on universal threshold level. Ali T, Heyam Abd Al-Majeed Hayawi, Botani I. Published February 26, 2021.
    kernel_regression(_src66_size_h) =>
        
    float _currentWeight 0.
        float _cumulativeWeight 
    0.
        
    for 0 to _size x_0
            y 
    _src66[i
            
    math.pow(+ (math.pow(i2) / ((math.pow(_h2) * r))), -r)
            
    _currentWeight += y*w
            _cumulativeWeight 
    += w
        _currentWeight 
    _cumulativeWeight

    // Estimations
    yhat1 kernel_regression(src66sizeh)
    yhat2 kernel_regression(src66sizeh-lag)

    // Rates of Change
    bool wasBearish yhat1[2] > yhat1[1]
    bool wasBullish yhat1[2] < yhat1[1]
    bool isBearish yhat1[1] > yhat1
    bool isBullish 
    yhat1[1] < yhat1
    bool isBearishChange 
    isBearish and wasBullish
    bool isBullishChange 
    isBullish and wasBearish

    // Crossovers
    bool isBullishCross ta.crossover(yhat2yhat1)
    bool isBearishCross ta.crossunder(yhat2yhat1
    bool isBullishSmooth yhat2 yhat1
    bool isBearishSmooth 
    yhat2 yhat1

    // Colors
    color c_bullish input.color(#3AFF17, 'Bullish Color', group='Colors')
    color c_bearish input.color(#FD1707, 'Bearish Color', group='Colors')
    color colorByCross isBullishSmooth c_bullish c_bearish
    color colorByRate 
    isBullish c_bullish c_bearish
    color plotColor 
    smoothColors colorByCross colorByRate

    // Plot
    plot(yhat1"RQKE"color=plotColorlinewidth=1)

    // Alert Variables
    bool alertBullish smoothColors isBearishCross isBearishChange
    bool alertBearish 
    smoothColors isBullishCross isBullishChange

    // Alerts for Color Changes
    alertcondition(condition=alertBullishtitle='Bearish Color Change'message='Nadaraya-Watson: {{ticker}} ({{interval}}) turned Bearish â–¼')
    alertcondition(condition=alertBearishtitle='Bullish Color Change'message='Nadaraya-Watson: {{ticker}} ({{interval}}) turned Bullish â–²')

    // Non-Displayed Plot Outputs (i.e., for use in other indicators)
    plot(alertBearish ? -alertBullish 0"Alert Stream"display=display.none

    https://www.tradingview.com/x/r3g7pgu7/
    https://www.tradingview.com/x/EdtcumM0/
    https://www.tradingview.com/x/b2mjFBYQ/
    16.07.2024 - 10.12.2024

  4. https://www.tradingview.com/x/KJdtiks3/ düzeltme tamam dersek...
    https://www.tradingview.com/x/F8WWaC6t/ 1482 üzeri kapanış....
    1583 kanalını devreye sokar...
    kanalı test etmesi için...tavan olması gerekir gibi....olasılık yüzde 54

    1508 kesin stop şartıyla.....
    https://www.tradingview.com/x/oJQBHpzl/ şu an için konsildasyonda....

    teknik olarak avlanmak için....1502 ye pin bar gerekir...ki sistem oyun dışı olur...
    https://www.tradingview.com/x/2NjCSgT1/


    https://www.tradingview.com/x/8zyS1p57/ 1512 ile konsildasyon dibi belirlenmiş oldu....


    son durum...https://www.tradingview.com/x/GlcKZiLg/

    teknikçi... stopla avlanır....1508 stopla oyundan atılan sitem....

    son durum....https://www.tradingview.com/x/JJnxcJN9/
    Son düzenleme : @yörük@; 10-07-2023 saat: 12:18.
    16.07.2024 - 10.12.2024

  5. https://www.tradingview.com/x/q1K6SqaN/
    hızlı bir 640 atağı gelebilir gibi....
    16.07.2024 - 10.12.2024

  6. https://www.tradingview.com/x/P7lgW52e/
    bu çanak çömlekle...70 e gider mi?
    acaba...
    16.07.2024 - 10.12.2024

  7. deneme...
    farklı bir 20-50-200 çalışması bar renklendirmeli...
    strateji yazmadım.....
    https://www.tradingview.com/x/SEUxSyUe/
    https://www.tradingview.com/x/1sg881ga/
    https://www.tradingview.com/x/BvkKruvo/
    agresif tasarım oldu...1-5-15 periyotlar için...
    16.07.2024 - 10.12.2024

  8. deneme
    PHP Code:
     //@version=5
    strategy(title='Moonhub Cycle Index'shorttitle='*'overlay=true,max_lines_count 100)

    // Input parameters
    len_DIema input.int(1minval=1title='COEMA Length')
    len_DIsma input.int(50minval=1title='COSMA Length')
    start1 input(0.1)
    increment1 input(0.1)
    maximum1 input(0.1"Max Value")
    out1 ta.sar(start1increment1maximum1)
    start2 input(0.1)
    increment2 input(0.1)
    maximum2 input(0.1"Max Value")
    out2 ta.sar(start2increment2maximum2)
    start3 input(0.1)
    increment3 input(0.1)
    maximum3 input(0.1"Max Value")
    out3 ta.sar(start3increment3maximum3)
    // Create a custom index
    index = (out1 out2 out3) / 3

    // Calculate COEMA and COSMA for the Custom Index
    DI_index_Co_E ta.ema(indexlen_DIema)
    DI_Co_indexS ta.sma(indexlen_DIsma)

    // Plot the index
    plot(indextitle='ORT'color=color.new(#ff5252, 100), linewidth=2)
    plot(DI_index_Co_Etitle='EMA'color=color.new(#2195f3, 100), linewidth=2)
    plot(DI_Co_indexStitle='SMA'color=color.new(#4caf4f, 100), linewidth=2)

    changebarcol input.bool(truetitle='Change Bar Color'inline='bcol')
    bcolup input.color(color.rgb(10324376), title=''inline='bcol')
    bcoldn input.color(color.rgb(2487878), title=''inline='bcol')

    var 
    color lastBarColor na
    BullishColor 
    input.color(color.rgb(12524777))
    BearishColor input.color(color.rgb(2457676))
    barColorBasedOnDEMATrend close out1 and close out2 and close out3    BullishColor close out1 and close out2 and close out3  BearishColor nz(lastBarColor[1])
    lastBarColor := barColorBasedOnDEMATrend
    //barcolor(color=changebarcol ? barColorBasedOnDEMATrend : na)

    xa ta.crossover(close,out1) and  ta.crossover(close,out2) and  ta.crossover(close,out3)
    ys ta.crossunder(close,out1) and ta.crossunder(close,out2) and ta.crossunder(close,out3)
    in_b ta.barssince(xa)[1] < ta.barssince(ys)[1]
    in_s ta.barssince(ys)[1] < ta.barssince(xa)[1]

    if 
    xa
        strategy
    .entry("Long",strategy.long)
    if 
    ys
        strategy
    .close("Long"
    16.07.2024 - 10.12.2024

Sayfa 204/276 İlkİlk ... 104154194202203204205206214254 ... SonSon

Yer İmleri

Yer İmleri

Gönderi Kuralları

  • Yeni konu açamazsınız
  • Konulara cevap yazamazsınız
  • Yazılara ek gönderemezsiniz
  • Yazılarınızı değiştiremezsiniz
  •