Skip to content
Back to search

prop-firm-sim

Know your odds before you pay the fee: open-source Monte Carlo simulation of prop-firm challenges over each firm's exact ruleset. Pass probability, expected attempts and cost, EV, optimal risk sizing. Engine, CLI, and MCP server. Deterministic, zero telemetry.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/luxalgo--prop-firm-sim/badge.svg)](/listings/luxalgo--prop-firm-sim)

HTML

<a href="/listings/luxalgo--prop-firm-sim"><img src="/api/listings/luxalgo--prop-firm-sim/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 299 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <p align="center">
  2. <img src="./docs/assets/banner.png" alt="Prop Firm Sim. Know your odds before you pay the fee. Monte Carlo, deterministic, open source." width="100%">
  3. </p>
  4. <h1 align="center">Prop Firm Sim</h1>
  5. <p align="center">
  6. <sub><b>Prop Firm Sim</b> is a <a href="https://www.luxalgo.com">LuxAlgo</a> open-source project.</sub>
  7. </p>
  8. <p align="center">
  9. <a href="https://github.com/LuxAlgo/prop-firm-sim/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/LuxAlgo/prop-firm-sim/ci.yml?branch=main&style=flat-square&label=CI&labelColor=0a0a0a" alt="CI status"></a>
  10. <a href="https://www.npmjs.com/package/@luxalgo/prop-firm-sim-core"><img src="https://img.shields.io/npm/v/%40luxalgo%2Fprop-firm-sim-core?style=flat-square&label=npm&labelColor=0a0a0a&color=0d8ed6" alt="npm version"></a>
  11. <a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-555555?style=flat-square&labelColor=0a0a0a" alt="MIT license"></a>
  12. </p>
  13. <p align="center">
  14. <a href="https://www.luxalgo.com/prop-firm-sim/">Homepage</a>&ensp;·&ensp;
  15. <a href="#thirty-seconds-to-your-odds">Quickstart</a>&ensp;·&ensp;
  16. <a href="#why-your-odds-are-worse-than-you-think">Why your odds are worse</a>&ensp;·&ensp;
  17. <a href="#run-it-on-your-real-trades">Your real trades</a>&ensp;·&ensp;
  18. <a href="#the-same-engine-three-ways">Packages</a>&ensp;·&ensp;
  19. <a href="#where-the-rules-come-from">Rules data</a>&ensp;·&ensp;
  20. <a href="./docs/rule-semantics.md">Method</a>
  21. </p>
  22. <br>
  23. Prop Firm Sim tells you your odds before you pay for a prop-firm challenge. Give it your
  24. trading statistics, or your actual trade history, and it plays ten thousand complete challenge
  25. journeys through the firm's exact ruleset. Out come the numbers that matter: pass probability
  26. per phase and joint, with confidence intervals. Expected attempts, total cost, and expected
  27. value with every fee priced in. Time to funding, stagnation, and the probability a funded
  28. account ever collects a payout.
  29. The engine is pure, deterministic TypeScript: everything runs locally, and the same seed
  30. reproduces the same numbers byte for byte. Firm rules come live from
  31. [LuxAlgo's public prop-firm directory](https://www.luxalgo.com/prop-firms/) (keyless,
  32. read-only), and any ruleset can be passed inline, fully offline.
  33. ## Thirty seconds to your odds
  34. ```bash
  35. npx @luxalgo/prop-firm-sim-cli simulate \
  36. --firm ftmo --challenge 100k-2step \
  37. --winrate 0.48 --avg-win 1.6 --avg-loss 1 \
  38. --risk 1% --trades-per-day 4
  39. ```
  40. ```text
  41. FTMO · FTMO Challenge 100K (2-step)
  42. ftmo/100k-2step · cfd · account 100,000 USD · fee 540 USD one-time
  43. Data: live LuxAlgo directory · provenance directory, every simulated rule read from a structured
  44. directory column
  45. Trader: win rate 48.0% · avg win 1.6R · avg loss 1R · 4 trades/day · risk 1% of balance per trade
  46. Run: 10,000 paths · seed 42 · attempt cap 25 · engine 1.0.0
  47. Pass probability per attempt 93.2% (95% CI 92.7–93.7%)
  48. Step 1 · target +10% 96.5% (95% CI 96.2–96.9%) · fails: max-loss 3.5%
  49. Step 2 · target +5% 96.6% (95% CI 96.2–96.9%) · fails: max-loss 3.4%
  50. Avg days per attempt 16.5 when passed · 16 when failed
  51. Funded within 25 attempts 100.0% (95% CI 100.0–100.0%)
  52. Attempts until funded mean 1.1 · p50 1 · p90 1
  53. Total cost mean 39.26 USD · p50 0 USD · p90 0 USD · p95 540 USD
  54. Cost when funded mean 39.26 USD · p50 0 USD · p90 0 USD
  55. Days to funded (trading days) p50 15 · p75 22 · p90 31
  56. Stagnation (days without a new equity high) p50 4 · p90 12
  57. EV · challenge journey + funded horizon of 90 trading days
  58. EV total +66,755 USD ± 589 USD (95% CI)
  59. P(EV > 0) 96.2%
  60. Payout if funded mean 66,794 USD · p50 71,011 USD · avg 6.8 payout events
  61. Payout probability | funded 96.2%
  62. Days to 1st payout p50 10 · p90 10
  63. Funded accounts blown 26.0% within the horizon
  64. Max drawdown while evaluating p50 5.9% · p95 12.5% of initial balance
  65. Not simulated / assumptions:
  66. • trades-resolve-same-day: All trades are modeled as same-day round trips; overnight and weekend
  67. holding are not simulated.
  68. • intra-trade-excursions-not-modeled: Equity is observed at each trade close; favorable/adverse
  69. excursions inside a trade are not modeled, which slightly understates trailing-drawdown and
  70. open-PnL breach risk (real odds are somewhat worse).
  71. ...five more flags follow: every run prints the full assumptions list and the disclaimer.
  72. ```
  73. That trader is good. Profit factor near 1.5, and the static max loss still kills 3.5% of
  74. step-one attempts, while 26% of the funded accounts blow up within 90 trading days. Drop the
  75. win rate three points (the built-in sensitivity panel shows exactly this) and the picture
  76. darkens fast.
  77. Prefer a browser? The same run in [the hosted simulator](https://www.luxalgo.com/prop-firms/):
  78. <p align="center">
  79. <img src="./docs/assets/simulator-dark.png" alt="Simulation results: the attempt verdict with pass, fail and timeout shares, then a KPI grid with per phase pass rates, joint pass probability, net EV, payout probability, expected cost and stagnation" width="100%">
  80. </p>
  81. <p align="center"><sub><b><a href="https://www.luxalgo.com/prop-firms/">The hosted simulator</a></b> after one run: verdict, per phase and joint pass rates, EV with fees priced in, and the stagnation tile. Everything runs client side; nothing you enter leaves your browser.</sub></p>
  82. ## Why your odds are worse than you think
  83. Every prop-firm calculator you have seen multiplies a win rate into a binomial formula. That
  84. number is wrong, and wrong in the house's favor, because the odds do not live in the profit
  85. target. They live in the exact mechanics of the loss rules.
  86. 1. **"Trailing drawdown" is four different rules.** A max loss that is static from the initial
  87. balance, one that trails end-of-day highs, one that trails peak unrealized equity intraday,
  88. and one that trails then locks at breakeven are wildly different odds wearing the same
  89. headline number. The intraday variant, standard on futures evaluations, routinely cuts pass
  90. probability by a third versus the static rule at the same limit.
  91. [The semantics, with pen-and-paper examples.](./docs/rule-semantics.md)
  92. 2. **A "5% daily loss" is four choices multiplied together.** Five percent of what, anchored to
  93. which day-start number, counting open P&L or not, checked live or only at the close. Same
  94. headline, different survivors. Every switch is explicit in the spec schema.
  95. 3. **Your trades come in streaks; the naive math assumes they do not.** Streaks are exactly what
  96. breach daily-loss and trailing rules. Paste your real R-multiples and the engine
  97. block-bootstraps them, preserving your autocorrelation. With a tight loss limit, i.i.d. math
  98. overstates your pass probability, and the flattery lands exactly where the rules bite.
  99. 4. **The risk that maximizes passing is not the risk that maximizes EV.** Passing wants small
  100. risk, to survive the floors. EV wants more, because fees are fixed and payouts scale. Here
  101. is that curve, from a realistic two-step ruleset, reproducible with one command:
  102. <p align="center">
  103. <img src="./docs/assets/risk-sweep.svg" alt="Risk sweep: pass probability and EV against risk per trade. The two maxima land on different risk sizes." width="100%">
  104. </p>
  105. ```bash
  106. npx @luxalgo/prop-firm-sim-cli optimal-risk --firm ftmo --challenge 100k-2step \
  107. --winrate 0.48 --avg-win 1.6 --trades-per-day 4 --seed 42
  108. ```
  109. 5. **You probably overestimate your win rate.** Every simulate run can carry a sensitivity
  110. panel: what one percentage point of win-rate optimism costs you in pass probability. It is
  111. usually a lot.
  112. 6. **Getting funded is not getting paid.** Consistency rules are simulated: one outsized day
  113. raises your effective target, and the extra days at risk are sometimes the days the trailing
  114. floor gets hit. So is payout gating: winning-day minimums, profit buffers, per-payout caps.
  115. Results report the probability a funded account ever collects a payout, and how long the
  116. first one takes.
  117. 7. **Dead time is part of the price.** Every result reports stagnation: the longest stretch of
  118. days without a new equity high inside an attempt. Cutting risk raises your pass odds and
  119. stretches your stagnation. Surviving is slow, and slow is what makes traders abandon
  120. accounts and force trades.
  121. The centerpiece of the hosted simulator draws all of this at once: 800 traced equity paths
  122. against the ruleset's actual moving loss floor. Under trailing rules you can watch the floor
  123. ratchet up beneath the paths.
  124. <p align="center">
  125. <img src="./docs/assets/simulator-fan.png" alt="Equity path fan: 800 traced Monte Carlo paths over 70 trading days, step targets as dashed lines, and the median max loss floor ratcheting upward beneath the paths" width="100%">
  126. </p>
  127. ## Run it on your real trades
  128. Summary stats are a start. Timestamps are the truth. Paste or upload your trade history: real
  129. platform exports import directly (TradingView list of trades, MT4/MT5 statements including the
  130. HTML reports, MT5 deals tables, ThinkOrSwim account statements), along with plain timestamped
  131. CSVs, a documented generic template, and broker trade history as JSON in the open-source
  132. [@luxalgo/broker-sdk](https://github.com/LuxAlgo/broker-sdk) shape, so a live broker pull drops
  133. straight into the simulator. Files that carry P&L but no risk data are refused until
  134. you state the risk you took per trade: R-multiples are computed, never fabricated. With
  135. timestamps in hand, two more questions become answerable:
  136. **What if I stop trading around news?** Prop firms restrict or frown on positions opened around
  137. scheduled releases, and some pay out only if you avoided them. The news filter replays your log
  138. with every trade opened inside a configurable window (minutes before and after, impact tier,
  139. currency) removed, on a recurring release calendar, then simulates both versions with the same
  140. seed. You see the delta, not a lecture. Sometimes avoiding news costs you probability, and the
  141. card says so.
  142. <p align="center">
  143. <img src="./docs/assets/simulator-news.png" alt="Avoiding news windows card: pass rate with all trades versus avoiding news, the delta in points, and the count of excluded trades and calendar events" width="100%">
  144. </p>
  145. **Would a combined portfolio get me audited?** Upload up to five strategy histories for one
  146. simulation. Before merging them chronologically, the overlap audit counts same-direction
  147. positions open at the same time across histories, exactly what a payout reviewer looks for in
  148. copied accounts, and flags the risk with disclosed heuristic bands before you find out the
  149. expensive way.
  150. <p align="center">
  151. <img src="./docs/assets/simulator-audit.png" alt="Portfolio overlap audit banner: high audit risk flagged across two histories, with overlap share, same direction share and the tolerance disclosed" width="100%">
  152. </p>
  153. ## The same engine, three ways
  154. | Package | What it is |
  155. | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  156. | [`@luxalgo/prop-firm-sim-core`](./packages/core) | The engine. Pure TypeScript, zero I/O, browser and worker safe, deterministic under seed (permalinks reproduce byte for byte). 10,000 paths in about a third of a second. |
  157. | [`@luxalgo/prop-firm-sim-cli`](./packages/cli) | `simulate`, `optimal-risk`, `compare`, `overlap`, `firms`, `rules` in your terminal, on live directory data or inline specs. |
  158. | [`@luxalgo/prop-firm-sim-mcp`](./packages/mcp) | MCP server exposing the simulator to AI agents. Ask your assistant: given my last 200 trades, what are my odds on this challenge, and at what risk? |
  159. | [the hosted simulator](https://www.luxalgo.com/prop-firms/) | The same engine in your browser, client side only, with precomputed reference odds per firm. |
  160. Use the core directly:
  161. ```ts
  162. import { simulate } from "@luxalgo/prop-firm-sim-core";
  163. import { adaptFirm } from "@luxalgo/prop-firm-sim-core/directory";
  164. // Live rules from the LuxAlgo directory, or build the spec object yourself:
  165. // the engine is pure and needs no network at all.
  166. const { propfirms } = (await (await fetch("https://app.luxalgo.com/api/propfirms/list")).json()).data;
  167. const challenge = adaptFirm(propfirms.find((f) => f.propfirmId === "ftmo"))[0];
  168. const result = simulate(
  169. challenge.spec,
  170. {
  171. kind: "parametric",
  172. winRate: 0.52,
  173. avgWinR: 1.8,
  174. tradesPerDay: 3,
  175. risk: { mode: "percent-of-balance", value: 0.5 },
  176. },
  177. { paths: 10_000, seed: 42 },
  178. );
  179. result.perAttempt.passProbability; // with Wilson 95% CI alongside
  180. result.perAttempt.stagnationDays; // dead time distribution per attempt
  181. result.journey.cost.mean; // expected total cost to funded
  182. result.ev.evTotal; // E[payouts minus fees] over the funded horizon
  183. result.assumptions.flags; // every simplification, spelled out
  184. challenge.provenance; // "directory" or "directory+inferred", inferred fields listed
  185. ```
  186. Have real trade history? Feed a raw R-multiple series into bootstrap mode, or run any broker
  187. export through `importTradeHistory` (structured diagnostics, adapter detection, a strict
  188. R-provenance ladder; see [docs/trade-import.md](./docs/trade-import.md)) and a timestamped log
  189. unlocks the context tools (`parseTradeLog`, `filterTradesAroundNews`, `mergeTradeLogs`,
  190. `analyzeOverlap`). Your odds, from your actual trades, computed locally.
  191. ## Where the rules come from
  192. Firm and challenge data is fetched at runtime from LuxAlgo's public prop-firm directory API
  193. (`https://app.luxalgo.com/api/propfirms/list`, keyless and read-only, the data behind
  194. [luxalgo.com/prop-firms](https://www.luxalgo.com/prop-firms/)), then adapted into simulatable
  195. specs by [`@luxalgo/prop-firm-sim-core/directory`](./packages/core/src/directory) under a
  196. three-tier honesty policy:
  197. 1. **Structured rule columns are used verbatim.** Exact drawdown mode, daily-loss anchor
  198. semantics, consistency caps, payout gating.
  199. 2. **Free text is inferred only when one reasonable reading exists**, and every inferred field
  200. is disclosed in the result (`provenance: "directory+inferred"`, `inferredFields: [...]`).
  201. 3. **Ambiguity is refused.** A challenge whose loss semantics cannot be established is reported
  202. as not simulatable instead of being guessed. The max-loss mode is too consequential to
  203. guess.
  204. When the directory serves a source citation (`sourceUrl`, `lastVerifiedAt`), it passes through
  205. into the spec's `sources` and every result. The data is data, not endorsement: no rankings, no
  206. offers, no affiliate anything in any simulation result. Rules the engine cannot faithfully
  207. simulate are declared (`flagsNotSimulated`) and echoed into every result rather than silently
  208. dropped.
  209. Firms change rules without notice. **The firm's page is always authoritative.** Found drift?
  210. [Report it.](https://github.com/LuxAlgo/prop-firm-sim/issues/new/choose) And any ruleset,
  211. including one the directory refuses or does not carry, can be passed inline as a `spec` object,
  212. fully offline.
  213. ## Assumptions, owned loudly
  214. The full list ships inside every result (`assumptions.flags`), but the big ones:
  215. - Trades are same-day round trips; intra-trade excursions are not modeled. This slightly
  216. understates trailing-drawdown risk, so real odds are somewhat worse.
  217. - Attempts are i.i.d. draws from your stated stats: no learning, no tilt.
  218. - Consistency rules, payout gating (winning days, buffers, caps) and locking trails **are
  219. simulated**. Scaling plans and remaining firm-specific niceties are not; entries that have
  220. them say so, and results repeat it.
  221. - The funded stage is a horizon simulation: withdrawals take the maximum the rules allow and
  222. never cross the loss floor; monthly billing approximates to 21 trading days.
  223. - The news calendar is a recurring template, not a historical feed, and every filtered result
  224. says so.
  225. Simulation, not prediction. Distributions, never promises.
  226. **[Read the full disclaimer.](./DISCLAIMER.md)**
  227. ## Development
  228. ```bash
  229. pnpm install
  230. pnpm build # topological: core, then cli and mcp
  231. pnpm test:run # unit tests incl. hand-computed micro-cases for every drawdown semantic
  232. pnpm bench # hot-loop benchmark
  233. ```
  234. Engine changes that move simulated numbers must update the golden snapshots and justify
  235. themselves in the PR. Silent drift in published odds is the one bug this repo treats as
  236. unforgivable. See [CONTRIBUTING.md](./CONTRIBUTING.md).
  237. ## License
  238. MIT © [LuxAlgo Global, LLC](https://luxalgo.com). Free to use, embed, fork, and verify. No
  239. telemetry, no tracking, in any package. The project name and the LuxAlgo name and logo are
  240. trademarks; see [TRADEMARKS.md](./TRADEMARKS.md). Security reports:
  241. [SECURITY.md](./SECURITY.md).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.