@ausbitbank 's experimSteemUSD + SBDUSD multi-exchange indicator

Please see source code for basic instruction on usage
Send your appreciation / feedback to
오픈 소스 스크립트

진정한 TradingView의 정신에 따라, 이 스크립트의 작성자는 스크립트를 오픈소스로 게시했기에 거래자들이 이해하고 확인할 수 있습니다. 작가님께 건배! 스크립트를 무료로 사용할 수 있지만, 게시물에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 당신은 스크립트를 차트에 사용하기 위해 그것을 즐겨찾기 할 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?
// SteemUSD + SBDUSD multi-exchange experimental indicator
// Work in progress - Please send any feedback you have :)
study(title = "SteemUSD + SBDUSD multi-exchange indicator", shorttitle = "SteemUSD + SBDUSD multi-exchange indicator", overlay = false)

// Get user input on display preferences
displaysbd=input(title="Display SBD",type=bool,defval=true)
displaysteem=input(title="Display SteemUSD",type=bool,defval=true)
displayweeksteemavg=input(title="Display 1 week SteemUSD avg",type=bool,defval=true)
displayhalfweeksteemavg=input(title="Display half week SteemUSD avg",type=bool,defval=true)
displayexperimental=input(title="Display polosdbpeg*weeklyavgsteemusd [experiment]",type=bool,defval=true)

// Define all the BTC exchanges that matter
bitfinexbtcusd = security("BITFINEX:BTCUSD",period, close)
okcoinfutures3mbtcusd = security("OKCOIN:BTCUSD3M",period,high)
okcoinfutures1wbtcusd = security("OKCOIN:BTCUSD1W",period,close)
okcoinfutures2wbtcusd = security("OKCOIN:BTCUSD2W",period,close)
bitstampbtcusd = security("BITSTAMP:BTCUSD",period,close)
okcoincnyconvertedtobtcusd = security("OKCOIN:BTCCNY*CNYUSD",period,close)
btcebtcusd = security("BTCE:BTCUSD",period,low)

// Work out the average btc price
btctmptotal = bitfinexbtcusd+okcoinfutures3mbtcusd+okcoinfutures2wbtcusd+okcoinfutures1wbtcusd+bitstampbtcusd+okcoincnyconvertedtobtcusd+btcebtcusd
avgbtcusd = btctmptotal/7

// Define all the poloniex steem/sbd instruments - Tradingview needs to add bittrex..
polosteembtc = security("POLONIEX:STEEMBTC",period,close)
polosbdbtc = security("POLONIEX:SBDBTC",period, close)
polosbdpeg = (polosbdbtc*avgbtcusd)
// Not currently used but maybe handy for someone
//poloethbtc = security("POLONIEX:ETHBTC",period,close)
//poloethusd = (poloethbtc*avgbtcusd)
//poloetcbtc = security("POLONIEX:ETCBTC",period,close)
//poloetcusd = (poloetcbtc*avgbtcusd)

// Calculate the various possible SteemUSD rates
steemusdavg = (polosteembtc*avgbtcusd)
steemusd1 = (polosteembtc*bitfinexbtcusd)
steemusd2 = (polosteembtc*okcoinfutures3mbtcusd)
steemusd3 = (polosteembtc*okcoinfutures1wbtcusd)
steemusd4 = (polosteembtc*okcoinfutures2wbtcusd)
steemusd5 = (polosteembtc*bitstampbtcusd)
steemusd6 = (polosteembtc*okcoincnyconvertedtobtcusd)
steemusd7 = (polosteembtc*btcebtcusd)

//Color SteemUSD price + SBD average based on SBD's current usd value.
plotcolor = if polosbdpeg<1
    if polosbdpeg<0.9
        if polosbdpeg<0.8

// Get user input on how many periods = 1 week   - Need to work this out automatically if possible
//1weekhowmanyperiods=input(title="How many of the current period does it take to make 1 week - Default period is 1hr so 168 hrs is 1 week",type=integer,defval=168,minval=1,maxval=1000)

// Calculate average USD price of steem for last 7 days (168hrs)
weeklyavgperiods = 168
weeklyavgsteemusd = ema(steemusdavg,weeklyavgperiods)
// Half week EMA for detecting trend change
halfweeklyavgsteemusd = ema(steemusdavg,(weeklyavgperiods/2))

//Color SteemUSD weekly avg price : green = sell SBD , red = sell Steem (in theory, at the right price)
// If orange, take caution when using the delayed 1 week conversion process - Trend may be changing
plotcolor2 = if weeklyavgsteemusd>=halfweeklyavgsteemusd
    if steemusdavg<=halfweeklyavgsteemusd
// Plots SteemUSD with all of the different btc prices + avg
// Usual highest and lowest btc exchanges are marked aqua - other exchanges straying from these borders on higher timeframe could indicate a disturbance in the force 
plot(displaysteem and steemusd1 ? steemusd1 : na,color=plotcolor,linewidth=1,title="SteemUSD based on BitFinex")
p1 = plot(displaysteem and steemusd2 ? steemusd2 : na,color=aqua,linewidth=1,title="SteemUSD based on OKCoin 3 Month futures") // OKCoin 3 month futures would *normally* be highest price
plot(displaysteem and steemusd3 ? steemusd3 : na,color=plotcolor,linewidth=1,title="SteemUSD based on OKCoin 1 Week futures")
plot(displaysteem and steemusd4 ? steemusd4 : na,color=plotcolor,linewidth=1,title="SteemUSD based on OKCOIN 2 Week futures")
plot(displaysteem and steemusd5 ? steemusd5 : na,color=plotcolor,linewidth=1,title="SteemUSD based on Bitstamp")
plot(displaysteem and steemusd6 ? steemusd6 : na,color=plotcolor,linewidth=1,title="SteemUSD based on OKCoin CNY converted to USD")
p2 = plot(displaysteem and steemusd7 ? steemusd7 : na,color=aqua,linewidth=1,title="SteemUSD based on BTCE") // BTCE would *normally* be lowest price
plot(displaysteem and steemusdavg ? steemusdavg : na,color=plotcolor2,linewidth=1,style=cross,title="SteemUSD based on average BTC price")

// Fill in the background between usual highest and usual lowest price range - helps highlight outliers

// Plot SDB price

plot(displaysbd and polosbdpeg ? polosbdpeg : na,color=plotcolor,linewidth=2,title="Poloniex current sbd peg value")

// Markers for various SDB price points
//h1 = hline(1.1)
//h2 = hline(1)
//h3 = hline(0.9)
//h4 = hline(0.8)
//h5 = hline(0.7)
// Highlight background for SDB price points 

//1 SBD is convertable for $1usd worth of steem (based on 7 day avg, 7 days from triggering)
// Plot the weekly average steemusd price
plot(displayweeksteemavg and weeklyavgsteemusd ? weeklyavgsteemusd : na,color=plotcolor2,linewidth=2)
// Plot the half-weekly average steemusd price
plot(displayhalfweeksteemavg and halfweeklyavgsteemusd ? halfweeklyavgsteemusd : na,color=plotcolor2,linewidth=1)

// Experimental
plot(displayexperimental and experimental ? experimental : na,color=white,linewidth=1)


홈으로 스탁 스크리너 포렉스 스크리너 크립토 스크리너 이코노믹 캘린더 정보 차트 특징 프라이싱 프렌드 리퍼하기 하우스룰(내부규정) 헬프 센터 웹사이트 & 브로커 솔루션 위젯 차팅 솔루션 라이트웨이트 차팅 라이브러리 블로그 & 뉴스 트위터