{"uid":"cap_-9RoWBxwXbTcu8sWc0A4V","slug":"investing-math-position-size-calculator-d01c1382","name":"Investing Math – Position Size Calculator","description":"Position size from account size, risk percent, entry and stop: units to buy, dollars at risk, cost and R-multiple targets.","url":"https://invest-math.x402tookit.com/position-size?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["account","riskPct","entry","stop"],"properties":{"stop":{"type":"number","description":"Stop-loss price (below entry for long, above for short)"},"entry":{"type":"number","description":"Entry price"},"feePct":{"type":"number","description":"Round-trip fees as a percent of position value, default 0"},"account":{"type":"number","description":"Account value"},"riskPct":{"type":"number","description":"Percent of the account to risk, 0.01 to 25"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"units":{"type":["null","number"]},"source":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"targets":{"type":["null","object"],"properties":{"oneR":{"type":["null","number"]},"twoR":{"type":["null","number"]},"threeR":{"type":["null","number"]}}},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"direction":{"type":["null","string"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"positionCost":{"type":["null","number"]},"stopDistance":{"type":["null","number"]},"needsLeverage":{"type":["boolean","null"]},"stopDistancePct":{"type":["null","number"]},"riskDollarsActual":{"type":["null","number"]},"riskDollarsBudget":{"type":["null","number"]},"positionPctOfAccount":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Sg_8BPVpcOk7QwjTWsVtH","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates the number of units to buy, dollars at risk, position cost, and R-multiple profit targets from account size, risk percentage, entry price, and stop-loss price.","exampleAgentPrompt":"I have a $25,000 trading account and I want to risk 1.5% on a trade. My entry is $142.50 and my stop loss is $138.00 — how many shares should I buy, what's my dollar risk, and what are my 1R, 2R, and 3R targets?","exampleUseCases":[{"title":"Stock trade position sizing","prompt":"I'm trading a $50,000 account and want to risk no more than 1% on a stock I'm entering at $85.20 with a stop at $82.00. How many shares should I buy and what will the position cost me?"},{"title":"Crypto trade with fee adjustment","prompt":"I have a $10,000 account and I'm buying crypto at $0.4250 with a stop at $0.3900, risking 2% of my account. Round-trip fees are about 0.5% — how many units should I buy and what are my 1R and 2R targets?"},{"title":"Checking if leverage is needed","prompt":"My account is $5,000, I want to risk 3%, and I'm entering a trade at $320 with a tight stop at $318. Tell me how many shares I can buy and whether I'd need leverage for this position."}],"resultDescription":"Returns an object containing: number of units to buy, direction (long/short), stop distance in price and percent, position cost in dollars, budgeted and actual dollar risk, position as a percent of account, whether leverage is needed, 1R/2R/3R profit targets, a plain-language summary, verdict, and optional warnings or reasons if the calculation is degraded or flagged.","failureModes":["Missing required query parameters (account, riskPct, entry, stop) returns an error","riskPct outside allowed range (0.01–25) may return a validation error or degraded result","Stop price above entry for a long trade (or below for short) may produce unexpected direction or error","Very tight stop distances may result in fractional units and a needsLeverage flag","Non-numeric parameter values return a parsing error"],"whenToPreferThis":"Use this endpoint when you need a precise, rules-based position size calculation given a specific account size, risk tolerance, entry price, and stop loss — especially when you also want R-multiple profit targets (1R/2R/3R) and a cost breakdown. Prefer this over manual calculation or generic finance APIs when the user is actively planning a trade and needs actionable unit counts and dollar-risk figures in a single call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T13:14:23.980Z","isFirstParty":false,"canonicalSlug":"investing-math-position-size-calculator-d01c1382"}