Sayfa 214/297 İlkİlk ... 114164204212213214215216224264 ... SonSon
Arama sonucu : 2371 madde; 1,705 - 1,712 arası.

Konu: Tradingview

  1. ortaya karışık kombine...

    PHP Code:
     //@version=5
    strategy('**'overlay=true)

    start input(0.01)
    increment input(0.01)
    maximum input(0.2)

    psar ta.sar(startincrementmaximum)

    if 
    psar high
        strategy
    .entry('ParLE'strategy.longstop=psarcomment='Long')
    else
        
    strategy.cancel('ParLE')

    if 
    psar low
        strategy
    .entry('ParSE'strategy.shortstop=psarcomment='Short')
    else
        
    strategy.cancel('ParSE')

    //plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)
    ///// yörük sar stratejisi////////////
    y1 ta.sar(0.010.010.2)
    y2 ta.sar(0.010.020.2)
    y3 ta.sar(0.010.030.2)

    plot(y1,"Sar-Slow"style=plot.style_crosscolor=color.new(color.fuchsia0), linewidth=1)
    plot(y2,"Sar-Median"style=plot.style_crosscolor=color.new(color.orange0), linewidth=1)
    plot(y3"Sar-Fast",style=plot.style_crosscolor=color.new(color.white0), linewidth=1)
    //////////////////////////////yörük trend//////////////
    len44 input.int(3'Length'step=1minval=1)
    displace input.int(1'Displace'step=1minval=0)
    ma_type input.string('SMA''MA Type'options=['SMA',  'HMA'])

    //Hilo Activator
    float hilo na
    hi 
    ta.sma(highlen44)
    lo ta.sma(lowlen44)


    // Hull Moving Average (HMA)
    if ma_type == 'HMA'
        
    hi := ta.wma(ta.wma(highlen44 2) - ta.wma(highlen44), math.round(math.sqrt(len44)))
        
    lo := ta.wma(ta.wma(lowlen44 2) - ta.wma(lowlen44), math.round(math.sqrt(len44)))

    hilo := close hi[displace] ? close lo[displace] ? -hilo[1]
    ghla hilo == -hi[displace] : lo[displace]
    color44 hilo == -color.red color.lime

    //Alerts
    buyCondition hilo == and hilo[1] == -1
    sellCondition 
    hilo == -and hilo[1] == 1

    if buyCondition
        alert
    ('Long'alert.freq_once_per_bar)

    if 
    sellCondition
        alert
    ('Short'alert.freq_once_per_bar)

    //Plots 
    plot(ghla"TRend"color=color44style=plot.style_linelinewidth 2)
    /////////////////////yörük..herkesin kullandığı sar ile strateji...///////////////

    start41 input(0.02)
    increment41 input(0.02)
    maximum41 input(0.2)

    psar41 0.0  // PSAR
    af41 0.0  // Acceleration Factor
    trend_dir41 0  // Current direction of PSAR
    ep41 0.0  // Extreme point

    sar_long_to_short trend_dir41[1] == and close <= psar41[1]  // PSAR switches from long to short
    sar_short_to_long trend_dir41[1] == -and close >= psar41[1]  // PSAR switches from short to long

    trend_change barstate.isfirst[1] or sar_long_to_short or sar_short_to_long

    // Calculate trend direction
    trend_dir41 := barstate.isfirst[1] and close[1] > open[1] ? barstate.isfirst[1] and close[1] <= open[1] ? -sar_long_to_short ? -sar_short_to_long nz(trend_dir41[1])

    // Calculate  Acceleration Factor
    af41 := trend_change start41 trend_dir41 == and high ep41[1] or trend_dir41 == -and low ep41[1] ? math.min(maximum41af41[1] + increment41) : af41[1]

    // Calculate extreme point
    ep41 := trend_change and trend_dir41 == high trend_change and trend_dir41 == -low trend_dir41 == math.max(ep41[1], high) : math.min(ep41[1], low)

    // Calculate PSAR
    psar41 := barstate.isfirst[1] and close[1] > open[1] ? low[1] : barstate.isfirst[1] and close[1] <= open[1] ? high[1] : trend_change ep41[1] : trend_dir41 == psar41[1] + af41 * (ep41 psar41[1]) : psar41[1] - af41 * (psar41[1] - ep41)

    plot(psar41,"Alarm"style=plot.style_crosscolor=trend_dir41 == color.green color.redlinewidth=1)

    plotshape(sar_short_to_longstyle=shape.arrowupcolor=color.new(color.green0), location=location.abovebartext='Long',textcolor color.lime)
    plotshape(sar_long_to_shortstyle=shape.arrowdowncolor=color.new(color.red0), location=location.belowbartext='Short',textcolor color.red)

    // Alerts 
    alertcondition(sar_short_to_long'PSAR Long''PSAR Long')
    alertcondition(sar_long_to_short'PSAR Short''PSAR Short')
    //////////////////////////////////////yörük Ana trend sar...////////////
    AF_initial55 input(0.01)
    AF_increment55 input(0.01)
    AF_maximum55 input(0.2)

    LUCID_SAR(initial55increment55maximum55) =>

        
    // start with uptrend
        //1->true, 0-> false
        
    uptrend 1
        newtrend 
    0
        EP55 
    high
        SAR55 
    low
        AF55 
    AF_initial55

        EP55 
    := nz(uptrend[1]) == math.max(highnz(EP55[1])) : math.min(lownz(EP55[1]))
        
    AF55 := nz(newtrend[1]) == AF_initial55 AF55
        iff_1 
    EP55 != nz(EP55[1]) ? math.min(AF_maximum55nz(AF55[1]) + AF_increment55) : nz(AF55[1])
        
    AF55 := nz(newtrend[1]) == iff_1 AF55
        SAR55 
    := nz(SAR55[1]) + AF55 * (EP55 nz(SAR55[1]))

        
    iff_2 nz(newtrend) == math.max(highnz(EP55[1])) : math.min(SAR55nz(low[1]))
        
    iff_3 nz(newtrend) == math.min(lownz(EP55[1])) : math.max(SAR55nz(high[1]))
        
    SAR55 := nz(uptrend[1]) == iff_2 iff_3
        iff_4 
    nz(newtrend) == math.min(lownz(low[1])) : EP55
        iff_5 
    nz(newtrend) == math.max(highnz(high[1])) : EP55
        EP55 
    := nz(uptrend[1]) == iff_4 iff_5

        SAR55 
    := nz(uptrend[1]) == and nz(newtrend) == and nz(low[2]) != math.min(SAR55nz(low[2])) : SAR55
        SAR55 
    := nz(uptrend[1]) == and nz(newtrend) == and nz(high[2]) != math.max(SAR55nz(high[2])) : SAR55

        SAR55 
    := nz(uptrend[1]) == and nz(newtrend) == and SAR55 low math.max(highnz(EP55[1])) : SAR55
        EP55 
    := nz(uptrend[1]) == and nz(newtrend) == and SAR55 low math.min(lownz(low[1])) : EP55
        uptrend 
    := nz(uptrend[1]) == and nz(newtrend) == and SAR55 low uptrend
        newtrend 
    := nz(uptrend[1]) == and nz(newtrend) == and SAR55 low newtrend
        uptrend 
    := nz(uptrend[1]) == and nz(newtrend) == and not(SAR55 low) ? uptrend
        newtrend 
    := nz(uptrend[1]) == and nz(newtrend) == and not(SAR55 low) ? newtrend


        SAR55 
    := nz(uptrend[1]) == and nz(newtrend) == and SAR55 high math.min(lownz(EP55[1])) : SAR55
        EP55 
    := nz(uptrend[1]) == and nz(newtrend) == and SAR55 high math.max(highnz(high[1])) : EP55
        uptrend 
    := nz(uptrend[1]) == and nz(newtrend) == and SAR55 high uptrend
        newtrend 
    := nz(uptrend[1]) == and nz(newtrend) == and SAR55 high newtrend
        uptrend 
    := nz(uptrend[1]) == and nz(newtrend) == and not(SAR55 high) ? uptrend
        newtrend 
    := nz(uptrend[1]) == and nz(newtrend) == and not(SAR55 high) ? newtrend
        
    [SAR55uptrend]

    [
    L_SARup] = LUCID_SAR(AF_initial55AF_increment55AF_maximum55)
    plot(L_SAR'AnaTREND'color=up color.new(color.green0) : color.new(color.red0), style=plot.style_steplinelinewidth=2)
    ///////////////////yörük....en hassas sar ile iz stop niyetine....////////////
    start61 input.int(5minval=0maxval=10title='Start - Default = 2 - Multiplied by .01')
    increment61 input.int(5minval=0maxval=10title='Step Setting (Sensitivity) - Default = 2 - Multiplied by .01')
    maximum61 input.int(5minval=1maxval=10title='Maximum Step (Sensitivity) - Default = 2 - Multiplied by .10')
    sus61 input(true'Show Up Trending Parabolic Sar')
    sds61 input(true'Show Down Trending Parabolic Sar')
    disc61 input(truetitle='Start and Step settings are *.01 so 2 = .02 etc, Maximum Step is *.10 so 2 = .2')

    startCalc61 start61 .01
    incrementCalc61 
    increment61 .01
    maximumCalc61 
    maximum61 .10

    sarUp61 
    ta.sar(startCalc61incrementCalc61maximumCalc61)
    sarDown61 ta.sar(startCalc61incrementCalc61maximumCalc61)

    colUp61 close >= sarDown61 color.rgb(0230119100) : na
    colDown61 
    close <= sarUp61 color.rgb(2558282100) : na

    plot
    (sus61 and sarUp61 sarUp61 natitle='SAR-İz'style=plot.style_steplinebrlinewidth=2color=colUp61)
    plot(sds61 and sarDown61 sarDown61 natitle='SAR-İz'style=plot.style_steplinebrlinewidth=2color=colDown61)

    //@version=5

    input_lookback  input.int(defval 5title 'Lookback Range'minval 5)
    input_extend1    input.string(defval 'None'title 'Extend'options = ['None''Right''Left''Both'])
    input_width     input.int(defval 1title 'Width'minval 0)
    input_labels    input.bool(defval truetitle 'Labels'inline 'Labels')
    input_offset    input.int(defval 5title '| Offset Right'inline 'Labels')
    input_prices    input.bool(defval truetitle 'Prices'tooltip 'Prints the price of the level next to the retracement level.')
    input_bullColor input.color(defval color.greentitle 'Bull'inline 'color')
    input_bearColor input.color(defval color.redtitle 'Bear'inline 'color')
    input_trendline input.bool(defval truetitle 'Use Trendline'group 'Levels')
    input_use236    input.bool(defval falsetitle ''inline '0'group 'Levels')
    input_236       input.float(defval 0.236title ''inline '0'group 'Levels'step 0.01)
    input_use382    input.bool(defval falsetitle ''inline '382'group 'Levels')
    input_382       input.float(defval 0.382title ''inline '382'group 'Levels'step 0.01)
    input_use5      input.bool(defval truetitle ''inline '382'group 'Levels')
    input_5         input.float(defval 0.5title ''inline '382'group 'Levels'step 0.01)
    input_use618    input.bool(defval falsetitle ''inline '618'group 'Levels')
    input_618       input.float(defval 0.618title ''inline '618'group 'Levels'step 0.01)
    input_use786    input.bool(defval falsetitle ''inline '618'group 'Levels')
    input_786       input.float(defval 0.786title ''inline '618'group 'Levels'step 0.01)

    exType = switch input_extend1
        
    'None' => extend.none
        
    'Right' => extend.right
        
    'Left' => extend.left
        
    'Both' => extend.both

    pl1 
    fixnan(ta.pivotlow(input_lookbackinput_lookback))
    ph1 fixnan(ta.pivothigh(input_lookbackinput_lookback))
    plC ta.barssince(ta.change(pl1))
    phC ta.barssince(ta.change(ph1))

    var 
    string dir na
    since 
    phC plC plC input_lookback phC input_lookback
    if ta.change(ph1) or ta.crossunder(lowpl1)
        
    dir := 'bear'
    if ta.change(pl1) or ta.crossover(highph1)
        
    dir := 'bull'
    col dir == 'bull' input_bullColor input_bearColor

    getOuter
    (pivotsrc) =>
        var 
    srcValue src
        
    if ta.change(pivot)
            
    srcValue := pivot
        
    if pivot == ph1 src srcValue src srcValue
            srcValue 
    := src
        
    [srcValue]

    [
    h] = getOuter(ph1high)
    [
    l] = getOuter(pl1low)

    calcFib(float lofloat hifloat perc) => dir == 'bull' lo - (lo hi) * perc hi - (hi lo) * perc

    levelsArr 
    = array.from(0input_use236 input_236 nainput_use382 input_382 nainput_use5 input_5 nainput_use618 input_618 nainput_use786 input_786 na1)
    var 
    trendline  line.new(nanananastyle line.style_dottedwidth input_width)
    var 
    innerLines = array.new<line>()
    for 
    0 to 6
        
    if innerLines.size() < 7
            innerLines
    .push(line.new(nanananawidth input_width))
        
    innerLines.get(i).set_xy1(bar_index sincecalcFib(lhlevelsArr.get(i)))
        
    innerLines.get(i).set_xy2(bar_indexcalcFib(lhlevelsArr.get(i)))
        
    innerLines.get(i).set_color(col)
        
    innerLines.get(i).set_extend(exType)
        if 
    input_labels
            
    var labelArray = array.new<label>()
            if 
    labelArray.size() < 7
                labelArray
    .push(label.new(nananastyle label.style_none))
            
    labelArray.get(i).set_xy(bar_index input_offsetcalcFib(lhlevelsArr.get(i)))
            
    labelArray.get(i).set_text(str.tostring(levelsArr.get(i)) + (input_prices ' (' str.tostring(calcFib(lhlevelsArr.get(i)), format.mintick) + ')' na))
            
    labelArray.get(i).set_textcolor(col)    

    if 
    input_trendline
        
    if dir == 'bull'
            
    trendline.set_xy1(bar_index sincel)
            
    trendline.set_xy2(bar_indexh)
        else
            
    trendline.set_xy1(bar_index sinceh)
            
    trendline.set_xy2(bar_indexl)
    trendline.set_color(col)
    ///////////////////////////

    //@version=5

    len445 input.int(10'Length'step=1minval=1)
    displace63 input.int(1'Displace'step=1minval=0)
    ma_type63 input.string('HMA''MA Type'options=['SMA',  'HMA'])

    //Hilo Activator
    float hilo63 na
    hi63 
    ta.sma(highlen445)
    lo63 ta.sma(lowlen445)


    // Hull Moving Average (HMA)
    if ma_type63 == 'HMA'
        
    hi63 := ta.wma(ta.wma(highlen445 2) - ta.wma(highlen445), math.round(math.sqrt(len445)))
        
    lo63 := ta.wma(ta.wma(lowlen445 2) - ta.wma(lowlen445), math.round(math.sqrt(len445)))

    hilo63 := close hi63[displace63] ? close lo63[displace63] ? -hilo63[1]
    ghla63 hilo63 == -hi63[displace63] : lo63[displace63]
    color4463 hilo63 == -color.fuchsia color.yellow

    //Alerts
    buyCondition63 hilo63 == and hilo63[1] == -1
    sellCondition63 
    hilo63 == -and hilo63[1] == 1

    if buyCondition63
        alert
    ('Long'alert.freq_once_per_bar)

    if 
    sellCondition63
        alert
    ('Short'alert.freq_once_per_bar)

    //Plots 
    plot(ghla63"TR"color=color4463style=plot.style_steplinelinewidth 3)
    //plotshape(buyCondition, title = "Long", color = color.lime, textcolor = color.lime, text = "Long", style = shape.triangleup, location = location.belowbar, size = size.small)
    //plotshape(sellCondition, title = "Short", color = color.red, textcolor = color.red, text = "Short", style = shape.triangledown, location = location.abovebar, size = size.small) 
    16.07.2024 - 10.12.2024


  2. 16.07.2024 - 10.12.2024







  3. 16.07.2024 - 10.12.2024

  4. 16.07.2024 - 10.12.2024

  5. 16.07.2024 - 10.12.2024

Sayfa 214/297 İlkİlk ... 114164204212213214215216224264 ... 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
  •