Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
8.9 kB
16
Indexable
Never
//@version=5
//author 

indicator('BHO', overlay=true, shorttitle='H.O.COMBO')
src = input(title='Source', defval=close)
//ho1 = input(7, 'MA Length1')
//plot(ta.sma(src, ho1), color=color.new(color.blue, 0), linewidth=2, title='MA50')

//ho2 = input(21, 'MA Length2')
//plot(ta.sma(src, ho2), color=color.new(color.red, 0), linewidth=2, title='MA200')

//col1 = ho1 > ho2
//col3 = ho1 < ho2
//cro = ta.crossover(ho1 ,ho2)
//cru = ta.crossover(ho2,ho1)


fastLength = input(9)
slowLength = input(18)
price = close
mafast = ta.sma(price, fastLength)
maslow = ta.sma(price, slowLength)
k1=ta.crossover(mafast, maslow)
plot(mafast, color=color.new(color.blue, 0), linewidth=2, title='MA50')
k2=ta.crossunder(mafast, maslow)
plot(maslow, color=color.new(color.red, 0), linewidth=2, title='MA50')
//plot(strategy.equity, title="equity", color=color.red, linewidth=2, style=plot.style_areabr)

direction = 0
direction := k1 ? 1 : k2 ? -1 : direction[1]

string gr_sc = 'SCREENER'
string gr_sy = 'SYMBOL'
string t00 = 'ma Screener'
color c00 = #686868

lb_sh = input.bool(title='Show Label', defval=true, group=gr_sc)
lb_sz = input.string(title='Label Size', options=['Auto', 'Tiny', 'Small', 'Normal', 'Large', 'Huge'], defval='Normal', group=gr_sc)
lb_xa = input.int(title='Horizontal Axis', defval=20, group=gr_sc, tooltip='Label Position x Axis')
lb_ya = input.int(title='Vertical Axis', defval=1, group=gr_sc, tooltip='Label Position y Axis')
lb_cl = input.color(title='Colours', defval=#00bb00, group=gr_sc, inline='0')
lb_cs = input.color(title='', defval=#ff0000, group=gr_sc, inline='0')


sh01 = input.bool(title='01', defval=true, group=gr_sy, inline="01")
sh02 = input.bool(title='02', defval=true, group=gr_sy, inline="02")
sh03 = input.bool(title='03', defval=true, group=gr_sy, inline="03")
sh04 = input.bool(title='04', defval=true, group=gr_sy, inline="04")
sh05 = input.bool(title='05', defval=true, group=gr_sy, inline="05")
sh06 = input.bool(title='06', defval=true, group=gr_sy, inline="06")
sh07 = input.bool(title='07', defval=true, group=gr_sy, inline="07")
sh08 = input.bool(title='08', defval=true, group=gr_sy, inline="08")
sh09 = input.bool(title='09', defval=true, group=gr_sy, inline="09")
sh10 = input.bool(title='10', defval=true, group=gr_sy, inline="10")
sh11 = input.bool(title='11', defval=false, group=gr_sy, inline="11")
sh12 = input.bool(title='12', defval=false, group=gr_sy, inline="12")
sh13 = input.bool(title='13', defval=false, group=gr_sy, inline="13")
sh14 = input.bool(title='14', defval=false, group=gr_sy, inline="14")
sh15 = input.bool(title='15', defval=false, group=gr_sy, inline="15")


tf01 = input.timeframe(title='', defval='', group=gr_sy, inline="01")
tf02 = input.timeframe(title='', defval='', group=gr_sy, inline="02")
tf03 = input.timeframe(title='', defval='', group=gr_sy, inline="03")
tf04 = input.timeframe(title='', defval='', group=gr_sy, inline="04")
tf05 = input.timeframe(title='', defval='', group=gr_sy, inline="05")
tf06 = input.timeframe(title='', defval='', group=gr_sy, inline="06")
tf07 = input.timeframe(title='', defval='', group=gr_sy, inline="07")
tf08 = input.timeframe(title='', defval='', group=gr_sy, inline="08")
tf09 = input.timeframe(title='', defval='', group=gr_sy, inline="09")
tf10 = input.timeframe(title='', defval='', group=gr_sy, inline="10")
tf11 = input.timeframe(title='', defval='', group=gr_sy, inline="11")
tf12 = input.timeframe(title='', defval='', group=gr_sy, inline="12")
tf13 = input.timeframe(title='', defval='', group=gr_sy, inline="13")
tf14 = input.timeframe(title='', defval='', group=gr_sy, inline="14")
tf15 = input.timeframe(title='', defval='', group=gr_sy, inline="15")


s01 = input.symbol(title='', group=gr_sy, inline='01', defval='BINANCE:BTCUSDT')
s02 = input.symbol(title='', group=gr_sy, inline='02', defval='BINANCE:ETHUSDT')
s03 = input.symbol(title='', group=gr_sy, inline='03', defval='BINANCE:BNBUSDT')
s04 = input.symbol(title='', group=gr_sy, inline='04', defval='BINANCE:ADAUSDT')
s05 = input.symbol(title='', group=gr_sy, inline='05', defval='BINANCE:AVAXUSDT')
s06 = input.symbol(title='', group=gr_sy, inline='06', defval='BINANCE:CHZUSDT')
s07 = input.symbol(title='', group=gr_sy, inline='07', defval='BINANCE:DOGEUSDT')
s08 = input.symbol(title='', group=gr_sy, inline='08', defval='BINANCE:SOLUSDT')
s09 = input.symbol(title='', group=gr_sy, inline='09', defval='BINANCE:TRXUSDT')
s10 = input.symbol(title='', group=gr_sy, inline='10', defval='BINANCE:XRPUSDT')
s11 = input.symbol(title='', group=gr_sy, inline='11', defval='BINANCE:GRTUSDT')
s12 = input.symbol(title='', group=gr_sy, inline='12', defval='BINANCE:EDUUSDT')
s13 = input.symbol(title='', group=gr_sy, inline='13', defval='')
s14 = input.symbol(title='', group=gr_sy, inline='14', defval='')
s15 = input.symbol(title='', group=gr_sy, inline='15', defval='')


f_screener(s) =>
    int x = na
    int y = na
    z = color(na)
    if s
        x := direction
        y := ta.barssince(x != x[1])
        z := x == 1 ? lb_cl : x == -1 ? lb_cs : c00
    [x, y, z]
//
f_bars(x) =>
    r = ' [' + str.tostring(x) + '] '
//
f_size(x) =>
      x == 'Tiny' ? size.tiny : 
      x == 'Small' ? size.small : 
      x == 'Normal' ? size.normal : 
      x == 'Large' ? size.large : 
      x == 'Huge' ? size.huge : size.auto
//
f_label(l, t, c) =>
    r = string(na)
    for i = l*2 to 0
        r += '\n\n'
    r += t
    var label lb = na
    label.delete(lb)
    fix_allign = ta.highest(200)
    lb := lb_sh ? label.new(
      x=bar_index + lb_xa, 
      y=bar_index > 200 ? fix_allign * (1 + lb_ya / 1000) : hl2 * (1 + lb_ya / 1000), 
      text=r, textcolor=c, textalign=text.align_right, 
      style=label.style_label_left, size=f_size(lb_sz), color=#00000000) : na



[a01, b01, c01] = request.security(s01, tf01, f_screener(sh01))
[a02, b02, c02] = request.security(s02, tf02, f_screener(sh02))
[a03, b03, c03] = request.security(s03, tf03, f_screener(sh03))
[a04, b04, c04] = request.security(s04, tf04, f_screener(sh04))
[a05, b05, c05] = request.security(s05, tf05, f_screener(sh05))
[a06, b06, c06] = request.security(s06, tf06, f_screener(sh06))
[a07, b07, c07] = request.security(s07, tf07, f_screener(sh07))
[a08, b08, c08] = request.security(s08, tf08, f_screener(sh08))
[a09, b09, c09] = request.security(s09, tf09, f_screener(sh09))
[a10, b10, c10] = request.security(s10, tf10, f_screener(sh10))
[a11, b11, c11] = request.security(s11, tf11, f_screener(sh11))
[a12, b12, c12] = request.security(s12, tf12, f_screener(sh12))
[a13, b13, c13] = request.security(s13, tf13, f_screener(sh13))
[a14, b14, c14] = request.security(s14, tf14, f_screener(sh14))
[a15, b15, c15] = request.security(s15, tf15, f_screener(sh15))


t01 = a01 == 1 ? '▲' + f_bars(b01) + s01 : a01 == -1 ? '▼' + f_bars(b01) + s01 : '■' + f_bars(b01) + s01
t02 = a02 == 1 ? '▲' + f_bars(b02) + s02 : a02 == -1 ? '▼' + f_bars(b02) + s02 : '■' + f_bars(b02) + s02
t03 = a03 == 1 ? '▲' + f_bars(b03) + s03 : a03 == -1 ? '▼' + f_bars(b03) + s03 : '■' + f_bars(b03) + s03
t04 = a04 == 1 ? '▲' + f_bars(b04) + s04 : a04 == -1 ? '▼' + f_bars(b04) + s04 : '■' + f_bars(b04) + s04
t05 = a05 == 1 ? '▲' + f_bars(b05) + s05 : a05 == -1 ? '▼' + f_bars(b05) + s05 : '■' + f_bars(b05) + s05
t06 = a06 == 1 ? '▲' + f_bars(b06) + s06 : a06 == -1 ? '▼' + f_bars(b06) + s06 : '■' + f_bars(b06) + s06
t07 = a07 == 1 ? '▲' + f_bars(b07) + s07 : a07 == -1 ? '▼' + f_bars(b07) + s07 : '■' + f_bars(b07) + s07
t08 = a08 == 1 ? '▲' + f_bars(b08) + s08 : a08 == -1 ? '▼' + f_bars(b08) + s08 : '■' + f_bars(b08) + s08
t09 = a09 == 1 ? '▲' + f_bars(b09) + s09 : a09 == -1 ? '▼' + f_bars(b09) + s09 : '■' + f_bars(b09) + s09
t10 = a10 == 1 ? '▲' + f_bars(b10) + s10 : a10 == -1 ? '▼' + f_bars(b10) + s10 : '■' + f_bars(b10) + s10
t11 = a11 == 1 ? '▲' + f_bars(b11) + s11 : a11 == -1 ? '▼' + f_bars(b11) + s11 : '■' + f_bars(b11) + s11
t12 = a12 == 1 ? '▲' + f_bars(b12) + s12 : a12 == -1 ? '▼' + f_bars(b12) + s12 : '■' + f_bars(b12) + s12
t13 = a13 == 1 ? '▲' + f_bars(b13) + s13 : a13 == -1 ? '▼' + f_bars(b13) + s13 : '■' + f_bars(b13) + s13
t14 = a14 == 1 ? '▲' + f_bars(b14) + s14 : a14 == -1 ? '▼' + f_bars(b14) + s14 : '■' + f_bars(b14) + s14
t15 = a15 == 1 ? '▲' + f_bars(b15) + s15 : a15 == -1 ? '▼' + f_bars(b15) + s15 : '■' + f_bars(b15) + s15


f_label(0, t00, c00)
f_label(1, t01, c01)
f_label(2, t02, c02)
f_label(3, t03, c03)
f_label(4, t04, c04)
f_label(5, t05, c05)
f_label(6, t06, c06)
f_label(7, t07, c07)
f_label(8, t08, c08)
f_label(9, t09, c09)
f_label(10, t10, c10)
f_label(11, t11, c11)
f_label(12, t12, c12)
f_label(13, t13, c13)
f_label(14, t14, c14)
f_label(15, t15, c15)
Leave a Comment