{"id":22696877,"url":"https://github.com/maxbeizer/lot-size-calculator","last_synced_at":"2025-08-07T07:31:18.052Z","repository":{"id":186760980,"uuid":"631699742","full_name":"maxbeizer/lot-size-calculator","owner":"maxbeizer","description":"Calculate your ForEx lot size","archived":false,"fork":false,"pushed_at":"2024-12-09T21:39:57.000Z","size":1552,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-09T22:32:28.227Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://maxbeizer.github.io/lot-size-calculator/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxbeizer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-23T20:46:55.000Z","updated_at":"2024-12-09T21:40:00.000Z","dependencies_parsed_at":"2024-02-26T13:34:31.359Z","dependency_job_id":"0673e961-8ae0-43e8-a457-ebb6a9f96499","html_url":"https://github.com/maxbeizer/lot-size-calculator","commit_stats":null,"previous_names":["maxbeizer/lot-size-calculator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbeizer%2Flot-size-calculator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbeizer%2Flot-size-calculator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbeizer%2Flot-size-calculator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbeizer%2Flot-size-calculator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxbeizer","download_url":"https://codeload.github.com/maxbeizer/lot-size-calculator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229007296,"owners_count":18005299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-10T05:11:28.657Z","updated_at":"2025-08-07T07:31:18.045Z","avatar_url":"https://github.com/maxbeizer.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e [!IMPORTANT]\n\u003e This app has been archived as its data source is no longer providing an API.\n\n# Lot Size Calculator\n\n![logo 256](https://github.com/maxbeizer/lot-size-calculator/assets/2006658/88e62d0b-ab43-43df-bd43-28e0da50d279)\n\nCreated with [Create React App](https://create-react-app.dev/)\n\n## Development\n\n```\nscript/setup\nscript/test\nscript/dev # or npm run\n```\n\n## Deployment\n\nvia [GitHub Pages](https://pages.github.com/):\n\n```\nscript/deploy\n# or\nnpm run deploy\n```\n\ndocs: https://create-react-app.dev/docs/deployment#github-pages\n\n## Understanding the algorithm\n\n```\nPips at risk * pip value * lots traded = amount at risk\n```\n\n1. Account balance is $10,000 USD\n1. Risk is 1%\n1. Stop loss is 10 pips\n1. Convert risk to local currency. If base currency is denmoninator, then bid price. If numerator, then ask price.\n   1. If account currency is denominator, then pip value is 1. So `risk in dollars/pips in dollars == position` . $100/ 10 pips \\* $1 =\u003e 10 mini lots (1 standard)\n   1. EUR/CAD. USD/CAD ask is 1/1.2219.\n      1. $100 / 10 pips \\* 1.2219 = 1.2219 standard or 12.21 mini\n   1. GBP/AUD. AUD/USD bid is 1.4458 so\n      1. 1AUD/1.4458USD =\u003e `1/1.4458=0.6913` =\u003e $1USD = $0.69AUD\n      1. position size is therefore .6913 \\* 100k\n      1. Standard lot is `.6913`. Mini lot is `6.913` etc\n   1. EUR/JPY. USD/JPY ask 135.774\n      1. $100 / 10 pips \\* 135.774 / 1000 (for yen) = 1.35 standard, 13.5 mini\n\nCopilot version\n\n```typescript\ninterface Input {\n  accountBalance: number;\n  riskPercentage: number;\n  stopLossPips: number;\n  baseCurrency: string;\n  quoteCurrency: string;\n  bidPrice: number;\n  askPrice: number;\n}\n\ninterface Output {\n  positionSize: number;\n  pipValue: number;\n  lotSize: number;\n}\n\nfunction calculatePositionSize(input: Input): Output {\n  const {\n    accountBalance,\n    riskPercentage,\n    stopLossPips,\n    baseCurrency,\n    quoteCurrency,\n    bidPrice,\n    askPrice,\n  } = input;\n\n  const riskAmount = accountBalance * (riskPercentage / 100);\n  const pipValue =\n    (riskAmount / stopLossPips) *\n    (quoteCurrency === baseCurrency ? 1 : askPrice);\n  const lotSize = pipValue / 10;\n\n  return {\n    positionSize: riskAmount / (stopLossPips * pipValue),\n    pipValue,\n    lotSize,\n  };\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxbeizer%2Flot-size-calculator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxbeizer%2Flot-size-calculator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxbeizer%2Flot-size-calculator/lists"}