global: part X + 3

This commit is contained in:
nym21
2026-08-05 00:20:26 +02:00
parent 68e0eea88f
commit a8901b1097
82 changed files with 703 additions and 1088 deletions
+9 -8
View File
@@ -81,15 +81,16 @@ function createMaSubSection(label, averages) {
const more = averages.filter((a) => !includes(commonMaIds, a.id));
/** @param {MaPeriod} a */
const toFolder = (a) => ({
name: periodIdToName(a.id, true),
tree: simplePriceRatioTree({
const toChart = (a) => {
const name = periodIdToName(a.id, true);
const [chart] = simplePriceRatioTree({
pattern: a.ratio,
title: `${periodIdToName(a.id, true)} ${label}`,
title: `${name} ${label}`,
legend: "Average",
color: a.color,
}),
});
});
return { ...chart, name };
};
return {
name: label,
@@ -106,8 +107,8 @@ function createMaSubSection(label, averages) {
}),
),
},
...common.map(toFolder),
{ name: "More...", tree: more.map(toFolder) },
...common.map(toChart),
{ name: "More...", tree: more.map(toChart) },
],
};
}
@@ -1,7 +1,7 @@
import { brk } from "../../utils/client.js";
import { colors } from "../../utils/colors.js";
import { Unit } from "../../utils/units.js";
import { histogram } from "../series.js";
import { histogram, price } from "../series.js";
/**
* Create Capital Sentiment model section.
@@ -9,6 +9,30 @@ import { histogram } from "../series.js";
*/
export function createCapitalSentimentSection() {
const { capitalSentiment } = brk.series.models;
const { all, sth, lth } = brk.series.cohorts.utxo;
const sma = brk.series.market.movingAverage.sma._1y;
const references = () => [
price({
series: all.realized.capitalized.price,
name: "All",
color: colors.capitalized,
}),
price({
series: sth.realized.capitalized.price,
name: "STH",
color: colors.term.short,
}),
price({
series: lth.realized.capitalized.price,
name: "LTH",
color: colors.term.long,
}),
price({
series: sma,
name: "1Y SMA",
color: colors.time._1y,
}),
];
return {
name: "Capital Sentiment",
@@ -16,6 +40,7 @@ export function createCapitalSentimentSection() {
{
name: "Score",
title: "Capital Sentiment Score",
top: references(),
bottom: [
histogram({
series: capitalSentiment.score,
@@ -35,6 +60,7 @@ export function createCapitalSentimentSection() {
{
name: "Position",
title: "Capital Sentiment Position",
top: references(),
bottom: [
histogram({
series: capitalSentiment.isLong,
+2 -2
View File
@@ -325,9 +325,9 @@ export function createPartialOptions() {
{
name: "Models",
tree: [
createCapitalSentimentSection(),
createRarityMeterSection(),
createBedrockSection(),
createRarityMeterSection(),
createCapitalSentimentSection(),
],
},
],