<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[SignalStates]]></title><description><![CDATA[SignalStates]]></description><link>https://signalstates.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Nov 2026 12:37:07 GMT</lastBuildDate><atom:link href="https://signalstates.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to Calculate Your Average Price in Crypto (With the Arithmetic Shown)]]></title><description><![CDATA[The average-price formula for multi-buy positions, why equal-amount buys land below the simple average, and how much to buy to hit a target average.]]></description><link>https://signalstates.hashnode.dev/how-to-calculate-your-average-price-in-crypto-with-the-arithmetic-shown</link><guid isPermaLink="true">https://signalstates.hashnode.dev/how-to-calculate-your-average-price-in-crypto-with-the-arithmetic-shown</guid><category><![CDATA[trading, ]]></category><category><![CDATA[Bitcoin]]></category><category><![CDATA[crypto]]></category><dc:creator><![CDATA[signal States]]></dc:creator><pubDate>Mon, 26 Oct 2026 17:04:05 GMT</pubDate><content:encoded><![CDATA[<p>When you build a position in several buys instead of one, the number that decides your break-even is not any single buy price. It is the <strong>average price</strong>: total cost divided by total quantity. Every later judgement — profit, loss, break-even — starts from it.</p>
<h2>The formula</h2>
<pre><code>average price = total cost ÷ total quantity
             = Σ(price × quantity) ÷ Σ quantity
</code></pre>
<p>Quantity bought for a fixed amount of USDT is that amount divided by the price, so each buy's quantity is already price-weighted. That is the whole mechanism: you are weighting each price by how much you bought at it, which a plain average of the prices does not do.</p>
<h2>A worked example</h2>
<p>Three buys of 500 USDT each, at 100, 95 and 90:</p>
<table>
<thead>
<tr>
<th>Buy</th>
<th>Price</th>
<th>Quantity for 500 USDT</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td>100</td>
<td>5.0000</td>
</tr>
<tr>
<td>2</td>
<td>95</td>
<td>5.2632</td>
</tr>
<tr>
<td>3</td>
<td>90</td>
<td>5.5556</td>
</tr>
</tbody></table>
<p>Total cost 1,500 USDT, total quantity 15.8188, so the average price is <strong>1,500 ÷ 15.8188 = 94.82</strong>. The simple average of the three prices is (100 + 95 + 90) ÷ 3 = 95.00. Equal-amount buys land <strong>below</strong> the simple average, because the same money buys more at lower prices. The further the prices spread, the wider that gap becomes.</p>
<blockquote>
<p>Fees are not in this mental arithmetic. Taker fees on each entry raise the real average a little; our <a href="https://signalstates.com/tools/average-price-calculator">average price calculator</a> applies the contract's live tick and step rules and shows the after-fee picture.</p>
</blockquote>
<h2>Pulling an average down to a target</h2>
<p>If you already hold a position and want a specific average, the required buy is:</p>
<pre><code>buy quantity = held × (average − target) ÷ (target − price)
</code></pre>
<p>It only works when the current price is <strong>below</strong> the target, and the target below the old average. Holding 10 coins at an average of 100, with price at 80 and a target average of 95: buy 10 × (100 − 95) ÷ (95 − 80) = <strong>3.33 coins</strong> (about 266.7 USDT). Check: (10 × 100 + 3.33 × 80) ÷ 13.33 = 95.0.</p>
<h2>What the arithmetic does not decide</h2>
<p>Averaging down makes the break-even closer and the average look better — by putting more money into a losing position. The formula says what a buy <em>does</em> to the average, never whether the buy is worth making. Size the trade against a loss you chose in advance with a <a href="https://signalstates.com/tools/position-size-calculator">position size calculator</a>, and keep the liquidation side of a leveraged average in view with a <a href="https://signalstates.com/tools/liquidation-price-calculator">liquidation price calculator</a>.</p>
<p><em>This guide also lives on SignalStates' <a href="https://signalstates.com/tools/learn">free learn hub</a> — the canonical version is there.</em></p>
]]></content:encoded></item><item><title><![CDATA[How we built a crypto Fear & Greed index from futures data, and what it can't tell you]]></title><description><![CDATA[Every crypto chart site quotes a Fear & Greed number. Few say what is inside it. We built one from the futures market's own daily prices and wrote the…]]></description><link>https://signalstates.hashnode.dev/how-we-built-a-crypto-fear-greed-index-from-futures-data-and-what-it-can-t-tell-you</link><guid isPermaLink="true">https://signalstates.hashnode.dev/how-we-built-a-crypto-fear-greed-index-from-futures-data-and-what-it-can-t-tell-you</guid><category><![CDATA[Cryptocurrency]]></category><category><![CDATA[Python]]></category><category><![CDATA[Data Science]]></category><category><![CDATA[Bitcoin]]></category><dc:creator><![CDATA[signal States]]></dc:creator><pubDate>Sat, 24 Oct 2026 17:26:28 GMT</pubDate><content:encoded><![CDATA[<p>Every crypto chart site quotes a Fear &amp; Greed number. Few say what is inside it. We built one from the futures market's own daily prices and wrote the method down so anyone can reproduce it. This post explains the four measures, the maths, how we checked it, and where it falls short.</p>
<h2>What goes in</h2>
<p>The index is the plain average of four scores. Each runs from 0 (extreme fear) to 100 (extreme greed), and each counts for 25%.</p>
<ol>
<li><strong>Volatility.</strong> Bitcoin's 30-day realised volatility: the standard deviation of its daily log returns, annualised. The score is 100 minus the percentile rank of today's value among the previous 365 days. Calm markets score high, turbulent ones low.</li>
<li><strong>Momentum.</strong> How far Bitcoin's close sits above or below the average of its last 90 closes, ranked against the previous 365 days in the same way.</li>
<li><strong>Breadth.</strong> The share of the 100 most traded altcoins whose close is above their own 30-day average. The share is the score.</li>
<li><strong>Appetite.</strong> The Altcoin Season Index: the share of those same coins that beat Bitcoin over 90 days.</li>
</ol>
<p>The bands are a convention: below 25 is extreme fear, 25 to 44 fear, 45 to 55 neutral, 56 to 74 greed, and 75 or more extreme greed.</p>
<h2>Why percentile ranks</h2>
<p>Volatility and momentum have no natural 0 to 100 scale. Ranking today's value against the past year gives them one, and it answers a useful question: is this unusual for this year? The cost is that a very quiet year makes ordinary moves look large, so the score says "high for this year", not "high".</p>
<h2>The maths in a few lines</h2>
<pre><code class="language-python">import math, statistics

def realised_vol(closes, n=30):
    """Annualised volatility in percent. `closes` are daily closes, oldest first."""
    returns = [math.log(closes[i + 1] / closes[i]) for i in range(len(closes) - n - 1, len(closes) - 1)]
    return statistics.stdev(returns) * math.sqrt(365) * 100

def momentum(closes, n=90):
    """Percent above (or below) the average of the last n closes."""
    return (closes[-1] / (sum(closes[-n:]) / n) - 1) * 100

def percentile_rank(value, sample):
    """Share of the sample below value, ties counting half, from 0 to 100."""
    below = sum(x &lt; value for x in sample)
    ties = sum(x == value for x in sample)
    return (below + 0.5 * ties) / len(sample) * 100

# volatility_score = 100 - percentile_rank(vol_today, vol_on_each_of_the_last_365_days)
# momentum_score   = percentile_rank(momentum_today, momentum_on_each_of_the_last_365_days)
# index            = (volatility_score + momentum_score + breadth + appetite) / 4
</code></pre>
<p>Only closed daily candles (UTC) are used, so the last point is the last completed day and a day's value never changes during the day. The history is recomputed from the same candles with the same rules.</p>
<h2>How we checked it</h2>
<p>We recomputed the Bitcoin measures independently from the raw daily closes and the scores matched to the decimal. The headline equals the mean of the four scores, and the appetite score equals the Altcoin Season Index for the same day. The maths has unit tests, including one that rebuilds the last day with a separate implementation.</p>
<h2>What it can't tell you</h2>
<ul>
<li><strong>It describes mood, not the next move.</strong> It is not a forecast and not a buy or sell signal. In the year to October 2026 the index spent 93 days in extreme fear and 3 in extreme greed. Extreme readings can last a long time.</li>
<li><strong>Calm is scored as greed.</strong> Quiet markets usually go with confidence, but quiet can also come before a sharp move, and the index cannot tell which.</li>
<li><strong>Two measures are relative to the past year.</strong> After a very quiet or very wild year, ordinary moves can look large or small.</li>
<li><strong>The coin list is today's.</strong> A coin that has since left the top 100 is not in the history, so older values carry survivorship.</li>
<li><strong>It is not the same as other Fear &amp; Greed indexes.</strong> Others add social media activity, surveys and search trends. This one uses only price data, so the numbers differ even though the idea is the same.</li>
</ul>
<h2>See it live</h2>
<p>The index, its one-year history with Bitcoin's price, a calendar of every day, and the full method are here, free and without an account: <a href="https://signalstates.com/tools/crypto-fear-and-greed-index">https://signalstates.com/tools/crypto-fear-and-greed-index</a></p>
<p><em>This is not financial advice. Leveraged trading can lose more than you put in.</em></p>
]]></content:encoded></item></channel></rss>