Is it possible to find RBIs of multiple exchanges based on one criterion?

Viewed 17

Here is an example of that MA cross code.

//@version=5
indicator(title="MA Cross", overlay=true, timeframe="", timeframe_gaps=true)

shortlen = input.int(9, "Short MA Length", minval=1)
longlen = input.int(21, "Long MA Length", minval=1)
short = ta.sma(close, shortlen)
long = ta.sma(close, longlen)

plot(short, color = #FF6D00)
plot(long, color = #43A047)

plot(ta.cross(short, long) ? short : na, color=#2962FF, style = plot.style_cross, linewidth = 4)

There is a slight difference when comparing binance and coinbase to their code.

(because the volume and price are slightly different)

Can I get a RBI on Coinbase based on a cross ma confirmed on Binance?

1 Answers

You can request data from different exchanges by using the request.security() function.

Below example requests the volume information from Binance and Coinbase. The ticker is the same BTCUSDT, only difference is the exchange.

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © vitruvius

//@version=5
indicator("My script", format=format.volume)

vol_binance = request.security("BINANCE:BTCUSDT", timeframe.period, volume)
vol_coinbase = request.security("COINBASE:BTCUSDT", timeframe.period, volume)

plot(vol_binance, color=color.green)
plot(vol_coinbase, color=color.red)

enter image description here

Related