Tradingview scriptlerim

Her yerde bulunmayan, stratejiye bağlı kalındığında ise çok yüksek miktarlarda kar bırakan ve bir çok indikatörü bir araya getiren scriptlerim.

TopSellButtonBuy

//@version=4
strategy("TopSellButtonBuy", overlay=true)
length_1 = input(12)
length_2 = input(30)
check = input(24*60)
lot = input(1000)
min_win = input(0.01)
h = highest(check)
l = lowest(check)
m = (h+l)/2
ema1 = ema(close, length_1)
ema2 = ema(close, length_2)
plot(ema1, title ='EMA1', color= color.blue, linewidth = 1)
plot(ema2, title ='EMA2', color= color.orange, linewidth = 2)

plot(m, title='Middle_line', color=color.yellow, linewidth=1)
plot(h, title='Highest_line', color=color.red, linewidth=2)
plot(l, title='Lowest_line', color=color.green, linewidth=2)
// işleme giriş karar ağacı

direction = open - ema1
threshold = input(0.75)
buylimit = m - (m-l)*threshold 
selllimit = (h-m)*threshold + m
plot(selllimit, title='Highest_line', color=color.red, linewidth=1)
plot(buylimit, title='Lowest_line', color=color.green, linewidth=1)


if open > selllimit and direction < 0
    strategy.close("buy")
    strategy.entry("sell", strategy.short, lot)
if open < buylimit and direction > 0
    strategy.close("sell")
    strategy.entry("buy", strategy.long, lot)
    
    
if close >= m and ema1 <= ema2
    strategy.close("buy")

if close <= m and ema1 >= ema2
    strategy.close("sell")

MACD Strateji

//@version=4
strategy("MACD Strateji", overlay=true, pyramiding=10, calc_on_order_fills = true)
// Getting inputs
fast_length = input(title="Fast Length", type=input.integer, defval=12)
slow_length = input(title="Slow Length", type=input.integer, defval=26)
delay = input(3)
src = input(title="Source", type=input.source, defval=close)
signal_length = input(title="Signal Smoothing", type=input.integer, minval = 1, maxval = 50, defval = 9)
sma_source = input(title="Simple MA(Oscillator)", type=input.bool, defval=true)
sma_signal = input(title="Simple MA(Signal Line)", type=input.bool, defval=false)

ifsell = input(title="ifsell", type=input.bool, defval=true)
ifbuy = input(title="ifbuy", type=input.bool, defval=false)

baselot = input(title = "lot (times of 0.1 lot)",  type = input.integer, minval = 1, defval = 1)
base_lot = 1000 * baselot

// Plot colors
col_grow_above = #26A69A
col_grow_below = #FFCDD2
col_fall_above = #B2DFDB
col_fall_below = #EF5350
col_macd = #0094ff
col_signal = #ff6a00
// Calculating
fast_ma = sma_source ? sma(src, fast_length) : ema(src, fast_length)
slow_ma = sma_source ? sma(src, slow_length) : ema(src, slow_length)
macd = fast_ma - slow_ma
signal = sma_signal ? sma(macd, signal_length) : ema(macd, signal_length)
hist = macd - signal
// plot(hist, title="Histogram", style=plot.style_columns, color=(hist>=0 ? (hist[1] < hist ? col_grow_above : col_fall_above) : (hist[1] < hist ? col_grow_below : col_fall_below) ), transp=0 )
// plot(macd, title="MACD", color=col_macd, transp=0)
// plot(signal, title="Signal", color=col_signal, transp=0)



lot = if (strategy.openprofit >= 0)
    base_lot
else
    (strategy.opentrades)* base_lot

safeline = input(0)
safe_line = safeline/100.0

if (ifbuy)
    if (crossover(hist, 0) and (macd < -safe_line))
    	strategy.order("MacdLE", strategy.long, lot, comment="MacdLE")
    	l = label.new(bar_index, na)
        label.set_text(l, tostring(macd))
        label.set_color(l, color.red)
        label.set_yloc(l, yloc.belowbar)
        label.set_style(l, label.style_labelup)
    if ((hist < hist[delay]) and (strategy.position_avg_price < close))
        strategy.close("MacdLE")
    if ((hist < hist[delay]) and (strategy.position_avg_price > close))
        l = label.new(bar_index, na)
        label.set_text(l, "Exit")
        label.set_color(l, color.green)
        label.set_yloc(l, yloc.belowbar)
        label.set_style(l, label.style_labelup)
    // strategy.entry("MacdLE", strategy.long, when = close < lowest(slow_length), comment="MacdLE")
if (ifsell)
    if (crossunder(hist, 0) and (macd > safe_line))
    	strategy.order("MacdSE", strategy.short, lot, comment="MacdSE")
    if ((hist > hist[delay]) and (strategy.openprofit > 0))
        strategy.close("MacdSE")
    if ((hist > hist[delay]) and (strategy.position_avg_price < close))
        l = label.new(bar_index, na)
        label.set_text(l, "Exit")
        label.set_color(l, color.green)
        label.set_yloc(l, yloc.belowbar)
        label.set_style(l, label.style_labelup)

    // strategy.entry("MacdSE", strategy.short, when = close < lowest(slow_length), comment="MacdSE")

ADX14

//@version=4
study("ADX_40", shorttitle="ADX", format=format.price, precision=2, resolution="")

fastlength = input(12)
slowlength = input(36)
levelline = input(40)

adxlen = input(14, title="ADX Smoothing")
dilen = input(14, title="DI Length")
dirmov(len) =>
	up = change(high)
	down = -change(low)
	plusDM = na(up) ? na : (up > down and up > 0 ? up : 0)
	minusDM = na(down) ? na : (down > up and down > 0 ? down : 0)
	truerange = rma(tr, len)
	plus = fixnan(100 * rma(plusDM, len) / truerange)
	minus = fixnan(100 * rma(minusDM, len) / truerange)
	[plus, minus]
adx(dilen, adxlen) =>
	[plus, minus] = dirmov(dilen)
	sum = plus + minus
	adx = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), adxlen)
sig = adx(dilen, adxlen)

plot(sig, color=color.red, title="ADX")
plot(levelline, color=color.yellow, title="40Level")

5 adet indikatörü tek çatı altında toplayan script;

1- Dual Thrust Trading Algorithm
2- Semafore
3- Halftrend
4- Nick Rypock Trailing Reverse
5- Tweezer and Kangaroo Tail

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

//@version=4
study("Five-in-one Strategy", '', true)

// Description:

// This is a five-in-one strategy using:
//     Dual Thrust Trading Algorithm © capissimo
//     Semafore                      © DevLucem 
//     Halftrend                     © everget 
//     Nick Rypock Trailing Reverse  © everget 
//     Tweezer and Kangaroo Tail     © LonesomeTheBlue

// Anyone of the indicators can be switched off.

//-------------------- Inputs

ftype = input('None', 'Filter Signals by', options=['Volatility','Volume','Both','None'])

dtta  = input(true,  '===Dual Thrust Trading Algo===')
ds    = input(close, "Dataset")
algo  = input(2,     "Use DTTA algorithm #:",        options=[1, 2])
mlen  = input(4,     "DTTA Lag M",                   minval=1) 
nlen  = input(20,    "DTTA Lag N",                   minval=1) 
k     = input(0.5,   "DTTA Coeff",                   minval=0.01, step=0.01) // .7, .9
disc  = input(0.5,   "DTTA Coeff Trending Discount", minval=0.01, step=0.01) // . 5, .6

//-------------------- System Variables

var BUY  =  1
var SELL = -1
var HOLD =  0

//-------------------- Dynamic Arrays

var signal = 0

//-------------------- Custom Functions

volumeBreak(thres) =>  
    rsivol   = rsi(volume, 14)  
    osc      = hma(rsivol, 10)  
    osc > thres                     

volatilityBreak(volmin, volmax) => atr(volmin) > atr(volmax)

dtta1_algo(k1, k2, len) =>
    hh = highest(high, len)[1]
    hc = highest(ds, len)[1]
    lc = lowest(ds, len)[1]
    ll = lowest(low, len)[1]
    
    // The range is calculated based on the close, high and low over the most recent N-periods.  
    // Trade is made when the market moves a certain range from the opening price. 
    range = max(hh - lc, hc - ll)
    [open + k1 * range, open - k2 * range] 
    
dtta2_algo(k1, k2, ml, nl) =>
    hh = 0.0, ll = 0.0, hc = 0.0, lc = 0.0

    hh := highest(high, ml)[1]
    hc := highest(ds, ml)[1]
    lc := lowest(ds, ml)[1]
    ll := lowest(low, ml)[1]
    
    sellRange = (hh - lc) >= (hc - ll) ? hh - lc : hc - ll
    
    hh := highest(high, nl)[1]
    hc := highest(ds, nl)[1]
    lc := lowest(ds, nl)[1]
    ll := lowest(low, nl)[1]
    
    buyRange = (hh - lc) >= (hc - ll) ? hh - lc : hc - ll
    [open + k1 * buyRange, open - k2 * sellRange] 
    
//-------------------- Logic

tbase   = (time - time[1]) / 1000
tcurr   = (timenow - time_close[1]) / 1000
barlife = tcurr / tbase

filter =   ftype=='Volatility' ? volatilityBreak(1, 10) 
         : ftype=='Volume'     ? volumeBreak(49) 
         : ftype=='Both'       ? volatilityBreak(1, 10) and volumeBreak(49)
         :                       true

// Bullish/Bearish Identification
rng     = close - open
doji    = rng == 0 
uptrend = rng > 0 or doji and rng[1] > 0
dntrend = rng < 0 or doji and rng[1] < 0

k1 = k, k2 = k
if uptrend  // Assigned empirically. To be optimized separately
    k1 := k1 * disc  //.2
    k2 := k2 * (1 + disc)
if dntrend
    k1 := k1 * (1 + disc)
    k2 := k2 * disc //.2

[bt1, st1] = dtta1_algo(k1, k2, mlen)
[bt2, st2] = dtta2_algo(k1, k2, mlen, nlen)

buyTrigger = 0.0, sellTrigger = 0.0
if algo == 1 
    buyTrigger := bt1, sellTrigger := st1
else    
    buyTrigger := bt2, sellTrigger := st2

signal := ds >= buyTrigger and uptrend and filter ? BUY : ds <= sellTrigger and dntrend and filter ? SELL : nz(signal[1])  

startLongTrade  = change(signal) and signal==BUY  
startShortTrade = change(signal) and signal==SELL 
endLongTrade    = change(signal) and signal==SELL
endShortTrade   = change(signal) and signal==BUY 

//------------------ Rendering

plotshape(dtta and startLongTrade  ? low   : na, 'Buy',  shape.labelup,   location.belowbar, color.blue, 30, size=size.tiny)
plotshape(dtta and startShortTrade ? high  : na, 'Sell', shape.labeldown, location.abovebar, color.red,  30, size=size.tiny)
plot(dtta and endLongTrade         ? ohlc4 : na, 'StopBuy',  color.blue, 2, plot.style_cross)
plot(dtta and endShortTrade        ? ohlc4 : na, 'StopSell', color.red,  2, plot.style_cross)

//================== Semafore © DevLucem 

semafore = input(true,  '===Semafore===')
repaint  = input(false, "Allow Drawing of an Unconfirmed Signal")

zigzag(Depth, Deviation, Size) =>
    var lw = 1, var hg = 1
    lw := lw + 1, hg := hg + 1
    p_lw = -lowestbars(Depth), p_hg = -highestbars(Depth)
    lowing = lw == p_lw or low - low[p_lw] > Deviation*syminfo.mintick
    highing = hg == p_hg or high[p_hg] - high > Deviation*syminfo.mintick
    lh = barssince(not highing), ll = barssince(not lowing)
    down = lh > ll, lower = low[lw] > low[p_lw], higher = high[hg] < high[p_hg]
    if lw != p_lw and (not down[1] or lower)
        lw := p_lw < hg ? p_lw : 0
    if hg != p_hg and (down[1] or higher)
        hg := p_hg < lw ? p_hg : 0
    x1  = down ? lw : hg
    y1  = down ? low[lw] : high[hg]
    label point = na
    if semafore and repaint and filter
        point := label.new(bar_index-x1, y1, color=down ? color.green : color.red, style=down ? label.style_label_up : label.style_label_down, size=Size)
        if down == down[1]
            label.delete(point[1])
    if semafore and not repaint and down != down[1] and filter
        nx = down ? hg : lw
        point := label.new(bar_index-nx, down ? high[nx] : low[nx], color=down ? color.red : color.green, style=down ? label.style_label_down : label.style_label_up, size=Size)
    down != down[1]

var switch = false
switch := zigzag(input(14, "Depth"), input(3.0, "Deviation"), size.small) or switch

//================== HalfTrend © everget 

halftrend        = input(true, '===HalfTrend===')
amplitude        = input(2,    "Amplitude")
channelDeviation = input(2,    "Channel Deviation")

var int trend     = 0
var int nextTrend = 0
var float maxLowPrice  = nz(low[1], low)
var float minHighPrice = nz(high[1], high)

var float up    = 0.0
var float down  = 0.0
float atrHigh   = 0.0
float atrLow    = 0.0
float arrowUp   = na
float arrowDown = na

atr2 = atr(100) / 2
dev = channelDeviation * atr2

highPrice = high[abs(highestbars(amplitude))]
lowPrice  = low[abs(lowestbars(amplitude))]
highma    = sma(high, amplitude)
lowma     = sma(low, amplitude)

if nextTrend == 1
	maxLowPrice := max(lowPrice, maxLowPrice)
	if highma < maxLowPrice and close < nz(low[1], low)
		trend := 1
		nextTrend := 0
		minHighPrice := highPrice
else
	minHighPrice := min(highPrice, minHighPrice)
	if lowma > minHighPrice and close > nz(high[1], high)
		trend := 0
		nextTrend := 1
		maxLowPrice := lowPrice

if trend == 0
	if not na(trend[1]) and trend[1] != 0
		up := na(down[1]) ? down : down[1]
		arrowUp := up - atr2
	else
		up := na(up[1]) ? maxLowPrice : max(maxLowPrice, up[1])
	atrHigh := up + dev
	atrLow := up - dev
else
	if not na(trend[1]) and trend[1] != 1 
		down := na(up[1]) ? up : up[1]
		arrowDown := down + atr2
	else
		down := na(down[1]) ? minHighPrice : min(minHighPrice, down[1])
	atrHigh := down + dev
	atrLow := down - dev

ht = trend == 0 ? up : down

buySignal  = not na(arrowUp)   and (trend == 0 and trend[1] == 1) and filter 
sellSignal = not na(arrowDown) and (trend == 1 and trend[1] == 0) and filter 

plotshape(halftrend and buySignal  ? low  : na, "Arrow Up",   shape.triangleup,   location.absolute, color.blue, size=size.tiny)
plotshape(halftrend and sellSignal ? high : na, "Arrow Down", shape.triangledown, location.absolute, color.red,  size=size.tiny)

//==================== Nick Rypock Trailing Reverse © everget

nrypock    = input(true, "===Nick Rypock Trailing Reverse===")
percentage = input(0.1, "Coefficient of Correction (%)", minval=0, maxval=100, step=0.1) * 0.01

var int trend2 = 0
var float hp = close
var float lp = close
float nrtr = close

if trend2 >= 0
	if close > hp
		hp := close
		hp
	nrtr := hp * (1 - percentage)
	if close <= nrtr
		trend2 := -1
		lp := close
		nrtr := lp * (1 + percentage)
		nrtr
else
	if close < lp
		lp := close
		lp
	nrtr := lp * (1 + percentage)
	if close > nrtr
		trend2 := 1
		hp := close
		nrtr := hp * (1 - percentage)
		nrtr

buySignal2  = trend2 ==  1 and trend2[1] == -1 and filter 
sellSignal2 = trend2 == -1 and trend2[1] ==  1 and filter 

plotshape(nrypock and buySignal2  ? low  : na, "Buy Label",  shape.labelup,   location.absolute, color.blue, size=size.tiny, text="B", textcolor=color.white, transp=0)
plotshape(nrypock and sellSignal2 ? high : na, "Sell Label", shape.labeldown, location.absolute, color.red,  size=size.tiny, text="S", textcolor=color.white, transp=0)

//==================== Tweezer and Kangaroo Tail © LonesomeTheBlue

enable_tk   = input(false, "===Tweezer and Kangaroo Tail===")
maxrate     = input(150.,  "Max Rate % Between Wick Sizes") / 100.
leveldiff   = input(20.,   "Max Difference in level %") / 100.
prd         = input(5,     "Highest/Lowest Period")
apartprd    = input(12,    "Max Distance between Tweezers", minval=1)

prd1        = input(20,    "Period for Room",            minval=2, maxval=50)
prd2        = input(8,     "Minimum Period for Room",    minval=2, maxval=50)
atrmult     = input(5,     "ATR Factor for Room Height", minval=2, maxval=30)
wickmult    = input(3.,    "Wick/Body Rate",             minval = 1)
wickmultavg = input(2.,    "Wick/Average_Wick Rate",     minval=1)

topwick    = high - max(close, open)
bottomwick = min(close, open) - low
body = abs(close - open)
ishb = highestbars(prd) == 0
islb = lowestbars(prd) == 0

aparttweezers_top(len) =>
    ret = 0
    if topwick > 0
        for x = 1 to apartprd
            if nz(topwick[x]) == 0
                break
            if (max(topwick, topwick[x]) / min(topwick, topwick[x])) <= maxrate and abs(high - high[x]) < max(topwick, topwick[x]) * leveldiff and ishb[x]
                ret := x
                break
            else 
                if high[x] >= high
                    ret := 0
                    break
    ret
    
aparttweezers_bottom(len) =>
    ret = 0
    if bottomwick > 0
        for x = 1 to apartprd
            if nz(bottomwick[x]) == 0
                break
            if (max(bottomwick, bottomwick[x]) / min(bottomwick, bottomwick[x])) <= maxrate and abs(low - low[x]) < max(bottomwick, bottomwick[x]) * leveldiff and islb[x]
                ret := x
                break
            else 
                if low[x] <= low
                    ret := 0
                    break
    ret

top_tweezer    = enable_tk and aparttweezers_top(apartprd) and filter 
bottom_tweezer = enable_tk and aparttweezers_bottom(apartprd) and filter 

// KANGAROO TAIL 
float ph = highestbars(high, prd1) == 0 ? high : na
float pl = lowestbars(low, prd1) == 0 ? low : na
var dir = 0
dir := iff(ph and na(pl), 1, iff(pl and na(ph), -1, dir))
var max_array_size = 4
var tk_zigzag = array.new_float(4, 0.)

add_to_zigzag(value, bindex) =>
    array.unshift(tk_zigzag, bindex)
    array.unshift(tk_zigzag, value)
    array.pop(tk_zigzag)
    array.pop(tk_zigzag)
    
update_zigzag(value, bindex) =>
    if array.size(tk_zigzag) == 0
        add_to_zigzag(value, bindex)
    else
        if (dir == 1 and value > array.get(tk_zigzag, 0)) or (dir == -1 and value < array.get(tk_zigzag, 0))
            array.set(tk_zigzag, 0, value)
            array.set(tk_zigzag, 1, bindex)
        0.

dirchanged = change(dir)
if ph or pl
    if dirchanged
        add_to_zigzag(dir == 1 ? ph : pl, bar_index)
    else
        update_zigzag(dir == 1 ? ph : pl, bar_index)

averagetopwicksize = sma(topwick, 50)

topkangaroo = enable_tk and dir == 1  and topwick >= body * wickmult and close <= low + (high - low) / 3 and open <= low + (high - low) / 3 and 
  open < high[1] and open > low[1] and close < high[1] and close > low[1] and topwick >= wickmultavg * averagetopwicksize and body > 0 and
  ph and array.get(tk_zigzag, 0) == high and array.get(tk_zigzag, 0) - array.get(tk_zigzag, 2) > atr(50) * atrmult and array.get(tk_zigzag, 1) - array.get(tk_zigzag, 3) > prd2 and filter 

bottomkangaroo = enable_tk and dir == -1  and bottomwick >= body * wickmult and close >= high - (high - low) / 3 and open >= high - (high - low) / 3 and 
  open < high[1] and open > low[1] and close < high[1] and close > low[1] and bottomwick >= wickmultavg * averagetopwicksize and body > 0 and
  pl and array.get(tk_zigzag, 0) == low and array.get(tk_zigzag, 2) - array.get(tk_zigzag, 0) > atr(50) * atrmult and array.get(tk_zigzag, 1) - array.get(tk_zigzag, 3) > prd2 and filter 

plotshape(top_tweezer,    '', shape.labeldown, location.abovebar, color.red,  text="T", textcolor = color.white)
plotshape(bottom_tweezer, '', shape.labelup,   location.belowbar, color.lime, text="T", textcolor = color.black)
plotshape(topkangaroo,    '', shape.labeldown, location.abovebar, color.red,  text="K", textcolor = color.white)
plotshape(bottomkangaroo, '', shape.labelup,   location.belowbar, color.lime, text="K", textcolor = color.black)

//-------------------- Backtesting

show_info = input(true, '===Information for DTTA only===')
lot_size  = input(0.01,  'Lot Size', options=[0.01,0.1,0.2,0.3,0.5,1,2,3,5,10,20,30,50,100,1000]) 

bidask = (open+high+low)/3

var float start_long_trade  = bidask  
var float long_trades       = 0.
var float start_short_trade = bidask  
var float short_trades      = 0.
var int   wins              = 0
var int   trade_count       = 0

if startLongTrade 
    start_long_trade := bidask 
if endLongTrade
    ldiff         = (bidask - start_long_trade)
    wins         := ldiff > 0 ? 1 : 0
    long_trades  := ldiff * lot_size   
    trade_count  := 1
if startShortTrade 
    start_short_trade := bidask
if endShortTrade
    sdiff         = (start_short_trade - bidask)
    wins         := sdiff > 0 ? 1 : 0
    short_trades := sdiff * lot_size 
    trade_count  := 1
    
cumreturn   = cum(long_trades) + cum(short_trades)  //-- cumulative return 
totaltrades = cum(trade_count)
totalwins   = cum(wins)  
totallosses = totaltrades - totalwins == 0 ? 1 : totaltrades - totalwins

//------------------- Information

var label lbl = na

info =  'CR='          + tostring(cumreturn,             '#.#') 
      + '\nTrades: '   + tostring(totaltrades,           '#')
      + '\nWin/Loss: ' + tostring(totalwins/totallosses, '#.##') 
      + '\nWinrate: '  + tostring(totalwins/totaltrades, '#.#%')       
      + '\nBar Time: ' + tostring(barlife,               '#.#%')

if show_info and barstate.islast  
    lbl := label.new(bar_index, ohlc4, info, xloc.bar_index, yloc.price, 
                     color.new(color.blue, 100), label.style_label_left, color.black, size.small, text.align_left)
    label.delete(lbl[1])

Aggregate Signal

//@version=4
study("Aggregate Signal (Improved)", overlay=false, precision=2)

// Aggregate signal assembly improved. 
// Below is an extendable engine that can produce feasible signals provided you supply non-contradicting factors.
// Ex., the list of factors can include rsi_stoch, emo, macd, dpo, roc, accdist, cctbb, awesome, tva, and lots of others.

//*** Inputs
per      = input(22, "Lookback Window",    minval=1) 
uthres1  = input(80, "Upper Threshold #1", minval=50, maxval=100)
uthres2  = input(90, "Upper Threshold #2", minval=50, maxval=100)
lthres1  = input(20, "Lower Threshold #1", minval=0, maxval=50)
lthres2  = input(10, "Lower Threshold #2", minval=0, maxval=50)
higherTF = input(2,  "Higher TF", minval=1) 

//*** Functions
scaler(x) => (x - lowest(x, per)) / (highest(x, per) - lowest(x, per))

aggregate_signals() => // Here you can add whatever factors that you think contribute to a plausible outcome
    O = open, H = high, L = low, C = close, V = nz(volume, .5) 
    f1  = scaler(rsi(C, 14))                  // RSI
    f2  = scaler(cci(C, 10))                  // CCI
    f3  = scaler(cog(C, 14))                  // COG  
    f4  = scaler(2 / (1 + pow(2.71828182846, -C/C[1])) - 1) // MeanSlope - mean of the absolute value of slopes
    (f1+f2+f3+f4)/4
    
    // Possible factors:
    // macd = ema(C, 8) - ema(C, 16)                             
    // mp   = 0.5 * ((H - H[1]) / H[1] + (L - L[1]) / L[1])
    // f21 = scaler(macd)                        // MACD
    // f22 = scaler(macd - ema(macd, 11))        // MACD-Asprey
    // f24 = scaler(sma(stoch(C, H, L, 14), 3))  // Stoch
    // f26 = scaler(mom(C, 10))                  // Momentum
    // f27 = scaler(fixnan(100 * rma(change(H) - (-change(L)), 14) / rma(tr, 14)))
    // f28 = scaler(cum(change(C) > 0 ? V : change(C) < 0 ? -V : 0*V))     // OBV
    // f29 = scaler(sma((((C-L) - (H-C)) / (H - L)) * V, 21) / sma(V, 21)) // Cmf
    // f30 = scaler(sma(mp, 5) - sma(mp, 34))    // Awesome Oscillator  
    // f31 = scaler(vwma(C, 12) - vwma(C, 26))   // Volume weighted MACD
    // Here take the sum of the factors and divide it by their total number.

//*** Main
agg    = aggregate_signals()
aggHTF = scaler(security(syminfo.tickerid, tostring(higherTF), agg))

orange = agg > (uthres1/100) and agg < (uthres2/100) 
red    = agg > (uthres2/100)  
green  = agg < (lthres1/100) and agg > (lthres2/100) 
lime   = agg < (lthres2/100) 

plot(orange ? agg : na, color=color.new(color.orange, 20), style=plot.style_columns, transp=40)
plot(red    ? agg : na, color=color.new(color.red, 20), style=plot.style_columns, transp=40)
plot(lime   ? agg : na, color=color.new(color.lime, 20), style=plot.style_columns, transp=40)
plot(green  ? agg : na, color=color.new(color.green, 20), style=plot.style_columns, transp=40)
plot(not(orange or red or lime or green) ? agg : na, color=color.gray, style=plot.style_columns, transp=80)
plot(agg, color=color.gray, transp=0)
plot(aggHTF, color=color.blue, linewidth=1, transp=0)

18 Replies to Tradingview scriptlerim

  1. Şimdi birinci sorum şu bu kodları python ile bot haline dönüştürebilir miyiz? İkinci sorum bildirimleri telegrama gönderebilir miyiz? Teşekkürler

  2. Bu scriptleri kullanarak aktif bir bot yazılabilse süper olur tadından yenmez,böyle bir imkanımız var mı acaba?

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir