Sayfa 268/275 İlkİlk ... 168218258266267268269270 ... SonSon
Arama sonucu : 2196 madde; 2,137 - 2,144 arası.

Konu: Tradingview

  1. üstteki iki kod birleştirilse böyle olacak...https://www.tradingview.com/x/DpgfhfVW/
    16.07.2024 - 10.12.2024

  2. https://tr.tradingview.com/v/md0PV7Yo/ kurgusu güzel....değerlerde oynama yapmak lazım...
    16.07.2024 - 10.12.2024

  3. yazılan kodlar....birleşince ortaya çıkan.... https://www.tradingview.com/x/Sxc4HTvB/

    denemek isteyene....

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

    //@version=5
    indicator("."overlay true)

    atrPeriod input.int(10title="ATR Length"tooltip="Specifies the period over which the Average True Range (ATR) is calculated."minval=1)
    factor input.float(9.9title="Factor"tooltip="Multiplier factor for the ATR to define the distance of the Supertrend line from the price."minval=0.1step=0.1)
    upColor input.color(color.rgb(122,244,122), title="Up Color"tooltip="Color for the Supertrend line when the trend is upwards or bullish.")
    downColor input.color(color.rgb(244,122,122), title="Down Color"tooltip="Color for the Supertrend line when the trend is downwards or bearish.")

    // Add switchers
    showLabel input.bool(truetitle="Show Label"tooltip="Toggle to show or hide labels indicating statistical metrics like win rate and expected return.")
    showTable input.bool(falsetitle="Show Table"tooltip="Toggle to show or hide the interactive table summarizing key metrics.")
    showLine input.bool(falsetitle="Show Line"tooltip="Toggle to show or hide the Supertrend lines on the chart.")

    [
    supertrenddirection] = ta.supertrend(factoratrPeriod)

    // Lists to store durations and percentage changes for up and down trends
    var int[] durations_up_win = array.new_int(0)
    var 
    int[] durations_up_loss = array.new_int(0)
    var 
    int[] durations_down_win = array.new_int(0)
    var 
    int[] durations_down_loss = array.new_int(0)

    var 
    float[] pct_changes_up_win = array.new_float(0)
    var 
    float[] pct_changes_up_loss = array.new_float(0)
    var 
    float[] pct_changes_down_win = array.new_float(0)
    var 
    float[] pct_changes_down_loss = array.new_float(0)

    // Additional arrays to store max running profit for uptrend and min running profit for downtrend
    var float[] pct_changes_up_max = array.new_float(0)
    var 
    float[] pct_changes_down_min = array.new_float(0)

    // Track the starting bar and price of the current trend
    var int startBar na
    var float startPrice na

    // Track max running profit for uptrend and min running profit for downtrend
    var float max_up na
    var float min_down na

    float pct_change 
    = (close startPrice) - 1

    // Tracking max and min running profits for the current trend
    if (direction[1] < 0// Uptrend
        
    max_up := math.max(nz(max_up), pct_change)
    else
        
    min_down := math.min(nz(min_down), pct_change)

    if (
    direction != direction[1])
        if (
    na(startBar) == false)
            if (
    direction[1] < 0// Uptrend
                
    array.push(pct_changes_up_maxmax_up)
                if (
    pct_change 0// Win scenario for uptrend
                    
    array.push(pct_changes_up_winpct_change)
                    array.
    push(durations_up_winbar_index startBar)
                else 
    // Loss scenario for uptrend
                    
    array.push(pct_changes_up_losspct_change)
                    array.
    push(durations_up_lossbar_index startBar)
            else  
    // Downtrend
                
    array.push(pct_changes_down_minmin_down)
                if (
    pct_change 0// Win scenario for downtrend
                    
    array.push(pct_changes_down_winpct_change)
                    array.
    push(durations_down_winbar_index startBar)
                else 
    // Loss scenario for downtrend
                    
    array.push(pct_changes_down_losspct_change)
                    array.
    push(durations_down_lossbar_index startBar)
                    
    // Reset max and min values when the direction changes
        
    max_up := na
        min_down 
    := na

        
    // Start of new trend
        
    startBar := bar_index
        startPrice 
    := close

    // Calculate average durations for up and down trends
    avg_duration_up_win bar_index + array.avg(durations_up_win)
    avg_duration_up_loss bar_index + array.avg(durations_up_loss)
    avg_duration_down_win bar_index + array.avg(durations_down_win)
    avg_duration_down_loss bar_index + array.avg(durations_down_loss)

    // Calculate average percentage changes for wins and losses
    float avg_pct_change_up_win = array.avg(pct_changes_up_win)
    float avg_pct_change_up_loss = array.avg(pct_changes_up_loss)
    float avg_pct_change_down_win = array.avg(pct_changes_down_win)
    float avg_pct_change_down_loss = array.avg(pct_changes_down_loss)

    // Calculate the average max percentage change for uptrends and the average min percentage change for downtrends
    float avg_max_pct_change_up = array.avg(pct_changes_up_max)
    float avg_min_pct_change_down = array.avg(pct_changes_down_min)

    avg_pct_up_win close * (avg_pct_change_up_win)
    avg_pct_up_loss close * (avg_pct_change_up_loss)
    avg_pct_down_win close * (avg_pct_change_down_win)
    avg_pct_down_loss close * (avg_pct_change_down_loss)

    // Calculate win rates
    float win_rate_up = array.size(pct_changes_up_win) / (array.size(pct_changes_up_win) + array.size(pct_changes_up_loss))
    float win_rate_down = array.size(pct_changes_down_win) / (array.size(pct_changes_down_win) + array.size(pct_changes_down_loss))

    // Calculate expected returns
    float expected_return_up win_rate_up avg_pct_change_up_win + (win_rate_up) * avg_pct_change_up_loss
    float expected_return_down 
    win_rate_down avg_pct_change_down_win + (win_rate_down) * avg_pct_change_down_loss

    // Draw the lines for win and loss scenarios and display win rate and expected return
    if (direction != direction[1])
        
    label_text_up "WR:" str.tostring(win_rate_up 100"#.#") + "% / ER:" str.tostring(expected_return_up 100"#.#") + "%\nEW:" str.tostring(avg_pct_change_up_win 100"#.#") + "% / EL:" str.tostring(avg_pct_change_up_loss 100"#.#") + "%"
        
    label_text_down "WR:" str.tostring(win_rate_down 100"#.#") + "% / ER:" str.tostring(expected_return_down 100"#.#") + "%\nEW:" str.tostring(avg_pct_change_down_win 100"#.#") + "% / EL:" str.tostring(avg_pct_change_down_loss 100"#.#") + "%"

        
    if (direction 0// Uptrend
            
    if showLine
                line
    .new(x1=startBary1=startPricex2=avg_duration_up_winy2=avg_pct_up_winwidth=1color=upColorstyle=line.style_dashed)
                
    line.new(x1=startBary1=startPricex2=avg_duration_up_lossy2=avg_pct_up_losswidth=1color=downColorstyle=line.style_dashed)
            if 
    showLabel
                
    // Add label for win rate, expected return, and average percentage changes
                
    label.new(x=startBary=supertrend text=label_text_upstyle=label.style_label_upcolor=upColor)
        else 
    // Downtrend
            
    if showLine
                line
    .new(x1=startBary1=startPricex2=avg_duration_down_winy2=avg_pct_down_winwidth=1color=downColorstyle=line.style_dashed)
                
    line.new(x1=startBary1=startPricex2=avg_duration_down_lossy2=avg_pct_down_losswidth=1color=upColorstyle=line.style_dashed)
            if 
    showLabel
                
    // Add label for win rate, expected return, and average percentage changes
                
    label.new(x=startBary=supertrendtext=label_text_downstyle=label.style_label_downcolor=downColor)

    if 
    showTable
        
    // Create a table with 3 columns and 4 rows in the top right corner of the chart
        
    var table t table.new(position position.top_rightcolumns 3rows 4bgcolor color.new(color.gray90))

        
    // Update the table data each bar with the latest metrics
        // Define the text to be displayed in the cells
        
    string wr_text_up str.tostring(win_rate_up 100"#.#") + "%"
        
    string er_text_up str.tostring(expected_return_up 100"#.#") + "%"
        
    string ew_text_up str.tostring(avg_pct_change_up_win 100"#.#") + "%"
        
    string el_text_up str.tostring(avg_pct_change_up_loss 100"#.#") + "%"

        
    string wr_text_down str.tostring(win_rate_down 100"#.#") + "%"
        
    string er_text_down str.tostring(expected_return_down 100"#.#") + "%"
        
    string ew_text_down str.tostring(avg_pct_change_down_win 100"#.#") + "%"
        
    string el_text_down str.tostring(avg_pct_change_down_loss 100"#.#") + "%"

        
    // Update the table every bar, so the table always displays the latest metrics
        
    table.cell(t00"WR:"bgcolor=color.silver)
        
    table.cell(t10wr_text_upbgcolor=upColor)
        
    table.cell(t20wr_text_downbgcolor=downColor)

        
    table.cell(t01"ER:"bgcolor=color.silver)
        
    table.cell(t11er_text_upbgcolor=upColor)
        
    table.cell(t21er_text_downbgcolor=downColor)

        
    table.cell(t02"EW:"bgcolor=color.silver)
        
    table.cell(t12ew_text_upbgcolor=upColor)
        
    table.cell(t22ew_text_downbgcolor=downColor)

        
    table.cell(t03"EL:"bgcolor=color.silver)
        
    table.cell(t13el_text_upbgcolor=upColor)
        
    table.cell(t23el_text_downbgcolor=downColor)

    plot(direction supertrend na"Up Trend"color upColorstyle plot.style_linebr)
    plot(direction supertrend na"Down Trend"color downColorstyle plot.style_linebr)
    ////
    //@version=5

    wicks input(true"Take Wicks into Account?")
    highlightState input(true"Highlight State?")

    ma(sourcelengthtype) =>
        
    type == "SMA" ta.sma(sourcelength) :
         
    type == "EMA" ta.ema(sourcelength) :
         
    type == "SMMA (RMA)" ta.rma(sourcelength) :
         
    type == "WMA" ta.wma(sourcelength) :
         
    type == "VWMA" ta.vwma(sourcelength) :
         
    na

    show_ma1   
    input(true   "MA High"inline="MA #1"group="Channel №1")
    ma1_type   input.string("SMA"  ""     inline="MA #1"options=["SMA""EMA""SMMA (RMA)""WMA""VWMA"], group="Channel №1")
    ma1_source input(high  ""     inline="MA #1"group="Channel №1")
    ma1_length input.int(50     ""     inline="MA #1"minval=1group="Channel №1")
    ma1_color  input(color.green""     inline="MA #1"group="Channel №1")
    ma1 ta.ema(ma1_sourcema1_length)

    show_ma2   input(true   "MA Low"inline="MA #2"group="Channel №1")
    ma2_type   input.string("SMA"  ""     inline="MA #2"options=["SMA""EMA""SMMA (RMA)""WMA""VWMA"], group="Channel №1")
    ma2_source input(low  ""     inline="MA #2"group="Channel №1")
    ma2_length input.int(200     ""     inline="MA #2"minval=1group="Channel №1")
    ma2_color  input(color.red""     inline="MA #2"group="Channel №1")
    ma2 ta.ema(ma2_sourcema2_length)
    showLabels1 input(true"Show Buy/Sell Labels?"group="Channel №1")

    show_ma3   input(true   "MA High"inline="MA #3"group="Channel №2")
    ma3_type   input.string("WMA"  ""     inline="MA #3"options=["SMA""EMA""SMMA (RMA)""WMA""VWMA"], group="Channel №2")
    ma3_source input(high  ""     inline="MA #3"group="Channel №2")
    ma3_length input.int(50    ""     inline="MA #3"minval=1group="Channel №2")
    ma3_color  input(color.orange""     inline="MA #3"group="Channel №2")
    ma3 ma(ma3_sourcema3_lengthma3_type)

    show_ma4   input(true   "MA Low"inline="MA #4"group="Channel №2")
    ma4_type   input.string("WMA"  ""     inline="MA #4"options=["SMA""EMA""SMMA (RMA)""WMA""VWMA"], group="Channel №2")
    ma4_source input(low  ""     inline="MA #4"group="Channel №2")
    ma4_length input.int(200    ""     inline="MA #4"minval=1group="Channel №2")
    ma4_color  input(color.blue""     inline="MA #4"group="Channel №2")
    ma4 ma(ma4_sourcema4_lengthma4_type)
    showLabels2 input(true"Show Buy/Sell Labels?"group="Channel №2")

    Hlv1 float(na)
    Hlv1 := (wicks high close) > ma1 : (wicks low close) < ma2 ? -Hlv1[1]
    sslUp1   Hlv1 ma2 ma1
    sslDown1 
    Hlv1 ma1 ma2

    Color1 
    Hlv1 == ma1_color ma2_color
    fillColor1 
    highlightState ? (color.new(Color190)) : na

    highLine1 
    plot(show_ma1 sslUp1 natitle="UP"linewidth=2color Color1)
    lowLine1 plot(show_ma2 sslDown1 natitle="DOWN"linewidth=2color Color1)

    // Hide labels above MA
    buySignal1 show_ma1 and showLabels1 and Hlv1 == and Hlv1[1] == -1
    sellSignal1 
    show_ma2 and showLabels1 and Hlv1 == -and Hlv1[1] == 1
    plotshape
    (buySignal1 and close ta.ema(close20), title="Buy Label"text="Buy"location=location.belowbarstyle=shape.labelupsize=size.tinycolor=Color1textcolor=color.white)
    plotshape(sellSignal1 and close ta.ema(close20), title="Sell Label"text="Sell"location=location.abovebarstyle=shape.labeldownsize=size.tinycolor=Color1textcolor=color.white)

    //fill(highLine1, lowLine1, color = fillColor1)

    Hlv2 float(na)
    Hlv2 := (wicks high close) > ma3 : (wicks low close) < ma4 ? -Hlv2[1]
    sslUp2   Hlv2 ma4 ma3
    sslDown2 
    Hlv2 ma3 ma4

    Color2 
    Hlv2 == ma3_color ma4_color
    fillColor2 
    highlightState ? (color.new(Color290)) : na

    highLine2 
    plot(show_ma3 sslUp2 natitle="UP"linewidth=2color Color2)
    lowLine2 plot(show_ma4 sslDown2 natitle="DOWN"linewidth=2color Color2)

    // Hide labels below MA
    buySignal2 show_ma3 and showLabels2 and Hlv2 == and Hlv2[1] == -1
    sellSignal2 
    show_ma4 and showLabels2 and Hlv2 == -and Hlv2[1] == 1
    plotshape
    (buySignal2 and close ta.ema(close200), title="Buy Label"text="Buy"location=location.belowbarstyle=shape.labelupsize=size.tinycolor=Color2textcolor=color.white)
    plotshape(sellSignal2 and close ta.ema(close200), title="Sell Label"text="Sell"location=location.abovebarstyle=shape.labeldownsize=size.tinycolor=Color2textcolor=color.white)

    //fill(highLine2, lowLine2, color = fillColor2)
    ////
    //@version=5


    /////////GENIAL LINE
    mostrarGenial input(truetitle='Mostrar genial line')
    src input(close)
    genial input(32title='32')
    pgenial ta.sma(srcgenial)
    genialplot plot(mostrarGenial pgenial nacolor=color.rgb(368247), style=plot.style_cross, ****=falselinewidth=2title='32')
    /////////FIN GENIAL LINE


    //////ZONA DE CORRECION
    ema8 ta.ema(srcinput(8,title='8'))


    ///////WILDER 8
    f_wwma(lp) =>
        
    wwma 0.
        wwma 
    := (nz(wwma[1]) * (1) + p) / l




    wilder8 
    f_wwma(8close)
    // ///// FIN WILDER 8


    fill_color ema8wilder8 color.new(#09ee11, 100) : color.new(#f70202, 100)
    plotema8 plot(ema8,color=fill_colorlinewidth=1,title='8')
    plotwilder8 plot(wilder8,color=color.rgb(2522483), linewidth=1,style=plot.style_circles,title='8')


    //  ////// Colorear el fondo entre las EMAs




    //fill(plotema8,plotwilder8,color=fill_color,title ='TUNEL DE CORRECCION',editable = true)


    ///////FIN ZONA DE CORRECION


    /////TUNEL DOMENEC


    ema123 input(123,title='EMA-123')
    ema188 input(188,title='EMA-188')


    ema416 input(416,title='EMA-416')
    ema618 input(618,title='EMA-618')


    ema882 input(882,title='EMA-882')
    ema1223 input(1223,title='EMA-1223')


    pema123 ta.ema(srcema123)
    pema188 ta.ema(srcema188)
    pema416 ta.ema(srcema416)
    pema618 ta.ema(srcema618)
    pema882 ta.ema(srcema882)
    pema1223 ta.ema(srcema1223)


    //cinta1 = plot(pema123,title='EMA-123 TUNEL 1',color=color.blue, linewidth=1,editable = true)
    //cinta1_1 = plot(pema188,title='EMA 188 TUNEL 1',color=color.blue, linewidth=1,editable = true)
    //cinta2 = plot(pema416,title='EMA-416 TUNEL 2',color=color.yellow,  linewidth=1,editable = true)
    //cinta2_1 = plot(pema618,title='EMA 618 TUNEL 2',color=color.yellow, linewidth=1,editable = true)
    //cinta3 = plot(pema882,title='EMA-882 TUNEL 3', color=#FF1493, linewidth=1,editable = true)
    //cinta3_1 = plot(pema1223,title='EMA 1223 TUNEL 3', color=#FF1493,  linewidth=1,editable = true)


    //fill(cinta1,cinta1_1,color.new(color.blue,transp = 75),title='COLOR TUNEL 1', editable=true)
    //fill(cinta2,cinta2_1,color.new(color.yellow,transp=75),title='COLOR TUNEL 2', editable=true)
    //fill(cinta3,cinta3_1,color.new(color=#FF1493,  transp=75),title='COLOR TUNEL 3', editable=true)




    //////FIN TUNEL DOMENEC 
    16.07.2024 - 10.12.2024

  4. https://tr.tradingview.com/script/fxfvw13G/ örnek...https://www.tradingview.com/x/bbjULpmk/ stil ayarından tüm çizgileri kaldırılmış....sadece label sinyaller bırakılmış hali....

    bu da diğer komutları.... https://tr.tradingview.com/u/bistati...lished-scripts
    16.07.2024 - 10.12.2024

  5. https://tr.tradingview.com/script/gR...icks-Dont-Lie/

    ilginç hesaplaması var ama....bist bakıldığında....https://www.tradingview.com/x/ffP8caJX/
    kod hesaplamalarında oynama yapılması gerekir....yoksa anlamsız....
    16.07.2024 - 10.12.2024

  6. https://tr.tradingview.com/script/5i...mic-Sine-Wave/
    örnek yinelenmiş 5-20 uzunluktur...
    https://www.tradingview.com/x/0KbEtsyF/ kullanırken...

    örneğin...20 uzunluktaki kırmızının...tabanının 7200 ler olduğunu... düşünün....

    değerleri değiştirerek...bu tarz bir kullanım olabilir...
    16.07.2024 - 10.12.2024


  7. https://tr.tradingview.com/script/vE...Lines-LuxAlgo/
    trend çizgileri çekmek için....
    16.07.2024 - 10.12.2024

Sayfa 268/275 İlkİlk ... 168218258266267268269270 ... 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
  •