オープンソースのチャートエンジン
決着までのタイムライン
ある市場の最後の10日間です。取引、結果の提案、異議申し立て、48時間の投票、そして支払いと進みます。レイヤープラグインが各フェーズを網掛けしてラベルを付けます。Yes価格は決着の時点で止まり、そこでYesシェアに100が支払われます。
決着までのタイムライン:予測市場のサンプル
addLayer · ctx.timeToX · NaN gaps
コード
import { FerroChart } from '@ferrochart/core';
const canvas = document.querySelector('canvas');
// Market data: the synthetic FerroChart demo API. Use your own feed.
const chart = await FerroChart.create(canvas, { theme: 'dark' });
const market = await fetch('/api/series/predDispute?symbol=BTCUSD&interval=1h&count=240').then((r) => r.json());
const time = market.time, n = time.length, hour = 3_600_000;
// The market closed 84 hours ago; a proposal was disputed and went to a 48-hour vote.
const phases = [
{ from: 0, to: n - 84, label: 'Trading', fill: null },
{ from: n - 84, to: n - 82, label: 'Proposed: Yes', fill: 'rgba(76, 201, 240, 0.16)' },
{ from: n - 82, to: n - 80, label: 'Disputed', fill: 'rgba(255, 93, 115, 0.18)' },
{ from: n - 80, to: n - 32, label: 'Vote', fill: 'rgba(179, 136, 255, 0.14)' },
{ from: n - 32, to: n, label: 'Resolved: Yes', fill: 'rgba(46, 230, 182, 0.12)' },
].map((p) => ({ ...p, start: time[p.from], end: p.to < n ? time[p.to] : time[n - 1] + hour }));
// Prices until resolution; settled shares no longer trade.
const resolved = phases[4].start;
const yes = chart.addSeries('line', { color: '#facc15', lineWidth: 2, pricePrecision: 0 });
yes.setData({ time, value: market.yes.map((p, i) => (time[i] < resolved ? p * 100 : NaN)) });
chart.applyPriceScaleOptions({ range: { low: 0, high: 100 }, margins: { top: 0.02, bottom: 0.02 } });
chart.addLayer({
pane: chart.mainPane,
position: 'background',
build(ctx) {
const out = [];
const top = ctx.rect.y, bottom = ctx.rect.y + ctx.rect.height, right = ctx.rect.x + ctx.rect.width;
phases.forEach((p, row) => {
const x1 = ctx.timeToX(p.start), x2 = ctx.timeToX(p.end);
if (x1 === null || x2 === null || x2 < ctx.rect.x || x1 > right) return;
if (p.fill) out.push({ type: 'rect', x: x1, y: top, width: x2 - x1, height: bottom - top, color: p.fill });
out.push({ type: 'line', x1, y1: top, x2: x1, y2: bottom, color: 'rgba(139, 147, 167, 0.5)', width: 1, dash: 'dotted' });
// One label row per phase, so that the short phases don't overlap.
const y = top + 8 + (row % 4) * 20;
out.push({ type: 'text', x: Math.max(x1, ctx.rect.x) + 6, y, text: p.label, color: '#d7dce5', size: 11, background: 'rgba(11, 13, 18, 0.75)', padding: 3 });
});
return out;
},
});
chart.setBarSpacing(4.2);
chart.scrollToRealtime();ティック単位のデータのために。
Apple M4 Max · Chrome + WebGPUブラウザで 100 万本の足を読み込み、最初のフレームを描画
WASM · WebGPU
ネイティブで 1,000 万本の足を読み込み(LOD ピラミッド構築を含む)
ネイティブ Rust
パン、ズーム、ストリーミング中のフレームあたりのヒープアロケーション
定常状態
WebAssembly パッケージのサイズ(gzip)
全機能込み
ブラウザの数値は Google Chrome + WebGPU、1,000 万本の読み込みはネイティブ Rust での計測です。バーは各数値の目標に対する割合を示します(読み込み 300 ms、アロケーションなし、パッケージ 1.5 MB)。
サンプル
313 のサンプル、
20 のユースケース。
どのサンプルも FerroChart がブラウザ上でリアルタイムに描画するチャートで、ソースコード付きです。データはすべて合成データです。



プライスアクション
25 件のサンプル →あらゆる市場のローソク足、バー、ラインをリアルタイムでストリーミング表示します。



オーダーフロー
20 件のサンプル →フットプリント、板のヒートマップ、マーケットプロファイルをコンピュートシェーダーで描画します。



暗号資産デリバティブ
15 件のサンプル →資金調達率、建玉、清算、ベーシスを価格の下のペインに表示します。



オプションとボラティリティ
18 件のサンプル →インプライド対実現ボラティリティ、スキュー、予想変動幅、ディーラーのエクスポージャーを時系列で表示します。



ポートフォリオ・リスク・クオンツ
24 件のサンプル →資産曲線、ドローダウン、ローリング統計、ファクターリサーチ、リスクチェックを扱います。



カスタムシリーズとプラグイン
11 件のサンプル →積み上げ、グループ、箱ひげ、ブラシ選択のシリーズを、同じGPUフレーム上のレイヤープラグインで描画します。
20 のユースケースをすべて見る
プライスアクション
足の種類と変換
テクニカル分析
オーダーフロー
執行とトレードレビュー
暗号資産デリバティブ
オンチェーン
DeFiとAMM
ミームコインとウォレット
株式とファンダメンタルズ
中国A株
オプションとボラティリティ
金利・為替・マクロ
先物とコモディティ
ファンドとETF
ポートフォリオ・リスク・クオンツ
プライベート市場と個人の資産管理
予測市場
カスタムシリーズとプラグイン
ラボとフラッグシップ
ローソク足と出来高
1 / 25The classic view. A day of real one-minute bars, updating every second, on a GPU-rendered price scale with a volume histogram below. Drag to pan, scroll or pinch to zoom.
FerroChart.createaddCandlestickSeriesaddVolumeSeriesドラッグでパン · ホイールまたはピンチでズーム · ダブルクリックでリセットリアルタイムデータ · OKXcandles
特長
市場データのための設計。
クロスプラットフォームの描画
ひとつの Rust コアで、ブラウザでは WebGPU と WebGL2、ネイティブアプリでは wgpu により Metal、Vulkan、DirectX 12、サーバーでは CPU レンダラーを使います。ゴールデンイメージテストで各バックエンドの出力を揃えています。
データ量に左右されない性能
足のデータは GPU 上に置かれ、座標変換はシェーダーで行うため、パンやズームでは少数の uniform を更新するだけです。LOD ピラミッドにより数千万本の足でも軽快に動きます。
30 の組み込みインジケーター
SMA から一目均衡表まで、移動平均、チャネル、オシレーター。値はティックごとにインクリメンタルに更新され、参照データでテストされています。
29 の描画ツール
トレンドライン、チャネル、フィボナッチ、ピッチフォーク、ギャンファン、パターン、エリオット波動、レンジ、ポジション、テキスト。元に戻す・やり直しに対応し、描画とチャートの状態は JSON に保存できます。
チャートの同期
同期グループで、複数のチャートのクロスヘアと表示範囲を連動させます。
拡張性
カスタムシリーズ、レイヤー、描画ツールのためのプラグインインターフェース。JavaScript、Rust、Python のバインディングと、C#、C++、Qt、Flutter 向けの C ABI を提供します。
はじめる
どの言語でも、同じ API。
どのバインディングも同じモデルです。チャートを作成し、シリーズを追加し、データを設定し、インジケーターを追加します。データは型付き配列、Rust のスライス、DataFrame から列として渡します。
- JavaScript・TypeScript
- Rust
- Python・Jupyter
- C、C#、C++
import { FerroChart } from '@ferrochart/core';
const chart = await FerroChart.create(canvas, { theme: 'dark' });
const candles = chart.addCandlestickSeries();
chart.addVolumeSeries(candles);
candles.setData(bars); // [{ time, open, high, low, close, volume }, ...]
chart.addIndicator(candles, 'ema', { n: 20 });
chart.addIndicator(candles, 'macd'); // in a new pane