Bitcoin Long-Short Position Sentiment Signals Using Z-Scores
Summary
This strategy uses the ratio of Bitcoin leveraged long positions to the combined total of long and short positions as a sentiment measure. It standardizes that ratio with a rolling Z-score, calculated from its moving average and standard deviation over a configurable lookback period. Threshold crossings trigger long entries and exits or short entries and exits, with settings to trade long, short, or both. The script plots the Z-score and reference levels for visual inspection.
The code includes default thresholds, a default lookback, and commission and slippage assumptions, but it reports no performance evidence. Its data symbols are explicitly described as placeholders, so usable long and short position series must be available and correctly mapped. The written explanation simplifies the signal rules; the code specifically uses crossovers and crossunders at separate entry and exit thresholds. Results therefore depend on data quality, threshold choices, and market conditions.
Key ideas
- The sentiment input is the share of leveraged Bitcoin positions that are long rather than short.
- A rolling Z-score measures how far the ratio is from its recent average in standard-deviation units.
- Threshold crossings govern entries and exits for configurable long, short, or two-sided trading.
- The code uses placeholder symbols for the long and short data series.
- No strategy performance results are provided, and signal behavior depends on data availability and settings.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.