밈 리얼리티 레이어

오픈소스 차트 엔진

밈 리얼리티 레이어

피드가 보여 주는 것과 실제 체결을 구분합니다. 인덱서가 스왑이 없는 분을 채운 봉은 속이 빈 봉으로, 페이지가 잘못된 체결로 보고 잘라 낸 꼬리는 양 끝에 짧은 가로선을 그리고 툴팁에 원래 값을 보여 줍니다(setBarFlags). 추적 중인 지갑 16개의 상위 300건 체결은 아바타로 표시하고 봉을 가로질러 묶습니다(markerCluster). "+k" 배지를 클릭하면 해당 봉 구간으로 확대하고, 아바타를 클릭하면 이벤트가 돌려주는 마커 객체로 그 지갑의 카드를 엽니다. 내 체결은 실제 체결가에 표시합니다(atPrice). 모든 데이터는 합성 데이터입니다.

Apache-2.0

밈 리얼리티 레이어: 밈코인과 지갑 예제

setBarFlags · markerCluster · position: 'atPrice' · chart.on('click') · markerHover

코드
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 to = Math.floor(Date.now() / 60_000) * 60_000; // the last whole minute
const from = to - 120 * 60_000;
const range = 'symbol=MEME&from=' + from + '&to=' + to;
const bars = await fetch('/api/bars?interval=1m&' + range).then((r) => r.json());
const trades = await fetch('/api/trades?' + range).then((r) => r.json());
const n = bars.time.length;
// A feed is not the market (synthetic here): the indexer fills quiet minutes
// with flat bars, and a few bad prints leave absurd wicks.
const quiet = [...bars.volume].sort((a, b) => a - b)[Math.floor(n * 0.06)];
const filled = bars.time.map((_, i) => i > 0 && bars.volume[i] <= quiet);
filled.forEach((f, i) => { if (f) bars.open[i] = bars.high[i] = bars.low[i] = bars.close[i] = bars.close[i - 1]; });
[n - 96, n - 58, n - 21].forEach((i, k) => { filled[i] = false; if (k === 1) bars.low[i] *= 0.45; else bars.high[i] *= 1.8; });
// Clip wicks longer than 3 median ranges past the body; keep the raw prints.
const cap = 3 * bars.high.map((h, i) => h - bars.low[i]).sort((a, b) => a - b)[n >> 1];
const raw = new Map(); // bar index -> [high, low] as printed
for (let i = 0; i < n; i++) {
  const top = Math.max(bars.open[i], bars.close[i]) + cap, bottom = Math.min(bars.open[i], bars.close[i]) - cap;
  if (bars.high[i] <= top && bars.low[i] >= bottom) continue;
  raw.set(i, [bars.high[i], bars.low[i]]);
  bars.high[i] = Math.min(bars.high[i], top);
  bars.low[i] = Math.max(bars.low[i], bottom);
}
const candles = chart.addCandlestickSeries({ markerCluster: 36 }); // one avatar and "+k" per 36 px
candles.setData(bars);
candles.setBarFlags(bars.time.flatMap((time, i) => (filled[i] || raw.has(i) ? [{ time, filled: filled[i], clipped: raw.has(i) }] : [])));
// 16 tracked wallets (synthetic) and the 300 largest trades, attributed to them.
const wallets = ['moonboy', 'gm_capital', 'ape_lord', 'sigma.sol', 'wenlambo', 'quiet_whale', 'degen_daily', 'early_bird',
  'chart_wizard', 'delta_fund', 'pump_watch', 'cold_wallet', 'meme_queen', 'alpha_desk', 'ngmi_labs', 'flow_reader']
  .map((name, i) => ({ name, kind: i % 2 ? 'Smart' : 'KOL', icon: 'w' + (i + 1), buys: 0, sells: 0, n: 0 }));
await Promise.all(wallets.map((w, i) => chart.registerIcon(w.icon, '/avatars/w' + String(i + 1).padStart(2, '0') + '.png')));
const fills = trades.time
  .map((time, i) => ({ time, price: trades.price[i], usd: trades.price[i] * trades.size[i], buy: trades.side[i] > 0, wallet: wallets[(i * 7 + 3) % 16] }))
  .sort((a, b) => b.usd - a.usd)
  .slice(0, 300);
fills.forEach((f) => { f.wallet.n++; f.wallet[f.buy ? 'buys' : 'sells'] += f.usd; });
// Each marker carries its fill: events hand back the very object.
const markers = fills.map((fill, i) => ({
  id: i + 1, fill, time: fill.time, position: fill.buy ? 'belowBar' : 'aboveBar', icon: fill.wallet.icon, size: 18,
  color: '#1b1f2a', border: fill.buy ? '#2ee6b6' : '#ff5d73', borderWidth: fill.wallet.kind === 'Smart' ? 3 : 1.5,
}));
// Your own fills, at the price they executed (never clustered).
[0.2, 0.45, 0.7, 0.9].forEach((q, k) => {
  const i = Math.floor(q * trades.time.length), buy = k % 2 === 0;
  markers.push({ id: 1000 + k, mine: true, time: trades.time[i], position: 'atPrice', price: trades.price[i], shape: 'square',
    label: 'ME', size: 16, color: buy ? '#2ee6b6' : '#ff5d73', text: (buy ? 'buy ' : 'sell ') + trades.price[i].toPrecision(4) });
});
candles.setMarkers(markers.sort((a, b) => a.time - b.time));
// Tooltips (hovered marker or flagged bar) and a wallet card (clicked avatar).
const usd = (v) => (v >= 1e6 ? '$' + (v / 1e6).toFixed(1) + 'M' : '$' + (v / 1e3).toFixed(0) + 'k');
let mark = null, bar = null, card = null; // tooltips of a marker and a flagged bar, a wallet card
const box = (ctx, x, y, rows) => {
  const width = 16 + Math.max(...rows.map((r) => ctx.textWidth(r, 11)));
  const height = 10 + rows.length * 16; // kept inside the plot
  x = Math.max(ctx.rect.x, Math.min(x, ctx.rect.x + ctx.rect.width - width));
  y = Math.max(ctx.rect.y, Math.min(y, ctx.rect.y + ctx.rect.height - height));
  return [{ type: 'rect', x, y, width, height, color: 'rgba(17, 20, 28, 0.92)' },
    ...rows.map((text, i) => ({ type: 'text', x: x + 8, y: y + 5 + i * 16, text, size: 11, color: i ? '#e6ebf5' : '#8a93a6' }))];
};
const layer = chart.addLayer({ pane: 0, position: 'overlay', build: (ctx) => {
  const tip = mark ?? bar;
  return [...(card ? box(ctx, ctx.rect.x + 10, ctx.rect.y + 10, card) : []),
    ...(tip ? box(ctx, tip.x + 14, tip.y - 20, tip.rows) : [])];
} });
chart.on('markerHover', (e) => {
  const f = e?.marker.fill;
  mark = !e ? null : { x: e.x, y: e.y, rows:
    e.overflow ? [e.overflow + ' more trades', 'over ' + (e.bars.to - e.bars.from + 1) + ' min, click to zoom']
    : e.marker.mine ? ['your fill', e.marker.text]
    : [f.wallet.name + ' (' + f.wallet.kind + ')', (f.buy ? 'buy ' : 'sell ') + usd(f.usd) + ' at ' + f.price.toPrecision(4)] };
  chart.invalidateLayer(layer);
});
chart.on('crosshairMove', ({ point }) => {
  const i = point ? Math.round(point.logicalIndex) : -1, w = raw.get(i);
  const next = w ? ['wick clipped', 'printed high ' + w[0].toPrecision(4) + ', low ' + w[1].toPrecision(4)]
    : filled[i] ? ['filled bar', 'no swaps this minute'] : null;
  if (next || bar) { bar = next && { x: point.x, y: point.y, rows: next }; chart.invalidateLayer(layer); }
});
chart.on('click', (e) => {
  const t = e.target;
  if (t?.type === 'markerOverflow') return chart.setVisibleLogicalRange(t.bars.from - 10, t.bars.to + 10);
  const w = t?.type === 'marker' && t.marker.fill?.wallet;
  card = w ? [w.name + ' (' + w.kind + ')', w.n + ' trades in 2h', 'bought ' + usd(w.buys) + ', sold ' + usd(w.sells), 'net ' + (w.buys >= w.sells ? '+' : '-') + usd(Math.abs(w.buys - w.sells))] : null;
  chart.invalidateLayer(layer);
});
chart.setBarSpacing(8);
chart.scrollToRealtime();

틱 단위 데이터를 위해 만들었습니다.

Apple M4 Max · Chrome + WebGPU

브라우저에서 100만 봉을 로드하고 첫 프레임을 그리기까지

WASM · WebGPU

네이티브로 1,000만 봉 로드(LOD 피라미드 포함)

네이티브 Rust

이동, 확대·축소, 스트리밍 중 프레임당 힙 할당

정상 상태

WebAssembly 패키지 크기(gzip)

전체 기능 포함

브라우저 수치는 Google Chrome + WebGPU, 1,000만 봉 로드는 네이티브 Rust 기준입니다. 막대는 각 수치를 목표 대비 비율로 보여 줍니다(로드 300ms, 할당 없음, 패키지 1.5MB).

예제

313개의 예제,
20개의 활용 사례.

모든 예제는 FerroChart가 브라우저에서 실시간으로 그리는 차트이며 소스 코드가 함께 제공됩니다. 모든 데이터는 합성 데이터입니다.

봉 리플레이
실시간 스트림
캔들스틱 + 거래량
01

가격 차트

예제 25개 →

모든 시장의 캔들, 봉, 라인 차트를 실시간 스트리밍으로 보여 줍니다.

호가 히트맵
델타 풋프린트
풋프린트
04

오더플로우

예제 20개 →

풋프린트, 호가 히트맵, 마켓 프로파일을 컴퓨트 셰이더 경로로 처리합니다.

내재 변동성 · 베이시스
롱/숏 비율 · CVD
펀딩비 · 미결제약정 · 청산
06

암호화폐 파생상품

예제 15개 →

펀딩비, 미결제약정, 청산, 베이시스를 가격 아래 패널에 표시합니다.

리스크 리버설 · 버터플라이
만기까지 예상 변동폭
내재 대 실현 변동성 · IV 랭크
12

옵션과 변동성

예제 18개 →

내재 변동성 대 실현 변동성, 스큐, 예상 변동폭, 딜러 익스포저를 시간에 따라 보여 줍니다.

동시 낙폭
언더워터 곡선 · 최대 낙폭
자산 곡선 · 낙폭
16

포트폴리오, 리스크, 퀀트

예제 24개 →

자산 곡선, 낙폭, 롤링 통계, 팩터 연구, 리스크 점검.

그룹 컬럼
누적 컬럼
100% 누적 영역
19

커스텀 시리즈와 플러그인

예제 11개 →

누적, 그룹, 박스, 브러시 시리즈: 같은 GPU 프레임 위에 레이어 플러그인을 얹습니다.

활용 사례 20개 모두 보기

가격 차트

봉 유형과 변환

기술적 분석

오더플로우

체결과 매매 복기

암호화폐 파생상품

온체인

DeFi와 AMM

밈코인과 지갑

주식과 펀더멘털

중국 A주

옵션과 변동성

금리, 외환, 매크로

선물과 원자재

펀드와 ETF

포트폴리오, 리스크, 퀀트

사모 시장과 개인 재무

예측 시장

커스텀 시리즈와 플러그인

실험실과 대표 예제

기능

시장 데이터를 위해 설계했습니다.

01

크로스 플랫폼 렌더링

하나의 Rust 코어로 브라우저에서는 WebGPU와 WebGL2, 네이티브 앱에서는 wgpu로 Metal, Vulkan, DirectX 12, 서버에서는 CPU 렌더러를 사용합니다. 골든 이미지 테스트로 백엔드 간 출력을 일치시킵니다.

02

데이터 크기와 무관한 성능

봉 데이터는 GPU에 머물고 좌표 변환은 셰이더에서 처리하므로 이동과 확대·축소 시 몇 개의 uniform만 갱신합니다. LOD 피라미드 덕분에 수천만 봉도 부드럽게 다룹니다.

03

30개 내장 지표

SMA부터 일목균형표까지 이동평균, 채널, 오실레이터. 틱마다 증분 방식으로 갱신되며 참조 데이터로 검증합니다.

04

29개 드로잉 도구

추세선, 채널, 피보나치 도구, 피치포크, 갠 팬, 패턴, 엘리어트 파동, 범위, 포지션, 텍스트를 실행 취소·다시 실행과 함께 제공합니다. 드로잉과 차트 상태는 JSON으로 직렬화됩니다.

05

차트 동기화

동기화 그룹으로 여러 차트의 크로스헤어와 표시 범위를 연동합니다.

06

확장성

사용자 정의 시리즈, 레이어, 드로잉 도구를 위한 플러그인 인터페이스. JavaScript, Rust, Python 바인딩과 C#, C++, Qt, Flutter용 C ABI를 제공합니다.

시작하기

모든 언어에서 하나의 API.

모든 바인딩은 같은 모델을 따릅니다. 차트를 만들고, 시리즈를 추가하고, 데이터를 설정하고, 지표를 추가합니다. 데이터는 타입 배열, Rust 슬라이스, DataFrame에서 열 단위로 전달합니다.

  • JavaScript · TypeScript
  • Rust
  • Python · Jupyter
  • C, C#, C++
문서 읽기
main.js
$ npm install @ferrochart/core
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

FerroChart

모든 시장.
모든 화면.
하나의 엔진.

Apache-2.0 오픈소스. 브라우저부터 트레이딩 데스크까지.