MartinShkreIi

BTC Volume Contango Index

MartinShkreIi ที่อัปเดต:   
Based on my previous script "BTC Contango Index" which was inspired by a Twitter post by Byzantine General:

This is a script that shows the contango between spot and futures volumes of Bitcoin to identify overbought and oversold conditions. When a market is in contango, the volume of a futures contract is higher than the spot volume. Conversely, when a market is in backwardation, the volume of the futures contract is lower than the spot volume.

The aggregate daily volumes on top exchanges are taken to obtain Total Spot Volume and Total Futures Volume. The script then plots (Total Futures Volume/Total Spot Volume) - 1 to illustrate the percent difference (contango) between spot and futures volumes of Bitcoin. This data by itself is useful, but because aggregate futures volumes are so much larger than spot volumes, no negative values are produced. To correct for this, the Z-score of contango is taken. The Z-score (z) of a data item x measures the distance (in standard deviations StdDev) and direction of the item from its mean (U):

Z-score = (x - U) / StDev

A value of zero indicates that the data item x is equal to the mean U, while positive or negative values show that the data item is above or below the mean (x Values of +2 and -2 show that the data item is two standard deviations above or below the chosen mean, respectively, and over 95.5% of all data items are contained within these two horizontal references). We substitute x with volume contango C, the mean U with simple moving average ( SMA ) of n periods (50), and StdDev with the standard deviation of closing contango for n periods (50), so the above formula becomes: Z-score = (C - SMA (50)) / StdDev(C,50).

When in contango, Bitcoin may be overbought.
When in backwardation, Bitcoin may be oversold.

The current bar calculation will always look incorrect due to TV plotting the Z-score before the bar closes.
เอกสารเผยแพร่:
Changed the contango calculation to instead include the On Balance Volume of aggregate spot and futures exchanges.

Contango = (Futures OBV / Spot OBV) - 1

Also changed the sma period (n) in the Z-score calculation to 20.
เอกสารเผยแพร่:
Updated to show real-time data - just select your current timeframe in the dropdown menu.
เอกสารเผยแพร่:
Added more markets to aggregate volume from. Also added an option to use regular volume in the calculation, just click the box in the menu.
เอกสารเผยแพร่:
Added options in the menu to select which exchanges are included in the calculation.
เอกสารเผยแพร่:
Simplified the code. Because of the logic, some exchanges are paired - may find a way to unpair them later.
เอกสารเผยแพร่:
Repaired the three paired exchanges so they make more sense:

Coinbase/Deribit --> Coinbase/Bitmex
Bitfinex/Bitmex --> Bitfinex/Bybit
Bitstamp/Bybit --> Bitstamp/Deribit
เอกสารเผยแพร่:
Removed the timeframe input to simplify the script.

สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?