Sayfa 212/272 İlkİlk ... 112162202210211212213214222262 ... SonSon
Arama sonucu : 2172 madde; 1,689 - 1,696 arası.

Konu: Tradingview

  1. https://tr.tradingview.com/v/QgVDxphm/
    5 dakkalık grafiklerde kullanmak için range...strateji kodu... v3 versiyon...


    PHP Code:
       //@version=5
    strategy(title='Range Filter Buy and Sell 5min [Strategy]'overlay=truecommission_type=strategy.commission.percentcommission_value=0.025default_qty_type=strategy.cashdefault_qty_value=10000initial_capital=10000slippage=0)

    // === INPUT BACKTEST RANGE ===
    useDate input(truetitle='---------------- Use Date ----------------')
    FromMonth input.int(defval=7title='From Month'minval=1maxval=12)
    FromDay input.int(defval=25title='From Day'minval=1maxval=31)
    FromYear input.int(defval=2019title='From Year'minval=2017)
    ToMonth input.int(defval=1title='To Month'minval=1maxval=12)
    ToDay input.int(defval=1title='To Day'minval=1maxval=31)
    ToYear input.int(defval=9999title='To Year'minval=2017)
    start timestamp(FromYearFromMonthFromDay0000)  // backtest start window
    finish timestamp(ToYearToMonthToDay2359)  // backtest finish window
    window() =>  // create function "within window of time"
        
    time >= start and time <= finish true false
    // === INPUT BACKTEST RANGE ===


    sources input(defval=closetitle='Source')
    isHA input(false'Use HA Candles')
    heikenashi_1 ticker.heikinashi(syminfo.tickerid)
    security_1 request.security(heikenashi_1timeframe.periodsources)
    src isHA security_1 sources
    // Sampling Period
    // Settings for 5min chart, BTCUSDC. For Other coin, change the paremeters

    per input.int(defval=50minval=1title='Sampling Period')

    // Range Multiplier

    mult input.float(defval=3.0minval=0.1title='Range Multiplier')

    // Smooth Average Range

    smoothrng(xtm) =>
        
    wper 1
        avrng 
    ta.ema(math.abs(x[1]), t)
        
    smoothrng ta.ema(avrngwper) * m
        smoothrng
    smrng 
    smoothrng(srcpermult)

    // Range Filter

    rngfilt(xr) =>
        
    rngfilt x
        rngfilt 
    := nz(rngfilt[1]) ? nz(rngfilt[1]) ? nz(rngfilt[1]) : nz(rngfilt[1]) ? nz(rngfilt[1]) : r
        rngfilt
    filt 
    rngfilt(srcsmrng)

    // Filter Direction

    upward 0.0
    upward 
    := filt filt[1] ? nz(upward[1]) + filt filt[1] ? nz(upward[1])
    downward 0.0
    downward 
    := filt filt[1] ? nz(downward[1]) + filt filt[1] ? nz(downward[1])

    // Target Bands

    hband filt smrng
    lband 
    filt smrng

    // Colors

    filtcolor upward color.lime downward color.red color.orange
    barcolor 
    src filt and src src[1] and upward color.lime src filt and src src[1] and upward color.green src filt and src src[1] and downward color.red src filt and src src[1] and downward color.maroon color.orange

    filtplot 
    plot(filtcolor=filtcolorlinewidth=3title='Range Filter')

    // Target

    hbandplot plot(hbandcolor=color.new(color.aqua100), title='High Target')
    lbandplot plot(lbandcolor=color.new(color.fuchsia100), title='Low Target')

    // Fills

    fill(hbandplotfiltplotcolor=color.new(color.aqua90), title='High Target Range')
    fill(lbandplotfiltplotcolor=color.new(color.fuchsia90), title='Low Target Range')

    // Bar Color

    //barcolor(barcolor)

    // Break Outs 

    longCond bool(na)
    shortCond bool(na)
    longCond := src filt and src src[1] and upward or src filt and src src[1] and upward 0
    shortCond 
    := src filt and src src[1] and downward or src filt and src src[1] and downward 0

    CondIni 
    0
    CondIni 
    := longCond shortCond ? -CondIni[1]
    longCondition longCond and CondIni[1] == -1
    shortCondition 
    shortCond and CondIni[1] == 1

    //Alerts

    plotshape(longConditiontitle='Buy Signal'text='BUY'textcolor=color.new(color.white0), style=shape.labelupsize=size.normallocation=location.belowbarcolor=color.new(color.green0))
    plotshape(shortConditiontitle='Sell Signal'text='SELL'textcolor=color.new(color.white0), style=shape.labeldownsize=size.normallocation=location.abovebarcolor=color.new(color.red0))

    //strategy.entry("Long", strategy.long, stop = hband, when = window() , comment="Long")
    //strategy.entry("Short", strategy.short, stop = lband, when = window() , comment="Short")

    strategy.entry('Long'strategy.longwhen=longCondition and window(), comment='Long')
    strategy.entry('Short'strategy.shortwhen=shortCondition and window(), comment='Short')



    // === Stop LOSS ===
    useStopLoss input(falsetitle='----- Use Stop Loss / Take profit -----')
    sl_inp input.float(100title='Stop Loss %'step=0.25) / 100
    tp_inp 
    input.float(1.5title='Take Profit %'step=0.25) / 100
    stop_level 
    strategy.position_avg_price * (sl_inp)
    take_level strategy.position_avg_price * (tp_inp)
    stop_level_short strategy.position_avg_price * (sl_inp)
    take_level_short strategy.position_avg_price * (tp_inp)
    // === Stop LOSS ===

    if useStopLoss
        strategy
    .exit('Stop Loss/Profit Long''Long'stop=stop_levellimit=take_level)
        
    strategy.exit('Stop Loss/Profit Short''Short'stop=stop_level_shortlimit=take_level_short
    v5 hali...
    Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.

  2. Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.

  3. Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.

  4. Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.

  5. https://tr.tradingview.com/v/r2aZvj57/
    2 farklı uuznluğa.. belirleyeceğiniz 2 farklı oranla...
    range hesaplatıp....sinyal oluşturuyor... v4


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

    //@version=5

    indicator(title='Twin Range Filter'overlay=true)

    source input(defval=closetitle='Source')

    // Smooth Average Range

    per1 input.int(defval=27minval=1title='Fast period')
    mult1 input.float(defval=1.6minval=0.1title='Fast range')

    per2 input.int(defval=55minval=1title='Slow period')
    mult2 input.float(defval=2minval=0.1title='Slow range')

    smoothrng(xtm) =>
        
    wper 1
        avrng 
    ta.ema(math.abs(x[1]), t)
        
    smoothrng ta.ema(avrngwper) * m
        smoothrng
    smrng1 
    smoothrng(sourceper1mult1)
    smrng2 smoothrng(sourceper2mult2)
    smrng = (smrng1 smrng2) / 2

    // Range Filter

    rngfilt(xr) =>
        
    rngfilt x
        rngfilt 
    := nz(rngfilt[1]) ? nz(rngfilt[1]) ? nz(rngfilt[1]) : nz(rngfilt[1]) ? nz(rngfilt[1]) : r
        rngfilt
    filt 
    rngfilt(sourcesmrng)

    upward 0.0
    upward 
    := filt filt[1] ? nz(upward[1]) + filt filt[1] ? nz(upward[1])
    downward 0.0
    downward 
    := filt filt[1] ? nz(downward[1]) + filt filt[1] ? nz(downward[1])

    hband filt smrng
    lband 
    filt smrng

    longCond 
    bool(na)
    shortCond bool(na)
    longCond := source filt and source source[1] and upward or source filt and source source[1] and upward 0
    shortCond 
    := source filt and source source[1] and downward or source filt and source source[1] and downward 0

    CondIni 
    0
    CondIni 
    := longCond shortCond ? -CondIni[1]

    long longCond and CondIni[1] == -1
    short 
    shortCond and CondIni[1] == 1

    // Plotting

    plotshape(longtitle='Long'text='Long'style=shape.labeluptextcolor=color.new(color.black0), size=size.tinylocation=location.belowbarcolor=color.new(color.lime0))
    plotshape(shorttitle='Short'text='Short'style=shape.labeldowntextcolor=color.new(color.white0), size=size.tinylocation=location.abovebarcolor=color.new(color.red0))

    // Alerts

    alertcondition(longtitle='Long'message='Long')
    alertcondition(shorttitle='Short'message='Short'
    bunu algo olarak kullanmak isteyenler için...
    algo...v5 hali....

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

    //@version=5

    strategy(title='Twin Range Filter Algo v.3'shorttitle='Twin Range Strategy'overlay=true)

    source input(defval=closetitle='Source')

    // Smooth Average Range

    per1 input.int(defval=27minval=1title='Fast period'group='Twin Range Filter @colinmck')
    mult1 input.float(defval=1.6minval=0.1title='Fast range'group='Twin Range Filter @colinmck')

    per2 input.int(defval=55minval=1title='Slow period'group='Twin Range Filter @colinmck')
    mult2 input.float(defval=2minval=0.1title='Slow range'group='Twin Range Filter @colinmck')

    smoothrng(xtm) =>
        
    wper 1
        avrng 
    ta.ema(math.abs(x[1]), t)
        
    smoothrng ta.ema(avrngwper) * m
        smoothrng
    smrng1 
    smoothrng(sourceper1mult1)
    smrng2 smoothrng(sourceper2mult2)
    smrng = (smrng1 smrng2) / 2

    // Range Filter

    rngfilt(xr) =>
        
    rngfilt x
        rngfilt 
    := nz(rngfilt[1]) ? nz(rngfilt[1]) ? nz(rngfilt[1]) : nz(rngfilt[1]) ? nz(rngfilt[1]) : r
        rngfilt
    filt 
    rngfilt(sourcesmrng)

    upward 0.0
    upward 
    := filt filt[1] ? nz(upward[1]) + filt filt[1] ? nz(upward[1])
    downward 0.0
    downward 
    := filt filt[1] ? nz(downward[1]) + filt filt[1] ? nz(downward[1])

    hband filt smrng
    lband 
    filt smrng

    longCond 
    bool(na)
    shortCond bool(na)
    longCond := source filt and source source[1] and upward or source filt and source source[1] and upward 0
    shortCond 
    := source filt and source source[1] and downward or source filt and source source[1] and downward 0

    CondIni 
    0
    CondIni 
    := longCond shortCond ? -CondIni[1]

    long longCond and CondIni[1] == -1
    short 
    shortCond and CondIni[1] == 1

    // Plotting

    // Strategy
    // From this part on, programmer is greenmaks9
    //
    Separator input.bool(title='Following conditions and backtest algorithm are added by @greenmask9 🎯, original script is written by @colinmck 👍. Read both of their\'s release notes for more info on how this script works.'defval=falsegroup='Greenmask\'s testing resources & ATR condition')
    disabler input.bool(title='Disable @greenmask9\'s ATR conditions'defval=falsegroup='Greenmask\'s testing resources & ATR condition')

    //second
    l2 input.int(title='ATR1'defval=32minval=1group='ATR condition'tooltip='C: Short-range volatility must be low than long-term volatility measurement for the entry.')
    s2 input.string(title='Smoothing'defval='SMA'options=['RMA''SMA''EMA''WMA'], tooltip='C: Short-range volatility must be low than long-term volatility measurement for the entry.'group='ATR condition')
    atr2(sourcel2) =>
        if 
    s2 == 'SMA'
            
    ta.sma(sourcel2)
        else
            if 
    s2 == 'RMA'
                
    ta.rma(sourcel2)
            else
                if 
    s2 == 'EMA'
                    
    ta.ema(sourcel2)
                else
                    
    ta.wma(sourcel2)

    //third
    l3 input.int(title='ATR2'defval=64minval=1group='ATR condition'tooltip='C: Short-range volatility must be low than long-term volatility measurement for the entry.')
    s3 input.string(title='Smoothing'defval='RMA'options=['RMA''SMA''EMA''WMA'], tooltip='C: Short-range volatility must be low than long-term volatility measurement for the entry.'group='ATR condition')
    atr3(sourcel3) =>
        if 
    s3 == 'RMA'
            
    ta.rma(sourcel3)
        else
            if 
    s3 == 'SMA'
                
    ta.sma(sourcel3)
            else
                if 
    s3 == 'EMA'
                    
    ta.ema(sourcel3)
                else
                    
    ta.wma(sourcel3)

    atr20 atr2(ta.tr(true), l2)
    atr30 atr3(ta.tr(true), l3)

    ordersize math.floor(strategy.initial_capital close)
    maxcandles_till_close input.int(title='Time-based Close'defval=17group='Alternative Exit')
    i_time input.bool(true'Enable Time Base Close'group='Alternative Exit')


    //stop
    varip stop_long 0.0
    varip entry 
    0.0
    varip stop_short 
    0.0
    i_sl_type 
    input.string('Low - (close - lowest low[len]) * %'options=['Low - (ATR[len] * %)''Low - (close - lowest low[len]) * %''Low - (close - average low[len]) * %''Close - (ATR[len] * %)''Low - TicksNumber'], title='Calculation (Long)'group='Stop-loss'tooltip='This is a stop-loss calculation for long positions. Reversed logic is used for short stop-loss. *Calculation Low - TicksNumber doesn\'t use Percentage-based multiplier. **Number of ticks is always substracted (added) after the initial calculation. ')

    i_sl_atr input.int(10'Calculation Length'group='Stop-loss')
    i_sl_perc input.float(80'Percentage'group='Stop-loss') / 100
    i_sl_ticks 
    input.int(defval=10minval=1title='Number of ticks'group='Stop-loss') * syminfo.mintick
    i_stoploss 
    input.bool(true'Enable Stop-loss'group='Stop-loss')

    f_stop_long(calculationlengthmultticks) =>
        
    stop_0 calculation == 'Low - (ATR[len] * %)' low ta.atr(length) * mult ticks calculation == 'Low - (close - lowest low[len]) * %' low - (close ta.lowest(lowlength)) * mult ticks calculation == 'Low - (close - average low[len]) * %' low - (close ta.sma(lowlength)) * mult ticks calculation == 'Close - (ATR[len] * %)' close ta.atr(length) * mult ticks low ticks
        stop_0
    f_stop_short
    (calculationlengthmultticks) =>
        
    stop_0 calculation == 'Low - (ATR[len] * %)' high ta.atr(length) * mult ticks calculation == 'Low - (close - lowest low[len]) * %' high math.abs(close ta.lowest(highlength)) * mult ticks calculation == 'Low - (close - average low[len]) * %' high math.abs(close ta.sma(highlength)) * mult ticks calculation == 'Close - (ATR[len] * %)' close ta.atr(length) * mult ticks high ticks
        stop_0

    //target
    varip target_long 0.0
    varip target_short 
    0.0
    i_tr_type 
    input.string('Close + (ATR[len] * %)'options=['High + (ATR[len] * %)''Close + (ATR[len] * %)''Close + abs(close - highest high[len]) * %''Close + abs(close - average high[len]) * %''High + TicksNumber''Close + TicksNumber'], title='Calculation (Long)'group='Target'tooltip='Raw number of ticks is always added to the target.')
    i_tr_atr input.int(10'Calculation Length'group='Target')
    i_tr_perc input.float(500'Percentage'group='Target') / 100
    i_tr_ticks 
    input.int(defval=10minval=1title='Number of ticks'group='Target') * syminfo.mintick
    i_target 
    input.bool(true'Enable Target'group='Target')

    f_target_long(calculationlengthmultticks) =>
        
    stop_0 calculation == 'High + (ATR[len] * %)' high ta.atr(length) * mult ticks calculation == 'Close + (ATR[len] * %)' close ta.atr(length) * mult ticks calculation == 'Close + abs(close - highest high[len]) * %' close math.abs(close ta.highest(highlength)) * mult ticks calculation == 'Close + abs(close - average high[len]) * %' close math.abs(close ta.sma(highlength)) * mult ticks calculation == 'High + TicksNumber' high ticks close ticks
        stop_0
    f_target_short
    (calculationlengthmultticks) =>
        
    stop_0 calculation == 'High + (ATR[len] * %)' low ta.atr(length) * mult ticks calculation == 'Close + (ATR[len] * %)' close ta.atr(length) * mult ticks calculation == 'Close + abs(close - highest high[len]) * %' close math.abs(close ta.lowest(lowlength)) * mult ticks calculation == 'Close + abs(close - average high[len]) * %' close math.abs(close ta.sma(lowlength)) * mult ticks calculation == 'High + TicksNumber' low ticks close ticks
        stop_0





    if strategy.position_size >= or strategy.position_size[1] != strategy.position_size
        stop_short 
    := i_stoploss f_stop_short(i_sl_typei_sl_atri_sl_perci_sl_ticks) : na
        target_short 
    := i_target f_target_short(i_tr_typei_tr_atri_tr_perci_tr_ticks) : na
        target_short


    if strategy.position_size <= or strategy.position_size[1] != strategy.position_size
        stop_long 
    := i_stoploss f_stop_long(i_sl_typei_sl_atri_sl_perci_sl_ticks) : na
        target_long 
    := i_target f_target_long(i_tr_typei_tr_atri_tr_perci_tr_ticks) : na
        target_long


    if strategy.position_size == or strategy.position_size[1] != strategy.position_size
        entry 
    := open
        entry






    bull 
    long and (atr20 atr30 or disabler)
    bear short and (atr20 atr30 or disabler)

    bullclock ta.barssince(bull)
    bearclock ta.barssince(bear)

    if 
    bull
        strategy
    .entry('Twin Long'strategy.longordersize)

    strategy.exit('Exit'from_entry='Twin Long'limit=target_longstop=stop_long)

    if 
    bear
        strategy
    .entry('Twin Short'strategy.shortordersize)

    strategy.exit('Exit'from_entry='Twin Short'limit=target_shortstop=stop_short)


    i_message_long input.string('Long entry default message: x''Long Entry Alert Message'group='Alert')
    i_long_alert input.bool(true'Enable Long Alert'group='Alert')
    i_message_short input.string('Long entry default message: x''Short Entry Alert Message'group='Alert')
    i_short_alert input.bool(true'Enable Short Alert'group='Alert')

    if 
    bull and strategy.position_size[1] == and i_long_alert
        alert
    (i_message_longalert.freq_once_per_bar_close)
    if 
    bear and strategy.position_size[1] == and i_short_alert
        alert
    (i_message_shortalert.freq_once_per_bar_close)


    //time stoploss
    if i_time
        strategy
    .close('Twin Long'when=bullclock == maxcandles_till_closecomment='Time')
        
    strategy.close('Twin Short'when=bearclock == maxcandles_till_closecomment='Time')



    c_fill_stop color.new(color.red90)
    c_fill_target color.new(color.green90)

    p_longstop plot(strategy.position_size and i_stoploss stop_long nalinewidth=2color=color.new(color.red0), style=plot.style_linebr)
    p_shortstop plot(strategy.position_size and i_stoploss stop_short nalinewidth=2color=color.new(color.red0), style=plot.style_linebr)
    p_entry plot(strategy.position_size != entry nalinewidth=2color=color.new(color.blue0), style=plot.style_linebr)

    p_longtarget plot(strategy.position_size and i_target target_long nalinewidth=2color=color.new(color.green0), style=plot.style_linebr)
    p_shorttarget plot(strategy.position_size and i_target target_short nalinewidth=2color=color.new(color.green0), style=plot.style_linebr)

    fill(p_entryp_longstopc_fill_stop)
    fill(p_entryp_shortstopc_fill_stop)

    fill(p_entryp_longtargetc_fill_target)
    fill(p_entryp_shorttargetc_fill_target
    Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.

  6. https://tr.tradingview.com/v/r9iTBjn1/
    değişik bir imza kodu...

    https://tr.tradingview.com/v/Bwd3wDPL/
    linear bakış için kullanılabilecek bir kod....
    Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.



  7. range hesaplamalrı ile tasarlanmmış sade ve agresif bir sistem oldu...
    z score ile hedefleme yapıldı...
    Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.

  8. btcusdt ye farklı sistemlerle günlükte bakış açıları....





    Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.

Sayfa 212/272 İlkİlk ... 112162202210211212213214222262 ... 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
  •