Open source calculators and charts
Two small TypeScript packages with no dependencies, no tracking and no keys. The site runs on this exact code.
View on GitHub@tradinglore/calculators
Position size, risk-reward, stop-loss and pip value maths. Pure TypeScript, zero dependencies. The same code runs our free calculators.
npm install @tradinglore/calculatorsEstimate
20,000 units
Currency settings
Step-by-step working
- Money you accept losing10,000 x 1% = 100
- Distance from entry to stop|1.1 - 1.095| = 0.005
- Loss per unit if the stop fills (same currency)0.005 x 1 = 0.005
- Units to trade100 / 0.005 = 20,000
import { positionSize } from "@tradinglore/calculators";
const units = positionSize({
accountSize: 10_000,
riskPercent: 1,
entry: 1.1,
stop: 1.095,
direction: "long",
});
// 20000@tradinglore/candles
A seeded, deterministic OHLCV candle generator with trend, range and breakout regimes. Same seed, same chart, every time. It builds our practice charts.
npm install @tradinglore/candlesgenerateCandles({ seed: 7, bars: 60, regime: "breakout", bias: "up" })
Synthetic candles. Same seed, same chart, on any machine.
import { generateCandles } from "@tradinglore/candles";
const candles = generateCandles({
seed: "lesson-1",
bars: 120,
regime: "breakout",
bias: "up",
});Embed a calculator
Every free calculator has a copy-and-paste embed for a blog or course page. Start with position size or risk to reward.