PSC daily candle history and pixel candlestick chart

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZHU MINCHAOandClaude Opus 5.5 committed 2026-11-04 08:47:34 +08:00
1 parent 7b5080984a
commit b8308e1010
10 files changed
+271 -4

No files matched your search

+7 -1
View File
@@ -246,6 +246,8 @@ namespace Decentralized
if (_poinTab == PoinTab.Perp) { PerpPage(b); return; }
Columns(b, l =>
{
CandleChart.Add(l, "poin", d.Candles.Of(Assets.PSC));
l.AddSeparator();
l.AddHeader(L.T("poin.account.h"));
Holdings(l, w, a => true);
if (w.Taint > 0.5) l.AddLabel(L.T("wallet.taint", Fmt.Credits(w.Taint)));
@@ -310,6 +312,8 @@ namespace Decentralized
foreach (var p in PerpBook.Products)
l.AddLabel(L.T("perp.rate", p, Fmt.Num(PerpSpot(p)), (bk.Rate(p) * 100).ToString("+0.00;-0.00;0.00", CultureInfo.InvariantCulture)));
l.AddLabel(L.T("perp.fund", Fmt.Credits(bk.InsuranceFund)));
l.AddSeparator();
CandleChart.Add(l, "perp", d.Candles.Of(Assets.PSC));
}, r =>
{
r.AddHeader(L.T("perp.open"));
@@ -608,6 +612,8 @@ namespace Decentralized
l.AddHeader(L.T("predict.h"));
l.AddLabel(L.T("predict.acct", WalletWindow.NameOf(w), Fmt.Num(w.Avail(Assets.CRC))));
l.AddSeparator();
// 选中 PSC 价格盘时,在列表上方画日 K 和阈值线
if (sel != null && sel.Kind == PredictKind.Price) { CandleChart.Add(l, "predict", d.Candles.Of(Assets.PSC), sel.Param); l.AddSeparator(); }
if (open.Count == 0) l.AddLabel(L.T("predict.none"));
foreach (var m in open)
{
@@ -1707,7 +1713,7 @@ namespace Decentralized
if (w.Avail(pay) + 1e-9 < v) { _message = L.T(frozenPay(w, pay) ? "msg.frozen" : "msg.balance"); Open(); return; }
double before = p.Price;
double got = buy ? p.BuyBase(v) : p.SellBase(v);
if (p == Session.Data.Market.Main) { Session.Data.Market.PlayerPush += Math.Log(p.Price / before); Log.Info($"现货推价:累计 {Session.Data.Market.PlayerPush:0.000}"); }
if (p == Session.Data.Market.Main) { Session.Data.Market.PlayerPush += Math.Log(p.Price / before); Session.Data.Candles.Tick(Assets.PSC, StoreStation.GetDayCounter(), p.Price, v * Session.Price(pay), true); Log.Info($"现货推价:累计 {Session.Data.Market.PlayerPush:0.000}"); }
double spent = v * Session.Price(pay);
w.Add(pay, -v);
w.Add(get, got);