TradingView
Spectrum101
2 Th12 2019 17:57

Longs Vs Shorts BTC - Open source 

Bitcoin / DollarBitfinex

Mô tả

Using percentage function to compare longs/shorts over a defined time window and smoothing (a dividor of the time window)
Bình luận
UnknownUnicorn2955934
I like this! Line 8 - line 9 gives a nice single line.
Spectrum101
@stluvin, Thanks
Spectrum101
//@version=3
study("longsshorts-delta")

shorts=security("btcusdshorts", period, close)
longs=security("btcusdlongs", period, close)
size = input(365,title="test window")
div = input(35,title='div window for sma')

a = ema(percentrank(longs,size),floor(size/div))
b = ema(percentrank(shorts,size),floor(size/div))

d = a-b

plot(a-b,style=area)

// copy paste to see the line 8 - line 9
gunbot_scooby
Does this only work with BTC or can i use it with stocks too?
Spectrum101
@gunbot_scooby, It uses btc shorts/longs ticker
Thêm nữa