Generate candlestick price charts for any asset from existing OHLC data, without handling data fetching.
npx skills add https://github.com/besoeasy/open-skills --skill generate-asset-price-chart
Render a candlestick chart image from preloaded OHLC candles. This skill focuses only on chart generation logic (no API calls).
canvasmatplotlibInstall:
# Node.js
npm install canvas
# Python
python -m pip install matplotlib
Input OHLC format expected by both examples:
[timestamp, open, high, low, close]timestamp can be unix ms or any x-axis label valueimport { createCanvas } from "canvas";
import { writeFile } from "node:fs/promises";
function validateOhlc(data) {
if (!Array.isArray(data) || data.length === 0) {
throw new Error("OHLC data must be a non-empty array");
}
data.forEach((row, index) => {
if (!Array.isArray(row) || row.length < 5) {
throw new Error(`Invalid row at index ${index}. Expected [timestamp, open, high, low, close]`);
}
const [, open, high, low, close] = row;
[open, high, low, close].forEach((v) => {
if (!Number.isFinite(v)) {
throw new Error(`Non-numeric OHLC value at row ${index}`);
}
});
});
}
function generateCandlestickChart(ohlcData, options = {}) {
validateOhlc(ohlcData);
const width = options.width ?? 1200;
const height = options.height ?? 600;
const padding = options.padding ?? 60;
const canvas = createCanvas(width, height);
const ctx = canvas.getContext("2d");
// Background
ctx.fillStyle = "#1e1e2e";
ctx.fillRect(0, 0, width, height);
const chartWidth = width - padding * 2;
const chartHeight = height - padding * 2;
const highs = ohlcData.map((d) => d[2]);
const lows = ohlcData.map((d) => d[3]);
const minPrice = Math.min(...lows);
const maxPrice = Math.max(...highs);
const priceRange = Math.max(maxPrice - minPrice, 1e-9);
const xStep = chartWidth / Math.max(ohlcData.length, 1);
const yScale = chartHeight / priceRange;
// Grid
ctx.strokeStyle = "#333";
ctx.lineWidth = 1;
for (let i = 0; i <= 5; i++) {
const y = padding + (chartHeight / 5) * i;
ctx.beginPath();
ctx.moveTo(padding, y);
ctx.lineTo(width - padding, y);
ctx.stroke();
}
// Candles
ohlcData.forEach(([, open, high, low, close], index) => {
const x = padding + index * xStep + xStep / 2;
const highY = height - padding - (high - minPrice) * yScale;
const lowY = height - padding - (low - minPrice) * yScale;
const openY = height - padding - (open - minPrice) * yScale;
const closeY = height - padding - (close - minPrice) * yScale;
const bullish = close >= open;
ctx.strokeStyle = bullish ? "#4caf50" : "#f44336";
ctx.fillStyle = ctx.strokeStyle;
// Wick
ctx.beginPath();
ctx.moveTo(x, highY);
ctx.lineTo(x, lowY);
ctx.stroke();
// Body
const bodyTop = Math.min(openY, closeY);
const bodyHeight = Math.max(Math.abs(openY - closeY), 2); // keep flat candles visible
const bodyWidth = Math.max(xStep * 0.6, 1);
ctx.fillRect(x - bodyWidth / 2, bodyTop, bodyWidth, bodyHeight);
});
return canvas.toBuffer("image/png");
}
// Example usage with existing OHLC array
const sample = [
[1700000000000, 100, 110, 95, 108],
[1700000600000, 108, 112, 104, 106],
[1700001200000, 106, 115, 103, 113],
[1700001800000, 113, 118, 109, 111],
[1700002400000, 111, 119, 110, 117],
];
const image = generateCandlestickChart(sample, { width: 1200, height: 600 });
await writeFile("candlestick.png", image);
console.log("Saved: candlestick.png");
You are generating a candlestick chart image from existing OHLC data only.
Do not fetch market data and do not add API logic.
Input format is an array of [timestamp, open, high, low, close].
Use either Node.js (canvas) or Python (matplotlib) to render candles with:
- dark background,
- simple horizontal grid,
- green bullish candles,
- red bearish candles,
- visible wick and body.
Return:
1) the code used,
2) output filename,
3) a short validation note (e.g., candle count rendered).
Module not found: canvas → run npm install canvaspython -m pip install matplotlibComprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like \"the xlsx in my downloads\") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.
Picks random winners from lists, spreadsheets, or Google Sheets for giveaways, raffles, and contests. Ensures fair, unbiased selection with transparency.
Query openFDA API for drugs, devices, adverse events, recalls, regulatory submissions (510k, PMA), substance identification (UNII), for FDA regulatory data analysis and safety research.
MATLAB and GNU Octave numerical computing for matrix operations, data analysis, visualization, and scientific computing. Use when writing MATLAB/Octave scripts for linear algebra, signal processing, image processing, differential equations, optimization, statistics, or creating scientific visualizations. Also use when the user needs help with MATLAB syntax, functions, or wants to convert between MATLAB and Python code. Scripts can be executed with MATLAB or the open-source GNU Octave interpreter.
UMAP dimensionality reduction. Fast nonlinear manifold learning for 2D/3D visualization, clustering preprocessing (HDBSCAN), supervised/parametric UMAP, for high-dimensional data.
Creating interactive data visualisations using d3.js. This skill should be used when creating custom charts, graphs, network diagrams, geographic visualisations, or any complex SVG-based data visualisation that requires fine-grained control over visual elements, transitions, or interactions. Use this for bespoke visualisations beyond standard charting libraries, whether in React, Vue, Svelte, vanilla JavaScript, or any other environment.
Access AlphaFold 200M+ AI-predicted protein structures. Retrieve structures by UniProt ID, download PDB/mmCIF files, analyze confidence metrics (pLDDT, PAE), for drug discovery and structural biology.
Take besoeasy/generate-asset-price-chart from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference pip, npm.
Without those the skill loads but fails at the first command.