Harigami
ログイン
LC23 タイトルなし
Python
//@version=3

study(title = "AWABI改")

source = hlc3
length = input(26, minval=1), multi = input(2.0, minval=0.001,title="シグマ", maxval=50)
len = input(14, minval=1, title="MA1")
len2 = input(20, minval=1, title="MA2")

//RSI
rsi1 = rsi(source, length)

// BB of RSI
basis = wma(rsi1, length)
dev = multi * stdev(rsi1, length)
upper = basis + dev
lower = basis - dev
br = (rsi1 - lower)/(upper - lower)
obLevel1 = input(1, "Over Bought Level 1")
obLevel2 = input(0.5, "Over Bought Level 2")
obLevel3 = input(0, "Over Bought Level 3")
//MA OF RSI
er = wma(br,len)
er2 = wma(br,len2)

//ENTRY条件
LONG = crossover(er,er2)
SHORT = crossunder(er,er2)


switch = 0
setA = 0
setB = 0

if (LONG and (switch[1] == 0))
    switch := 1
    setA := 1
    setB := 0
else    
    if (SHORT and (switch[1] == 1))
        switch := 0
        setA := 0
        setB := 1
    else
        switch := nz(switch[1],0)
        setA := 0
        setB := 0



alertcondition(setA, title = "LONG", message = "LLLLL!")
alertcondition(setB, title = "SHORT", message = "SSSSS!")



//COLOR
mc = er > er2 ? lime:red
plot(br, color=aqua)
plot(obLevel1, title="ov1",color=silver, style=3)
plot(obLevel2, title="ov2",color=silver, style=3)
plot(obLevel3, title="ov3",color=silver, style=3)
plot(er, title="MA1", style=line, linewidth=1, color=mc,transp=10)
plot(er2, title="MA2", style=line, linewidth=1, color=mc,transp=10)
fill(plot(er), plot(er2), color = mc)
  • 0
  • 0
anonymous タイトルなし
Python
//@version=3

strategy(title = "AWABI改")

source = hlc3
length = input(26, minval=1), multi = input(2.0, minval=0.001,title="シグマ", maxval=50)
len = input(14, minval=1, title="MA1")
len2 = input(20, minval=1, title="MA2")

//RSI
rsi1 = rsi(source, length)

// BB of RSI
basis = wma(rsi1, length)
dev = multi * stdev(rsi1, length)
upper = basis + dev
lower = basis - dev
br = (rsi1 - lower)/(upper - lower)
obLevel1 = input(1, "Over Bought Level 1")
obLevel2 = input(0.5, "Over Bought Level 2")
obLevel3 = input(0, "Over Bought Level 3")
//MA OF RSI
er = wma(br,len)
er2 = wma(br,len2)

//ENTRY条件
LONG = crossover(br,er)
SHORT = crossunder(br,er)
strategy.entry("LONG",true,when=LONG)
strategy.entry("SHORT",false,when=SHORT)

//COLOR
mc = er > er2 ? lime:red
plot(br, color=aqua)
plot(obLevel1, title="ov1",color=silver, style=3)
plot(obLevel2, title="ov2",color=silver, style=3)
plot(obLevel3, title="ov3",color=silver, style=3)
plot(er, title="MA1", style=line, linewidth=1, color=mc,transp=10)
plot(er2, title="MA2", style=line, linewidth=1, color=mc,transp=10)
fill(plot(er), plot(er2), color = mc)
  • 0
  • 0
LC23 タイトルなし
Python
//@version=3

strategy(title = "AWABI改")

source = hlc3
length = input(26, minval=1), multi = input(2.0, minval=0.001,title="シグマ", maxval=50)
len = input(14, minval=1, title="MA1")
len2 = input(20, minval=1, title="MA2")

//RSI
rsi1 = rsi(source, length)

// BB of RSI
basis = wma(rsi1, length)
dev = multi * stdev(rsi1, length)
upper = basis + dev
lower = basis - dev
br = (rsi1 - lower)/(upper - lower)
obLevel1 = input(1, "Over Bought Level 1")
obLevel2 = input(0.5, "Over Bought Level 2")
obLevel3 = input(0, "Over Bought Level 3")
//MA OF RSI
er = wma(br,len)
er2 = wma(br,len2)

//ENTRY条件
LONG = crossover(br,er)
SHORT = crossunder(br,er)
strategy.entry("LONG",true,when=LONG)
strategy.entry("SHORT",false,when=SHORT)

//COLOR
mc = er > er2 ? lime:red
plot(br, color=aqua)
plot(obLevel1, title="ov1",color=silver, style=3)
plot(obLevel2, title="ov2",color=silver, style=3)
plot(obLevel3, title="ov3",color=silver, style=3)
plot(er, title="MA1", style=line, linewidth=1, color=mc,transp=10)
plot(er2, title="MA2", style=line, linewidth=1, color=mc,transp=10)
fill(plot(er), plot(er2), color = mc)
  • 0
  • 0
LC23 タイトルなし
Python
//@version=3
study("MA20MTF GMMA", overlay=true)


A = input(title='5M', type=resolution, defval="1")
B = input(title='15M', type=resolution, defval="1")
C = input(title='30M', type=resolution, defval="1")
D = input(title='1H', type=resolution, defval="1")
E = input(title='4H', type=resolution, defval="1")


A1 = security(tickerid, A, sma(close, 100))
B1 = security(tickerid, B, sma(close, 300))
C1 = security(tickerid, C, sma(close, 600))
D1 = security(tickerid, D, sma(close, 1200))
E1 = security(tickerid, E, sma(close, 4800))



plot(A1 , color=gray, linewidth=1)
AL=plot(B1 , color=lime, linewidth=1)
BL=plot(C1 , color=lime, linewidth=1)
CL=plot(D1 , color=red, linewidth=1)
DL=plot(E1 , color=red, linewidth=1)
fill(AL,BL ,color=lime,transp=80)
fill(CL,DL ,color=red,transp=80)
  • 0
  • 0
LC23 タイトルなし
Python
//@version=2

strategy(title = "インフルエンサー Strategy", overlay = true, pyramiding = 0, default_qty_type = strategy.percent_of_equity, default_qty_value = 10)

// === INPUTS ===
useRes      = input(defval = true, title = "Use Alternate Resolution? ( recommended )")
stratRes    = input(defval = "1440", title = "Set Resolution ( should not be lower than chart )", type = resolution)
useMA       = input(defval = true, title = "Use MA? ( otherwise use simple Open/Close data )")
basisType   = input(defval = "DEMA", title = "MA Type: SMA, EMA, DEMA, TEMA, WMA, VWMA, SMMA, HullMA, LSMA, ALMA ( case sensitive )", type = string)
basisLen    = input(defval = 14, title = "MA Period", minval = 1)
offsetSigma = input(defval = 6, title = "Offset for LSMA / Sigma for ALMA", minval = 0)
offsetALMA  = input(defval = 0.85, title = "Offset for ALMA", minval = 0, step = 0.01)
useStop     = input(defval = true, title = "Use Trailing Stop?")
slPoints    = input(defval = 200000, title = "Stop Loss Trail Points", minval = 1)
slOffset    = input(defval = 400000, title = "Stop Loss Trail Offset", minval = 1)
// === /INPUTS ===

// === BASE FUNCTIONS ===
// Returns MA input selection variant, default to SMA if blank or typo.
variant(type, src, len, offSig, offALMA) =>
    v1 = sma(src, len)                                                  // Simple
    v2 = ema(src, len)                                                  // Exponential
    v3 = 2 * v2 - ema(v2, len)                                          // Double Exponential
    v4 = 3 * (v2 - ema(v2, len)) + ema(ema(v2, len), len)               // Triple Exponential
    v5 = wma(src, len)                                                  // Weighted
    v6 = vwma(src, len)                                                 // Volume Weighted
    v7 = na(v5[1]) ? sma(src, len) : (v5[1] * (len - 1) + src) / len    // Smoothed
    v8 = wma(2 * wma(src, len / 2) - wma(src, len), round(sqrt(len)))   // Hull
    v9 = linreg(src, len, offSig)                                       // Least Squares
    v10 = alma(src, len, offALMA, offSig)                               // Arnaud Legoux
    type=="EMA"?v2 : type=="DEMA"?v3 : type=="TEMA"?v4 : type=="WMA"?v5 : type=="VWMA"?v6 : type=="SMMA"?v7 : type=="HullMA"?v8 : type=="LSMA"?v9 : type=="ALMA"?v10 : v1
// security wrapper for repeat calls
reso(exp, use, res) => use ? security(tickerid, res, exp) : exp
// === /BASE FUNCTIONS ===

// === SERIES SETUP ===
// open/close
closeSeries = useMA ? reso(variant(basisType, close, basisLen, offsetSigma, offsetALMA), useRes, stratRes) : reso(close, useRes, stratRes)
openSeries  = useMA ? reso(variant(basisType, open, basisLen, offsetSigma, offsetALMA), useRes, stratRes) : reso(open, useRes, stratRes)
trendState  = closeSeries > openSeries ? true : closeSeries < openSeries ? false : trendState[1]
// === /SERIES ===

// === PLOTTING ===
barcolor(color = closeSeries > openSeries ? #006600 : #990000, title = "Bar Colours")
// channel outline
closePlot   = plot(closeSeries, title = "Close Line", color = #009900, linewidth = 2, style = line, transp = 90)
openPlot    = plot(openSeries, title = "Open Line", color = #CC0000, linewidth = 2, style = line, transp = 90)
// channel fill
closePlotU  = plot(trendState ? closeSeries : na, transp = 100, editable = false)
openPlotU   = plot(trendState ? openSeries : na, transp = 100, editable = false)
closePlotD  = plot(trendState ? na : closeSeries, transp = 100, editable = false)
openPlotD   = plot(trendState ? na : openSeries, transp = 100, editable = false)
fill(openPlotU, closePlotU, title = "Up Trend Fill", color = #009900, transp = 40)
fill(openPlotD, closePlotD, title = "Down Trend Fill", color = #CC0000, transp = 40)
// === /PLOTTING ===

// === STRATEGY ===
// conditions
longCond    = crossover(closeSeries, openSeries)
shortCond   = crossunder(closeSeries, openSeries)
// entries and base exit
strategy.entry("long", strategy.long, when = longCond)
strategy.entry("short", strategy.short, when = shortCond)
// if we're using the trailing stop
if (useStop)
    strategy.exit("XL", from_entry = "long", trail_points = slPoints, trail_offset = slOffset)
    strategy.exit("XS", from_entry = "short", trail_points = slPoints, trail_offset = slOffset)
// not sure needed, but just incase..
strategy.exit("XL", from_entry = "long", when = shortCond)
strategy.exit("XS", from_entry = "short", when = longCond)
// === /STRATEGY ===
  • 0
  • 0
LC23 タイトルなし
Python
//@version=3
study("MA20MTF GMMA", overlay=false)

// SMA or EMA
SEswitch = input(title="on:EMA off:SMA", type=bool, defval=true)

//Set resolutions
resA = input(title='5M', type=resolution, defval="1")
resB = input(title='15M', type=resolution, defval="1")
resC = input(title='30M', type=resolution, defval="1")
resD = input(title='1H', type=resolution, defval="1")
resE = input(title='4H', type=resolution, defval="1")

//Set switches
maAswitch = input(title="MA1 On/Off", type=bool, defval=true)
maBswitch = input(title="MA2 On/Off", type=bool, defval=true)
maCswitch = input(title="MA3 On/Off", type=bool, defval=true)
maDswitch = input(title="MA4 On/Off", type=bool, defval=true)
maEswitch = input(title="MA5 On/Off", type=bool, defval=true)

//get data
dataA = security(tickerid, resA, SEswitch ? ema(close,100 ) : sma(close, 100))
dataB = security(tickerid, resB, SEswitch ? ema(close, 300) : sma(close, 300))
dataC = security(tickerid, resC, SEswitch ? ema(close, 600) : sma(close, 600))
dataD = security(tickerid, resD, SEswitch ? ema(close, 1200) : sma(close, 1200))
dataE = security(tickerid, resE, SEswitch ? ema(close, 4800) : sma(close, 4800))


//Plotting
plot(maAswitch ? dataA : na, color=gray, linewidth=1)
AL=plot(maBswitch ? dataB : na, color=lime, linewidth=2)
BL=plot(maCswitch ? dataC : na, color=lime, linewidth=2)
CL=plot(maDswitch ? dataD : na, color=red, linewidth=2)
DL=plot(maEswitch ? dataE : na, color=red, linewidth=2)
fill(AL,BL ,color=lime,transp=45)
fill(CL,DL ,color=red,transp=45)
  • 0
  • 0
anonymous タイトルなし
Python
//@version=3
study(title="RSI-PO", overlay=false)
src = close, 
len = input(14, minval=1, title="RSI Length")
len2 = input(15, minval=1, title="SMA of RSI Length")
len3 = input(20, minval=1, title="SMA of RSI Length")
len4 = input(35, minval=1, title="SMA of RSI Length")
len5 = input(55, minval=1, title="SMA of RSI Length")
len6 = input(85, minval=1, title="SMA of RSI Length")
len7 = input(120, minval=1, title="SMA of RSI Length")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
emarsi = ema(rsi,len2)
emarsi2 = ema(rsi,len3)
emarsi3 = ema(rsi,len4)
emarsi4 = ema(rsi,len5)
emarsi5 = ema(rsi,len6)
emarsi6 = ema(rsi,len7)
showPerfectOrder = input(title="Show Perfect Order?", type=bool, defval=true)

plot(emarsi, title="SMA of RSI", style=line, linewidth=1, color=orange)
plot(emarsi2, title="EMA of RSI", style=line, linewidth=1, color=lime)
plot(emarsi3, title="SMA of RSI", style=line, linewidth=1, color=aqua)
plot(emarsi4, title="EMA of RSI", style=line, linewidth=1, color=purple)
plot(emarsi5, title="SMA of RSI", style=line, linewidth=1, color=yellow)
plot(emarsi6, title="EMA of RSI", style=line, linewidth=1, color=red)
band1 = hline(70, title="Upper Line", linestyle=dashed, linewidth=1, color=gray)
band0 = hline(30, title="Lower Line", linestyle=dashed, linewidth=1, color=gray)

perfectOrderByUpTrend = emarsi[1] > emarsi2[1] and emarsi3[1] > emarsi4[1] and emarsi5[1] > emarsi6[1] ? true : false
perfectOrderByDownTrend = emarsi[1] < emarsi2[1] and emarsi3[1] < emarsi4[1] and emarsi5[1] < emarsi6[1] ? true : false
bgcolor(perfectOrderByUpTrend and showPerfectOrder ? green : white, transp=90, offset=-1)
bgcolor(perfectOrderByDownTrend and showPerfectOrder ? red : white, transp=90, offset=-1)

switch = 0
setA = 0
setB = 0


if (perfectOrderByUpTrend and (switch[1] == 0))
    switch := 1
    setA := 1
    setB := 0
else    
    if (perfectOrderByDownTrend and (switch[1] == 1))
        switch := 0
        setA := 0
        setB := 1
    else
        switch := nz(switch[1],0)
        setA := 0
        setB := 0
        
      

alertcondition(setA, title="trend+", message="TREND UP")
alertcondition(setB, title="trend-", message="TREND DOWN")
  • 0
  • 0
anonymous タイトルなし
Python
<p><strong>👇雑談や質問が気軽にできる♪&nbsp;ジャパカジ掲示板</strong></p>
<p>ユーザー同士の交流や雑談、ジャパカジスタッフへの<a href="/forum" target="_blank" title="">お問い合わせ</a>、なんでも大歓迎!</p>
<div><a href="/forum" title=""><img alt="ジャパカジ掲示板はじめました!詳細ページへ" class="full hidden-xs" src="/images/home/images/casino-forum-ad-pc_1502x192.jpg" style="" /><img alt="ジャパカジ掲示板はじめました!詳細ページへ" class="full visible-xs" font-size:10px="" src="/images/home/images/casino-forum-ad-mobile_702x178.jpg" style="" /></a></div>
  • 0
  • 0
anonymous タイトルなし
Python
//@version=3
study(title="DMI ADX TREND", shorttitle="ADX TREND", overlay = true)

//数値
adxlen = input(14, title="ADX Smoothing")
dilen = input(14, title="DI Length")
thold = input(20, title="Threshold")

threshold = thold

//ADX±DI
dirmov(len) =>
    up = change(high)
    down = -change(low)
    truerange = rma(tr, len)
    plus = fixnan(100 * rma(up > down and up > 0 ? up : 0, len) / truerange)
    minus = fixnan(100 * rma(down > up and down > 0 ? down : 0, 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)
    [adx, plus, minus]

[sig, up, down] = adx(dilen, adxlen)

osob=input(40,title="Exhaustion Level for ADX, default = 40")
col = sig >= sig[1] ? green : sig <= sig[1] ? red : gray 

//アラート
trender = (sig >= up or sig >= down) ? 1 : 0
tru = (sig >= up or sig >= down) 
trd = (sig <= up and sig <= down) 

switch = 0
setA = 0
setB = 0

if (tru and (switch[1] == 0))
    switch := 1
    setA := 1
    setB := 0
else    
    if (trd and (switch[1] == 1))
        switch := 0
        setA := 0
        setB := 1
    else
        switch := nz(switch[1],0)
        setA := 0
        setB := 0
        
 //カラー&シグナル
bgcolor(trender>0?blue:aqua, transp=93)       
plotshape(setA,title="TRENDUP",style=shape.triangleup,text="TUP",color=green,textcolor=green,location=location.belowbar)
plotshape(setB,title="TRENDDOWN",style=shape.triangledown,text="TDOWN",color=red,textcolor=red,location=location.abovebar)
alertcondition(setA, title="trend+", message="TREND UP")
alertcondition(setB, title="trend-", message="TREND DOWN")
  • 0
  • 0
anonymous タイトルなし
Python
//@version=3
study(title="GBP/USD TREND", shorttitle="GUT")

//GBP/USD
hline(50)
gbpaud = security("GBPAUD", period, rsi(close, 26))
gbpcad = security("GBPCAD", period, rsi(close, 26))
gbpchf = security("GBPCHF", period, rsi(close, 26))
gbpjpy = security("GBPJPY", period, rsi(close, 26))
gbpeur = security("GBPEUR", period, rsi(close, 26))
gbpnzd = security("GBPNZD", period, rsi(close, 26))
gbpusd = security("GBPUSD", period, rsi(close, 26))

usdaud = security("USDAUD", period, rsi(close, 26))
usdcad = security("USDCAD", period, rsi(close, 26))
usdchf = security("USDCHF", period, rsi(close, 26))
usdjpy = security("USDJPY", period, rsi(close, 26))
usdeur = security("USDEUR", period, rsi(close, 26))
usdgbp = security("USDGBP", period, rsi(close, 26))
usdnzd = security("USDNZD", period, rsi(close, 26)) 
//ADX TREND
adxlen = input(14, title="ADX")
dilen = input(14, title="DI")
thold = input(20, title="Threshold")

threshold = thold

dirmov(len) =>
    up = change(high)
    down = -change(low)
    truerange = rma(tr, len)
    plus = fixnan(100 * rma(up > down and up > 0 ? up : 0, len) / truerange)
    minus = fixnan(100 * rma(down > up and down > 0 ? down : 0, 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)
    [adx, plus, minus]

[sig, up, down] = adx(dilen, adxlen)

osob=input(40,title="Exhaustion Level for ADX, default = 40")


col = sig >= sig[1] ? green : sig <= sig[1] ? red : gray 

//coler&signal
plot(avg(gbpaud, avg(gbpcad, gbpchf, gbpjpy, gbpeur, gbpnzd, gbpusd)), "GBP", blue)
plot(avg(usdaud, avg(usdcad, usdchf, usdjpy, usdeur, usdgbp, usdnzd)), "USD", orange)
trender = (sig >= up or sig >= down) ? 1 : 0
bgcolor(trender>0?purple:na, transp=93)
  • 0
  • 0
あなたもコードを投稿しませんか?
投稿する