Welcome to the BEST forum for traders

Did you know we're sharing tons of exclusive content here?
Our community is growing quickly. Take a look around and say "Hello".

Combining exchange volumes results in shortest history

Apr 21, 2022 - 3:16 AM

Viewed 362 times

https://best-trading-indicator.com/community/bti/forums/4180/topics/56472 COPY
  • Btcusd has longest timeline (pre-2017).
    Btcusdt has shortest timeline (beginning june 2021).
    When I try to combine all 3, it only shows the total of the shortest timeline.
    How can I get it to show longest timeline with everything combined??

    ###### THE SCRIPT

    //@version=4
    study(bitstamp BTC VOL TOTAL)

    btst = security(bitstamp:BTCUSD, timeframe.period, volume)
    btstc = security(bitstamp:BTCUSDC, timeframe.period, volume)
    btstt = security(bitstamp:BTCUSDT, timeframe.period, volume)
    btst1 = btst + btstc + btstt

    plot(title=allexchanges, series= btst1, style=plot.style_line, color=color.blue)

    Screenshot (13873).png

    0
  • Hi there

    Maybe try adding the barmerge.lookahead_on parameter
    Documentation: https://www.tradingview.com/pine-script-reference/v4/#fun_security

    0
  • Thanks for responding :)
    I tried lookahead with no luck then added gaps. also no luck.

    btst = security(bitstamp:BTCUSD, timeframe.period, volume, gaps=barmerge.gaps_on, lookahead=barmerge.lookahead_on)
    btstc = security(bitstamp:BTCUSDC, timeframe.period, volume, gaps=barmerge.gaps_on, lookahead=barmerge.lookahead_on)
    btstt = security(bitstamp:BTCUSDT, timeframe.period, volume, gaps=barmerge.gaps_on, lookahead=barmerge.lookahead_on)

    0
CONTENTS