{"type":"https://ercs.ethereum.org/ERCS/erc-8257#tool-manifest-v1","name":"position-sizing-calculator","description":"Calculates position size and risk amount from account equity, risk tolerance, entry price, and stop price. Optionally calculates reward-to-risk ratio and trade expectancy when a target price and win rate are supplied.","endpoint":"https://www.ytonlabs.com/api/position-sizing","inputs":{"type":"object","properties":{"accountSize":{"type":"number","exclusiveMinimum":0,"description":"Total account equity in quote currency, for example 10000 for a $10,000 account."},"riskPct":{"type":"number","exclusiveMinimum":0,"maximum":1,"description":"Fraction of account equity to risk on the trade. For example, 0.01 represents 1%."},"entryPrice":{"type":"number","exclusiveMinimum":0,"description":"Planned trade entry price."},"stopPrice":{"type":"number","exclusiveMinimum":0,"description":"Planned stop-loss price. A stop below entry indicates a long trade; a stop above entry indicates a short trade. The stop cannot equal the entry price."},"targetPrice":{"type":"number","exclusiveMinimum":0,"description":"Optional take-profit price used to calculate reward-to-risk ratio. For a long trade the target must be above entry; for a short trade the target must be below entry."},"winRate":{"type":"number","minimum":0,"maximum":1,"description":"Optional historical or estimated win rate from 0 to 1. A targetPrice must also be supplied when winRate is provided because expectancy depends on the trade's reward-to-risk ratio."}},"required":["accountSize","riskPct","entryPrice","stopPrice"],"additionalProperties":false},"outputs":{"type":"object","properties":{"positionSize":{"type":"string","description":"Suggested position size in base units, formatted to eight decimal places."},"riskAmount":{"type":"string","description":"Amount of account equity at risk if the stop is reached, formatted to two decimal places."},"rMultiple":{"type":"string","description":"Reward-to-risk ratio, returned when targetPrice is supplied."},"expectancy":{"type":"string","description":"Expected value per trade measured in R, returned when both targetPrice and winRate are supplied."}},"required":["positionSize","riskAmount"],"additionalProperties":false},"version":"0.1.0","tags":["trading","risk-management","position-sizing"],"creatorAddress":"0x64657fe2994f59e5ae732ec3052f3ccd4b0f62f0"}