Streaming

=CS.EXRATE()

In its simplest form, the CS.EXRATE function says =CS.EXRATE(asset symbol (base,quote), frequency interval you want it to refresh in seconds)

image

Scenario

Use =CS.EXRATE() when you need to stream real time or very frequently refreshed data. Common use cases are for traders who need up to the second pricing to monitor their positions or balance their risk. (Note: please be conscious of your account and API data quota limits when using this custom functions)

Function arguments

  1. Arguments:

    =CS.EXRATE("base","quote","refresh interval")

  2. Values:

    =CS.EXRATE("BTC","USDT","1")

    IMPORTANT: Using streaming functions may cause instability in workbooks depending on user's resources and if or when they makes large changes to live cells (ie deleting 50 cells with live pricing at the same time) - please exercise caution

Function argument descriptions

  • base: Identifier of the base symbol, ex. BTC (required)
  • quote: Identifier of the quote symbol, ex. USDT (required)
  • interval: Refresh interval defined in seconds, ex. 1 [(optional but required for streaming)]

Click to search for data providers and endpoints

image

Examples

  1. Example 1: Bitcoin price quoted in Tether w/ 1 second refresh

    =CS.EXRATE("BTC","USDT","1")

IMG

  1. Example 2: Bitcoin price quoted in Euro w/ 30 second refresh

    =CS.EXRATE("BTC","EUR","30")

  2. Example 3: multiple symbols quoted in USD vs USDT with calculated spreads (assumes user pastes values only into cell A1, then press F2 + enter)

    ={0,"USD","USDT","spread";"BTC","=CS.EXRATE(A2,$B$1,1)","=CS.EXRATE(A2,$C$1,1)","=C2-B2";"ETH","=CS.EXRATE(A3,$B$1,1)","=CS.EXRATE(A3,$C$1,1)","=C3-B3";"LTC","=CS.EXRATE(A4,$B$1,1)","=CS.EXRATE(A4,$C$1,1)","=C4-B4";"ETC","=CS.EXRATE(A5,$B$1,1)","=CS.EXRATE(A5,$C$1,1)","=C5-B5";"EOS","=CS.EXRATE(A6,$B$1,1)","=CS.EXRATE(A6,$C$1,1)","=C6-B6";"XRP","=CS.EXRATE(A7,$B$1,1)","=CS.EXRATE(A7,$C$1,1)","=C7-B7";"BNB","=CS.EXRATE(A8,$B$1,1)","=CS.EXRATE(A8,$C$1,1)","=C8-B8";"XLM","=CS.EXRATE(A9,$B$1,1)","=CS.EXRATE(A9,$C$1,1)","=C9-B9";"DASH","=CS.EXRATE(A10,$B$1,1)","=CS.EXRATE(A10,$C$1,1)","=C10-B10";"BCH","=CS.EXRATE(A11,$B$1,1)","=CS.EXRATE(A11,$C$1,1)","=C11-B11";"BTT","=CS.EXRATE(A12,$B$1,1)","=CS.EXRATE(A12,$C$1,1)","=C12-B12"}

image

  1. Example 4: multiple dynamic outputs w/ live heatmap chart

image

Troubleshooting

  1. Check your syntax for =CS.EXRATE() carefully, different functions for the same data may have slightly different required syntax

  2. Check the required arguments for =CS.EXRATE() vs the optional arguments

  3. Check your data & API quotas and limits

  4. Check your formulas carefully

  5. Check your relative references =CS.EXRATE("BTC","USDT", "1") vs. =CS.EXRATE("A1","B1","C1"))

  6. Use Excel's error checking tools

  7. Check Excel's help sections: https://support.office.com/en-us/article/function-arguments-65b29fb5-ec7b-4c0b-a54b-a67923571519

  8. Error Response Codes Reference

    • #N/A OK – Everything worked as expected
    • #BUSY Unauthorized – Your User/Password login credentials are stale or incorrect (try logging out then back in)
    • #LIMIT Forbidden – You are not subscribed to the data feed requested
    • #Symbol Not found Not available – double check the pair (base/quote combination) is valid
    • Other Something else? – Click here for full list of Excel error explanations

Additional Resources

=CS.EXRATE Tutorial in the Cryptosheets help center

For Microsoft Excel

For Googlesheets