eugene9099 commited on
Commit
4b17426
·
verified ·
1 Parent(s): 2606ec2

Upload 5 files

Browse files
README.md CHANGED
@@ -1,3 +1,42 @@
1
- ---
2
- license: cc0-1.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # position-sizing-data
2
+
3
+ Reference data and arithmetic for position sizing across forex, stocks and crypto futures.
4
+
5
+ This repository exists because the numbers behind "how many units should I trade" are usually scattered across broker pages, forum posts and screenshots. Here they are in plain CSV and Markdown, with the formula written out, so anyone can check the arithmetic instead of trusting it.
6
+
7
+ An interactive implementation of the same calculation lives at [https://positionsizetool.com/](https://positionsizetool.com/).
8
+
9
+ ## Contents
10
+
11
+ | File | What is in it |
12
+ | --- | --- |
13
+ | `data/contract-specifications.csv` | Default contract size, pip size and unit step per instrument, for 131 symbols across forex, metals, energies, indices and crypto. |
14
+ | `data/pip-value-by-lot-size.csv` | Pip value per standard, mini, micro and nano lot, on a USD-denominated account, plus the cost of a 20-pip move and of a 1-pip spread. |
15
+ | `data/losing-streak-equity.csv` | Equity remaining after 1 to 20 consecutive losses at 0.5%, 1% and 2% risk per trade. |
16
+ | `data/drawdown-recovery.csv` | Gain required on the reduced balance to return to the original balance, for drawdowns from 5% to 90%. |
17
+ | `checklists/pre-trade-risk-checklist.md` | What to confirm before an order goes in. |
18
+ | `docs/position-sizing-formulas.md` | The formulas, why each term sits where it does, and a worked example. |
19
+
20
+ ## The formula in one line
21
+
22
+ ```
23
+ units = (risk_budget - commission) / ((|entry - stop| + spread) x quote_to_account_rate)
24
+ ```
25
+
26
+ The tradable size is that number rounded **down** to the broker's unit step. Rounding up increases risk without saying so.
27
+
28
+ The full derivation, including why the spread is added to the stop distance while the commission is subtracted from the budget, is in `docs/position-sizing-formulas.md`.
29
+
30
+ ## Where the numbers come from
31
+
32
+ - **Instrument rows** are the built-in defaults of the calculator linked above. They are typical retail contract specifications, not exchange-published official values, and several are editable by design. Verify the contract size and unit step of your own instrument against your broker before placing an order.
33
+ - **Everything else in `data/` is computed, not copied.** Each table has its generating formula stated at the top of this table's entry below:
34
+ - `losing-streak-equity.csv`: `remaining = (1 - risk%)^n`
35
+ - `drawdown-recovery.csv`: `gain_required = 1 / (1 - drawdown) - 1`
36
+ - `pip-value-by-lot-size.csv`: `pip_value = units x pip_size`, converted to USD at the stated rate
37
+
38
+ ## Licence
39
+
40
+ Code and documentation: MIT. Data files in `data/`: CC0 1.0 Universal, to the extent applicable.
41
+
42
+ This is not investment advice. Nothing here recommends a trade, a size or a broker.
contract-specifications.csv ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ symbol,asset_class,quote_currency,pip_size,contract_size,unit_step
2
+ AUD/USD,forex,USD,0.0001,100000,1000
3
+ EUR/USD,forex,USD,0.0001,100000,1000
4
+ GBP/USD,forex,USD,0.0001,100000,1000
5
+ NZD/USD,forex,USD,0.0001,100000,1000
6
+ USD/JPY,forex,JPY,0.01,100000,1000
7
+ USD/CHF,forex,CHF,0.0001,100000,1000
8
+ USD/CAD,forex,CAD,0.0001,100000,1000
9
+ USD/MXN,forex,MXN,0.0001,100000,1000
10
+ USD/ZAR,forex,ZAR,0.0001,100000,1000
11
+ USD/TRY,forex,TRY,0.0001,100000,1000
12
+ USD/SEK,forex,SEK,0.0001,100000,1000
13
+ USD/NOK,forex,NOK,0.0001,100000,1000
14
+ USD/DKK,forex,DKK,0.0001,100000,1000
15
+ USD/PLN,forex,PLN,0.0001,100000,1000
16
+ USD/HUF,forex,HUF,0.0001,100000,1000
17
+ USD/CZK,forex,CZK,0.0001,100000,1000
18
+ USD/SGD,forex,SGD,0.0001,100000,1000
19
+ USD/HKD,forex,HKD,0.0001,100000,1000
20
+ USD/CNH,forex,CNH,0.0001,100000,1000
21
+ USD/THB,forex,THB,0.0001,100000,1000
22
+ USD/MYR,forex,MYR,0.0001,100000,1000
23
+ USD/PHP,forex,PHP,0.0001,100000,1000
24
+ USD/IDR,forex,IDR,0.0001,100000,1000
25
+ USD/INR,forex,INR,0.0001,100000,1000
26
+ USD/KRW,forex,KRW,0.0001,100000,1000
27
+ EUR/JPY,forex,JPY,0.01,100000,1000
28
+ GBP/JPY,forex,JPY,0.01,100000,1000
29
+ AUD/JPY,forex,JPY,0.01,100000,1000
30
+ CAD/JPY,forex,JPY,0.01,100000,1000
31
+ CHF/JPY,forex,JPY,0.01,100000,1000
32
+ NZD/JPY,forex,JPY,0.01,100000,1000
33
+ EUR/GBP,forex,GBP,0.0001,100000,1000
34
+ EUR/AUD,forex,AUD,0.0001,100000,1000
35
+ EUR/CAD,forex,CAD,0.0001,100000,1000
36
+ EUR/CHF,forex,CHF,0.0001,100000,1000
37
+ EUR/NZD,forex,NZD,0.0001,100000,1000
38
+ EUR/SEK,forex,SEK,0.0001,100000,1000
39
+ EUR/NOK,forex,NOK,0.0001,100000,1000
40
+ EUR/DKK,forex,DKK,0.0001,100000,1000
41
+ EUR/PLN,forex,PLN,0.0001,100000,1000
42
+ EUR/TRY,forex,TRY,0.0001,100000,1000
43
+ EUR/ZAR,forex,ZAR,0.0001,100000,1000
44
+ EUR/MXN,forex,MXN,0.0001,100000,1000
45
+ EUR/HUF,forex,HUF,0.0001,100000,1000
46
+ EUR/CZK,forex,CZK,0.0001,100000,1000
47
+ EUR/SGD,forex,SGD,0.0001,100000,1000
48
+ EUR/HKD,forex,HKD,0.0001,100000,1000
49
+ GBP/AUD,forex,AUD,0.0001,100000,1000
50
+ GBP/CAD,forex,CAD,0.0001,100000,1000
51
+ GBP/CHF,forex,CHF,0.0001,100000,1000
52
+ GBP/NZD,forex,NZD,0.0001,100000,1000
53
+ GBP/SEK,forex,SEK,0.0001,100000,1000
54
+ GBP/NOK,forex,NOK,0.0001,100000,1000
55
+ GBP/PLN,forex,PLN,0.0001,100000,1000
56
+ GBP/ZAR,forex,ZAR,0.0001,100000,1000
57
+ GBP/TRY,forex,TRY,0.0001,100000,1000
58
+ GBP/SGD,forex,SGD,0.0001,100000,1000
59
+ AUD/CAD,forex,CAD,0.0001,100000,1000
60
+ AUD/CHF,forex,CHF,0.0001,100000,1000
61
+ AUD/NZD,forex,NZD,0.0001,100000,1000
62
+ AUD/SGD,forex,SGD,0.0001,100000,1000
63
+ AUD/HKD,forex,HKD,0.0001,100000,1000
64
+ CAD/CHF,forex,CHF,0.0001,100000,1000
65
+ NZD/CAD,forex,CAD,0.0001,100000,1000
66
+ NZD/CHF,forex,CHF,0.0001,100000,1000
67
+ NZD/SGD,forex,SGD,0.0001,100000,1000
68
+ CHF/PLN,forex,PLN,0.0001,100000,1000
69
+ XAU/USD,metal,USD,0.01,100,1
70
+ XAG/USD,metal,USD,0.001,5000,1
71
+ XPT/USD,metal,USD,0.01,100,1
72
+ XPD/USD,metal,USD,0.01,100,1
73
+ WTI/USD,energy,USD,0.01,1000,1
74
+ BRENT/USD,energy,USD,0.01,1000,1
75
+ NATGAS/USD,energy,USD,0.001,10000,1
76
+ US30,index,USD,1,1,1
77
+ US500,index,USD,1,1,1
78
+ USTEC,index,USD,1,1,1
79
+ DE40,index,USD,1,1,1
80
+ UK100,index,USD,1,1,1
81
+ JP225,index,USD,1,1,1
82
+ AUS200,index,USD,1,1,1
83
+ FRA40,index,USD,1,1,1
84
+ EU50,index,USD,1,1,1
85
+ SPA35,index,USD,1,1,1
86
+ HK50,index,USD,1,1,1
87
+ CHINA50,index,USD,1,1,1
88
+ BTCUSDT,crypto,USD,0.01,1,0.001
89
+ ETHUSDT,crypto,USD,0.01,1,0.001
90
+ SOLUSDT,crypto,USD,0.01,1,0.001
91
+ XRPUSDT,crypto,USD,0.01,1,0.001
92
+ ADAUSDT,crypto,USD,0.01,1,0.001
93
+ DOGEUSDT,crypto,USD,0.01,1,0.001
94
+ AVAXUSDT,crypto,USD,0.01,1,0.001
95
+ LINKUSDT,crypto,USD,0.01,1,0.001
96
+ DOTUSDT,crypto,USD,0.01,1,0.001
97
+ TONUSDT,crypto,USD,0.01,1,0.001
98
+ LTCUSDT,crypto,USD,0.01,1,0.001
99
+ BCHUSDT,crypto,USD,0.01,1,0.001
100
+ UNIUSDT,crypto,USD,0.01,1,0.001
101
+ ATOMUSDT,crypto,USD,0.01,1,0.001
102
+ TRXUSDT,crypto,USD,0.01,1,0.001
103
+ XLMUSDT,crypto,USD,0.01,1,0.001
104
+ NEARUSDT,crypto,USD,0.01,1,0.001
105
+ APTUSDT,crypto,USD,0.01,1,0.001
106
+ ARBUSDT,crypto,USD,0.01,1,0.001
107
+ OPUSDT,crypto,USD,0.01,1,0.001
108
+ SUIUSDT,crypto,USD,0.01,1,0.001
109
+ ICPUSDT,crypto,USD,0.01,1,0.001
110
+ FILUSDT,crypto,USD,0.01,1,0.001
111
+ INJUSDT,crypto,USD,0.01,1,0.001
112
+ AAVEUSDT,crypto,USD,0.01,1,0.001
113
+ GRTUSDT,crypto,USD,0.01,1,0.001
114
+ THETAUSDT,crypto,USD,0.01,1,0.001
115
+ EOSUSDT,crypto,USD,0.01,1,0.001
116
+ CHZUSDT,crypto,USD,0.01,1,0.001
117
+ SANDUSDT,crypto,USD,0.01,1,0.001
118
+ MANAUSDT,crypto,USD,0.01,1,0.001
119
+ AXSUSDT,crypto,USD,0.01,1,0.001
120
+ GALAUSDT,crypto,USD,0.01,1,0.001
121
+ IMXUSDT,crypto,USD,0.01,1,0.001
122
+ RUNEUSDT,crypto,USD,0.01,1,0.001
123
+ TIAUSDT,crypto,USD,0.01,1,0.001
124
+ SEIUSDT,crypto,USD,0.01,1,0.001
125
+ PEPEUSDT,crypto,USD,0.01,1,0.001
126
+ ORDIUSDT,crypto,USD,0.01,1,0.001
127
+ WIFUSDT,crypto,USD,0.01,1,0.001
128
+ BNBUSDT,crypto,USD,0.01,1,0.001
129
+ ETCUSDT,crypto,USD,0.01,1,0.001
130
+ VETUSDT,crypto,USD,0.01,1,0.001
131
+ Stock (your ticker),stock,USD,0.01,1,1
132
+ Custom instrument,custom,USD,0.0001,1,0.001
drawdown-recovery.csv ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ drawdown_pct,gain_required_pct_to_recover
2
+ 5%,5.3%
3
+ 10%,11.1%
4
+ 15%,17.6%
5
+ 20%,25.0%
6
+ 25%,33.3%
7
+ 30%,42.9%
8
+ 40%,66.7%
9
+ 50%,100.0%
10
+ 60%,150.0%
11
+ 70%,233.3%
12
+ 80%,400.0%
13
+ 90%,900.0%
losing-streak-equity.csv ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ consecutive_losses,equity_remaining_0.5pct,equity_remaining_1pct,equity_remaining_2pct
2
+ 1,99.50%,99.00%,98.00%
3
+ 2,99.00%,98.01%,96.04%
4
+ 3,98.51%,97.03%,94.12%
5
+ 4,98.01%,96.06%,92.24%
6
+ 5,97.52%,95.10%,90.39%
7
+ 6,97.04%,94.15%,88.58%
8
+ 7,96.55%,93.21%,86.81%
9
+ 8,96.07%,92.27%,85.08%
10
+ 9,95.59%,91.35%,83.37%
11
+ 10,95.11%,90.44%,81.71%
12
+ 11,94.64%,89.53%,80.07%
13
+ 12,94.16%,88.64%,78.47%
14
+ 13,93.69%,87.75%,76.90%
15
+ 14,93.22%,86.87%,75.36%
16
+ 15,92.76%,86.01%,73.86%
17
+ 16,92.29%,85.15%,72.38%
18
+ 17,91.83%,84.29%,70.93%
19
+ 18,91.37%,83.45%,69.51%
20
+ 19,90.92%,82.62%,68.12%
21
+ 20,90.46%,81.79%,66.76%
pip-value-by-lot-size.csv ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ lot,units,pip_value_usd_on_usd_quote_pair,pip_value_usd_on_jpy_pair_at_150_00,loss_on_20_pip_move_usd,spread_cost_of_1_pip_usd
2
+ standard,100000,10.0000,6.6667,200.00,10.0000
3
+ mini,10000,1.0000,0.6667,20.00,1.0000
4
+ micro,1000,0.1000,0.0667,2.00,0.1000
5
+ nano,100,0.0100,0.0067,0.20,0.0100