https://github.com/thesurlydev/tradesize
Given account equity, price and stop-loss calculate trade size in shares.
https://github.com/thesurlydev/tradesize
Last synced: about 1 year ago
JSON representation
Given account equity, price and stop-loss calculate trade size in shares.
- Host: GitHub
- URL: https://github.com/thesurlydev/tradesize
- Owner: thesurlydev
- Created: 2022-09-25T18:55:14.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-03-04T21:35:39.000Z (over 2 years ago)
- Last Synced: 2025-02-06T18:52:24.110Z (over 1 year ago)
- Language: Rust
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tradesize
A command line tool that when given account equity, price and stop-loss it will calculate trade size in shares for various risk percentages.
## usage
```shell
Usage: ts [ACCOUNT_EQUITY] [PRICE] [STOP_LOSS]
```
## example
```shell
$ ts 5000 5 4
Inputs:
+-----------+-------+-----------+---------------+
| Equity | Price | Stop-loss | Per-unit Risk |
+===============================================+
| $5,000.00 | $5.00 | $4.00 | $1.00 |
+-----------+-------+-----------+---------------+
Outputs:
+--------+--------+-------------+
| % Risk | Shares | Total Price |
+===============================+
| 1.00 | 50 | $250.00 |
|--------+--------+-------------|
| 1.25 | 62 | $310.00 |
|--------+--------+-------------|
| 1.50 | 75 | $375.00 |
|--------+--------+-------------|
| 1.75 | 87 | $435.00 |
|--------+--------+-------------|
| 2.00 | 100 | $500.00 |
+--------+--------+-------------+
```