オープンソースのチャートエンジン
執行ミラー
デスク向けのリプレイミラーです。自分たちの約定(空色)を、前後1時間以内に得られた最良価格(琥珀色、差をbpsで表示)と、情報に通じた口座の約定(ピンクの点)と比べます。レイヤープラグインが比較線を描画します。
執行ミラー:ラボとフラッグシップのサンプル
addLayer · setMarkers
コード
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 bars = await fetch('/api/bars?symbol=BTCUSD&interval=15m&count=400').then((r) => r.json());
const mine = await fetch('/api/events/myFills?symbol=BTCUSD&interval=15m&count=400').then((r) => r.json());
const smart = await fetch('/api/events/smartFills?symbol=BTCUSD&interval=15m&count=400').then((r) => r.json());
const candles = chart.addCandlestickSeries();
candles.setData(bars);
const index = (t) => bars.time.findIndex((x) => x >= t);
// For each of our fills (at the bar's close): the best price within an hour either side.
const fills = mine.time.map((time, k) => {
const i = index(time), buy = mine.value[k] >= 0;
let best = i;
for (let j = Math.max(0, i - 4); j <= Math.min(bars.time.length - 1, i + 4); j++) {
if (buy ? bars.low[j] < bars.low[best] : bars.high[j] > bars.high[best]) best = j;
}
const price = bars.close[i], bestPrice = buy ? bars.low[best] : bars.high[best];
return { i, best, buy, price, bestPrice, bps: (Math.abs(price - bestPrice) / price) * 1e4 };
});
candles.setMarkers([
...fills.map((f) => ({ time: bars.time[f.i], position: f.buy ? 'belowBar' : 'aboveBar', shape: f.buy ? 'arrowUp' : 'arrowDown', color: '#4cc9f0', text: f.buy ? 'B' : 'S' })),
...smart.time.map((time, k) => ({ time, position: smart.value[k] >= 0 ? 'belowBar' : 'aboveBar', shape: 'circle', color: '#e879f9' })),
].sort((a, b) => a.time - b.time));
// Lines from each fill to the best price nearby, with the gap in bps.
chart.addLayer({
pane: chart.mainPane,
build(ctx) {
const out = [];
for (const f of fills) {
const x1 = ctx.timeToX(bars.time[f.i]), x2 = ctx.timeToX(bars.time[f.best]);
const y1 = ctx.priceToY(f.price), y2 = ctx.priceToY(f.bestPrice);
if (x1 === null || x2 === null || y1 === null || y2 === null) continue;
out.push(
{ type: 'line', x1, y1, x2, y2, color: '#ffb547', dash: 'dashed', width: 1.5 },
{ type: 'icon', x: x1, y: y1, shape: 'circle', size: 7, color: '#4cc9f0' },
{ type: 'icon', x: x2, y: y2, shape: 'circle', size: 7, color: '#ffb547' },
{ type: 'text', x: x2 + 6, y: y2, text: `${f.bps.toFixed(0)} bps`, color: '#ffb547', size: 10, align: 'left' },
);
}
return out;
},
});
chart.setBarSpacing(13);
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