Trading Formulas Library

Crypto & stock trading formulas — curated from open source (TA-Lib, pandas-ta, freqtrade, Backtrader, ccxt, jesse-ai, dYdX, Uniswap, and more). Read, learn, and download for free.

Formulas
Categories
Open Source
2
Markets

🧮 Interactive Trading Tools

Plug-and-play calculators built for retail traders & quants. All math runs locally in your browser — no data leaves your device.

Position Size Calculator

Risk a fixed % of your account per trade. The most reliable sizing method for retail traders.

Risk / Reward Ratio

Plan trades with a clear R-multiple before you enter. Aim for RRR ≥ 2.

Profit & Loss (with Leverage)

Compute realized PnL for spot & leveraged positions, including ROE % and fees.

Kelly Criterion

Optimal bet size for long-term growth. In practice, use Half-Kelly or Quarter-Kelly.

Compound / DCA Growth

Project long-term portfolio growth with regular contributions and a fixed annual return.

Liquidation Price (Crypto Futures)

Estimate the price at which your leveraged position gets liquidated (isolated margin).

Stop Loss Calculator

Stop loss by ATR multiple. Adapts to volatility.

Expectancy & Win-Rate Analysis

Find out whether your system is profitable before risking real money.

📚 Formula Library

🔍

About This Library

Every formula here is rewritten (with explanations, mathematical formulas, and example code in Python & JavaScript) from open-source projects such as: TA-Lib, pandas-ta, freqtrade, Backtrader, jesse-ai, ccxt, vectorbt, quantstats, statsmodels, Hummingbot, Uniswap, Hyperliquid, Deribit, and more.

Goal: be a quick reference for traders & quants who want to implement indicators and strategies without bouncing between dozens of docs. All formulas are free to study & use.

⚠️ Disclaimer: This content is for educational purposes only. Trading carries risk; profit is never guaranteed. Always do your own research (DYOR) and apply sound money management.

☕ Support This Project

All formulas & tools are free. If this library helped your trading, consider buying me a coffee — it keeps the project alive. 🙏

⚠️ Always double-check the wallet address before sending. We never DM you first for donations. Never share your seed phrase with anyone.