RicardoSantos

[RS]Triangular Arbitrage V0

42
oops, looks like i messed up, need to rework a few thing and repost later.
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?
study(title='[RS]Triangular Arbitrage V0', overlay=false)
src = input(title='Source series to compare:', type=source, defval=close)

instrument01 = security(input(title='Source of the 1st Instrument:', defval='EURUSD', type=symbol), period, src)
instrument02 = security(input(title='Source of the 1st Instrument:', defval='GBPUSD', type=symbol), period, src)
instrument03 = security(input(title='Source of the 1st Instrument:', defval='EURGBP', type=symbol), period, src)

_A = instrument03 * instrument02
_B = (1/instrument03) * instrument01
_C = instrument01 * (1/instrument02)

TriArb = _A-(_C*_B)

plot(title='Arbitrage', series=TriArb, style=columns, color=black, transp=75, trackprice=true)
plot(title='Real Change', series=offset(src[1]-src,1), style=histogram, color=black, trackprice=false, offset=-1)
hline(0, color=black)