Delete Concepts and Topics Folder
Browse files- Concepts and Topics Folder/Basics/Basics 101.ipynb +0 -234
- Concepts and Topics Folder/Basics/Foundation101.ipynb +0 -0
- Concepts and Topics Folder/Basics/code promting.ipynb +0 -65
- Concepts and Topics Folder/Basics/nothing.ipynb +0 -21
- Concepts and Topics Folder/Chart plotting using python.ipynb +0 -92
- Concepts and Topics Folder/Max Number of Losing Streak in Regards to Winrate.ipynb +0 -101
- Concepts and Topics Folder/Risk Management Logic.ipynb +0 -56
- Concepts and Topics Folder/The Law of Large Numbers (LLN).ipynb +0 -0
- Concepts and Topics Folder/concepts from other sources/lists.ipynb +0 -28
Concepts and Topics Folder/Basics/Basics 101.ipynb
DELETED
|
@@ -1,234 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "markdown",
|
| 5 |
-
"id": "e3d0a0d0",
|
| 6 |
-
"metadata": {},
|
| 7 |
-
"source": [
|
| 8 |
-
"#### 1 tick = 100 pips = $1 XAU unit\n",
|
| 9 |
-
"\n",
|
| 10 |
-
"Atleast that is true for XAUUSD market. Every ticcker,symbol,or instuments have diffirent 'quotes' such as tick calculations, number of digits on decimals, spread, comissions, and more factors other than that."
|
| 11 |
-
]
|
| 12 |
-
},
|
| 13 |
-
{
|
| 14 |
-
"cell_type": "code",
|
| 15 |
-
"execution_count": null,
|
| 16 |
-
"id": "fddb4d38",
|
| 17 |
-
"metadata": {
|
| 18 |
-
"vscode": {
|
| 19 |
-
"languageId": "plaintext"
|
| 20 |
-
}
|
| 21 |
-
},
|
| 22 |
-
"outputs": [],
|
| 23 |
-
"source": [
|
| 24 |
-
"For example, these are the quotes from accross tradable symbols ini Exness cent accounts.\n",
|
| 25 |
-
"\n",
|
| 26 |
-
"For needed_tick_points, needed_pips_points, and needed_symbol_price_points data is about: {How much 'distance needed' equivalent of 1 unit risk (account's money as unit. It's 1 USC (cent, for cent accounts) or 1 USD (dollar, for dollar accounts) in Exness Broker) if using a 0.01 volume lot size.}\n",
|
| 27 |
-
" symbol needed_tick_points needed_pips_points needed_symbol_price_points bid ask spread_tick_points spread_pips_points spread_price_points price_difference digits volume_min volume_max volume_step swap_long swap_short\n",
|
| 28 |
-
"0 BTCUSDc 10000 1000.00000 100.00 87128.41 87146.41 1800 180.00000 18.00 0.18000 2 0.01000 1000.00000 0.01000 -1551.10000 0.00000\n",
|
| 29 |
-
"1 AUDCADc 138 13.80000 0.00138 0.91007 0.91029 22 2.20000 0.00022 0.15942 5 0.01000 200.00000 0.01000 -1.40000 -7.40000\n",
|
| 30 |
-
"2 AUDCHFc 80 8.00000 0.00080 0.52600 0.52609 9 0.90000 0.00009 0.11250 5 0.01000 200.00000 0.01000 0.00000 -8.20000\n",
|
| 31 |
-
"3 AUDJPYc 156 15.60000 0.156 102.991 103.010 19 1.90000 0.019 0.12179 3 0.01000 200.00000 0.01000 -0.20000 -1.90000\n",
|
| 32 |
-
"4 AUDNZDc 173 17.30000 0.00173 1.14628 1.14648 20 2.00000 0.00020 0.11561 5 0.01000 200.00000 0.01000 -1.40000 -8.50000\n",
|
| 33 |
-
"5 AUDUSDc 100 10.00000 0.00100 0.66055 0.66064 9 0.90000 0.00009 0.09000 5 0.01000 200.00000 0.01000 -1.50000 -0.10000\n",
|
| 34 |
-
"6 CADJPYc 156 15.60000 0.156 113.141 113.179 38 3.80000 0.038 0.24359 3 0.01000 200.00000 0.01000 0.00000 -7.90000\n",
|
| 35 |
-
"7 CHFJPYc 156 15.60000 0.156 195.788 195.812 24 2.40000 0.024 0.15385 3 0.01000 200.00000 0.01000 -6.00000 0.00000\n",
|
| 36 |
-
"8 EURAUDc 151 15.10000 0.00151 1.77401 1.77435 34 3.40000 0.00034 0.22517 5 0.01000 200.00000 0.01000 -13.80000 0.00000\n",
|
| 37 |
-
"9 EURCADc 138 13.80000 0.00138 1.61473 1.61502 29 2.90000 0.00029 0.21014 5 0.01000 200.00000 0.01000 -2.20000 -1.90000\n",
|
| 38 |
-
"10 EURCHFc 80 8.00000 0.00080 0.93319 0.93344 25 2.50000 0.00025 0.31250 5 0.01000 200.00000 0.01000 0.00000 -9.60000\n",
|
| 39 |
-
"11 EURGBPc 75 7.50000 0.00075 0.87809 0.87823 14 1.40000 0.00014 0.18667 5 0.01000 200.00000 0.01000 -8.50000 0.00000\n",
|
| 40 |
-
"12 EURJPYc 156 15.60000 0.156 182.730 182.754 24 2.40000 0.024 0.15385 3 0.01000 200.00000 0.01000 0.00000 -12.90000\n",
|
| 41 |
-
"13 EURNZDc 174 17.40000 0.00174 2.03362 2.03416 54 5.40000 0.00054 0.31034 5 0.01000 200.00000 0.01000 -8.80000 -2.90000\n",
|
| 42 |
-
"14 EURUSDc 100 10.00000 0.00100 1.17199 1.17207 8 0.80000 0.00008 0.08000 5 0.01000 200.00000 0.01000 -6.90000 0.00000\n",
|
| 43 |
-
"15 GBPAUDc 151 15.10000 0.00151 2.02023 2.02048 25 2.50000 0.00025 0.16556 5 0.01000 200.00000 0.01000 -0.50000 -5.10000\n",
|
| 44 |
-
"16 GBPCADc 138 13.80000 0.00138 1.83868 1.83916 48 4.80000 0.00048 0.34783 5 0.01000 200.00000 0.01000 0.00000 -11.60000\n",
|
| 45 |
-
"17 GBPCHFc 80 8.00000 0.00080 1.06266 1.06290 24 2.40000 0.00024 0.30000 5 0.01000 200.00000 0.01000 0.00000 -22.80000\n",
|
| 46 |
-
"18 GBPJPYc 156 15.60000 0.156 208.085 208.107 22 2.20000 0.022 0.14103 3 0.01000 200.00000 0.01000 0.00000 -27.50000\n",
|
| 47 |
-
"19 GBPNZDc 174 17.40000 0.00174 2.31576 2.31634 58 5.80000 0.00058 0.33333 5 0.01000 200.00000 0.01000 -1.30000 -19.70000\n",
|
| 48 |
-
"20 GBPUSDc 100 10.00000 0.00100 1.33461 1.33471 10 1.00000 0.00010 0.10000 5 0.01000 200.00000 0.01000 -1.00000 -1.60000\n",
|
| 49 |
-
"21 NZDJPYc 156 15.60000 0.156 89.827 89.870 43 4.30000 0.043 0.27564 3 0.01000 200.00000 0.01000 0.00000 -9.70000\n",
|
| 50 |
-
"22 NZDUSDc 100 10.00000 0.00100 0.57616 0.57634 18 1.80000 0.00018 0.18000 5 0.01000 200.00000 0.01000 -4.90000 0.00000\n",
|
| 51 |
-
"23 USDCADc 138 13.80000 0.00138 1.37797 1.37812 15 1.50000 0.00015 0.10870 5 0.01000 200.00000 0.01000 0.00000 -8.00000\n",
|
| 52 |
-
"24 USDCHFc 80 8.00000 0.00080 0.79625 0.79638 13 1.30000 0.00013 0.16250 5 0.01000 200.00000 0.01000 0.00000 -11.00000\n",
|
| 53 |
-
"25 USDHKDc 778 77.80000 0.00778 7.78015 7.78405 390 39.00000 0.00390 0.50129 5 0.01000 200.00000 0.01000 0.00000 -35.00000\n",
|
| 54 |
-
"26 USDJPYc 156 15.60000 0.156 155.913 155.923 10 1.00000 0.010 0.06410 3 0.01000 200.00000 0.01000 0.00000 -15.50000\n",
|
| 55 |
-
"27 XAGUSDc 20 2.00000 0.020 66.118 66.138 20 2.00000 0.020 1.00000 3 0.01000 200.00000 0.01000 -10.00000 0.00000\n",
|
| 56 |
-
"28 XAUUSDc 1000 100.00000 1.000 4323.456 4323.616 160 16.00000 0.160 0.16000 3 0.01000 200.00000 0.01000 -580.00000 0.00000"
|
| 57 |
-
]
|
| 58 |
-
},
|
| 59 |
-
{
|
| 60 |
-
"cell_type": "markdown",
|
| 61 |
-
"id": "df5c1a3c",
|
| 62 |
-
"metadata": {},
|
| 63 |
-
"source": []
|
| 64 |
-
},
|
| 65 |
-
{
|
| 66 |
-
"cell_type": "markdown",
|
| 67 |
-
"id": "3843c075",
|
| 68 |
-
"metadata": {},
|
| 69 |
-
"source": [
|
| 70 |
-
"When doing a heavy backtest, these metrics are calculated at least to be able to conclude robustness of the strategy"
|
| 71 |
-
]
|
| 72 |
-
},
|
| 73 |
-
{
|
| 74 |
-
"cell_type": "code",
|
| 75 |
-
"execution_count": null,
|
| 76 |
-
"id": "40ad323f",
|
| 77 |
-
"metadata": {
|
| 78 |
-
"vscode": {
|
| 79 |
-
"languageId": "plaintext"
|
| 80 |
-
}
|
| 81 |
-
},
|
| 82 |
-
"outputs": [],
|
| 83 |
-
"source": [
|
| 84 |
-
"inital balance:\n",
|
| 85 |
-
"ending balance: \n",
|
| 86 |
-
"\n",
|
| 87 |
-
"number of trading days:\n",
|
| 88 |
-
"duration of drawdown period (days):\n",
|
| 89 |
-
"\n",
|
| 90 |
-
"number of trades:\n",
|
| 91 |
-
"number of profitable trades:\n",
|
| 92 |
-
"number of unprofitable trades:\n",
|
| 93 |
-
"\n",
|
| 94 |
-
"winrate (%): \n",
|
| 95 |
-
"return (%): \n",
|
| 96 |
-
"maximum drawdown (%): \n",
|
| 97 |
-
"\n",
|
| 98 |
-
"winstreak trades\n",
|
| 99 |
-
"losestreak trades\n",
|
| 100 |
-
"\n",
|
| 101 |
-
"avereage winning trade duration\n",
|
| 102 |
-
"avereage losing trade duration\n",
|
| 103 |
-
"longest drawdown duratiotn\n",
|
| 104 |
-
"averange drawsown duration\n",
|
| 105 |
-
"\n",
|
| 106 |
-
"average risk (%):\n",
|
| 107 |
-
"average profit (%): \n",
|
| 108 |
-
"average loss (%): \n",
|
| 109 |
-
"\n",
|
| 110 |
-
"average symbol's +units:\n",
|
| 111 |
-
"average symbol's -units:\n",
|
| 112 |
-
"\n",
|
| 113 |
-
"average +R multiple:\n",
|
| 114 |
-
"average -R multiple:\n",
|
| 115 |
-
"\n",
|
| 116 |
-
"expected value: \n",
|
| 117 |
-
"sharpe ratio: \n",
|
| 118 |
-
"sortino ratio: \n",
|
| 119 |
-
"profit factor: \n",
|
| 120 |
-
"recovery factor: \n",
|
| 121 |
-
"\n",
|
| 122 |
-
"cagr:\n",
|
| 123 |
-
"calmar ratio:\n",
|
| 124 |
-
"\n",
|
| 125 |
-
"stability in forward looking sense:"
|
| 126 |
-
]
|
| 127 |
-
},
|
| 128 |
-
{
|
| 129 |
-
"cell_type": "markdown",
|
| 130 |
-
"id": "84ffffcf",
|
| 131 |
-
"metadata": {},
|
| 132 |
-
"source": [
|
| 133 |
-
"Focus on individual trade results because that is the most genuine way to exploit your behaviour of approaching the market. Do not focus on daily metrics because it's not time yet."
|
| 134 |
-
]
|
| 135 |
-
},
|
| 136 |
-
{
|
| 137 |
-
"cell_type": "markdown",
|
| 138 |
-
"id": "b0ed6a51",
|
| 139 |
-
"metadata": {},
|
| 140 |
-
"source": [
|
| 141 |
-
"How to Run Multiple Copies of MetaTrader5 on Your PC or VPS https://www.youtube.com/watch?v=Kwm3rqfbI2U\n",
|
| 142 |
-
"\n",
|
| 143 |
-
"How to Run LLMs Locally - Full Guide https://www.youtube.com/watch?v=km5-0jhv0JI"
|
| 144 |
-
]
|
| 145 |
-
},
|
| 146 |
-
{
|
| 147 |
-
"cell_type": "markdown",
|
| 148 |
-
"id": "f92bdb42",
|
| 149 |
-
"metadata": {},
|
| 150 |
-
"source": [
|
| 151 |
-
" <img src=\"https://miro.medium.com/v2/resize:fit:421/1*WqY_Qs_gVXBVbyyvepOGPQ.png\" alt=\"Oanda\" height=\"23\"/>\n",
|
| 152 |
-
" <img src=\"https://i0.wp.com/topfxbrokersreview.com/wp-content/uploads/2022/07/Pepperstone-review.png\" alt=\"Pepperstone\" height=\"33\"/>\n",
|
| 153 |
-
" <img src=\"https://media.mytradingland.com/images/66c4d0b07555e.png\" alt=\"HF Markets\" height=\"15\"/>\n",
|
| 154 |
-
" <img src=\"https://tse3.mm.bing.net/th/id/OIP.XOuuYEj8eq8pUD2pFk9kFQHaCV?rs=1&pid=ImgDetMain&o=7&rm=3\" alt=\"XM Trading\" height=\"15\"/>\n",
|
| 155 |
-
" <img src=\"https://www.daytrading.com/wp-content/uploads/2021/01/XTB-Trading-Broker.png\" alt=\"XTB\" height=\"20\"/>\n",
|
| 156 |
-
" <img src=\"https://tokenist.com/wp-content/uploads/2020/03/Forex.com-Banner.jpg\" alt=\"Forex.com\" height=\"15\"/>"
|
| 157 |
-
]
|
| 158 |
-
},
|
| 159 |
-
{
|
| 160 |
-
"cell_type": "markdown",
|
| 161 |
-
"id": "6da5c12c",
|
| 162 |
-
"metadata": {},
|
| 163 |
-
"source": []
|
| 164 |
-
},
|
| 165 |
-
{
|
| 166 |
-
"cell_type": "code",
|
| 167 |
-
"execution_count": null,
|
| 168 |
-
"id": "d836336f",
|
| 169 |
-
"metadata": {
|
| 170 |
-
"vscode": {
|
| 171 |
-
"languageId": "plaintext"
|
| 172 |
-
}
|
| 173 |
-
},
|
| 174 |
-
"outputs": [],
|
| 175 |
-
"source": [
|
| 176 |
-
"===== HEAVY BACKTEST SUMMARY (1% RISK PER TRADE, SL ≥ SPREAD×10) =====\n",
|
| 177 |
-
"\n",
|
| 178 |
-
" Profitable trades Unprofitable trades Max SL distance Min SL distance Avg SL distance Max TP distance Min TP distance Avg TP distance Avg +R multiple Winrate % Max DD % Drawdown absolute % Relative drawdown % Sharpe ratio Sortino ratio Consecutive (+) trades Consecutive (-) trades Net Return %\n",
|
| 179 |
-
"Timeframe \n",
|
| 180 |
-
"M4 16552 17361 42.806 1.600 3.422170 32.416 0.000 1.977847 -0.009423 48.807242 -99.679881 99.656876 99.679881 -0.162597 -0.230694 16552 17361 -99.026498\n",
|
| 181 |
-
"M5 14625 15309 39.800 1.600 3.611236 42.366 0.000 2.126612 0.003659 48.857486 -82.197418 71.677036 82.197418 0.060817 0.084676 14625 15309 -24.278719\n",
|
| 182 |
-
"M6 13109 13802 45.844 1.600 3.809075 45.705 0.000 2.285064 -0.004026 48.712422 -96.126322 96.035894 96.126322 -0.065858 -0.092903 13109 13802 -90.490769\n",
|
| 183 |
-
"M10 9202 9734 57.221 1.600 4.451503 56.334 0.000 2.762396 0.008995 48.595268 -69.297228 62.884651 69.297228 0.133447 0.190364 9202 9734 86.255420\n",
|
| 184 |
-
"M12 8026 8497 84.832 1.600 4.758507 83.945 0.000 2.976818 0.004777 48.574714 -74.854354 67.606027 74.854354 0.070069 0.102067 8026 8497 -16.078615\n",
|
| 185 |
-
"M15 6712 7059 59.728 1.600 5.167716 59.345 0.000 3.295081 -0.005517 48.740106 -89.918415 86.484689 89.918415 -0.074855 -0.101841 6712 7059 -81.745761\n",
|
| 186 |
-
"M20 5409 5488 58.114 1.600 5.767658 52.814 0.001 3.731856 0.010386 49.637515 -67.962905 12.385821 67.962905 0.133123 0.186065 5409 5488 35.053449\n",
|
| 187 |
-
"M30 3745 3859 63.063 1.601 6.788320 62.606 0.000 4.462068 0.005580 49.250395 -65.729544 45.245507 65.729544 0.069929 0.094027 3745 3859 -17.030833\n",
|
| 188 |
-
"H1 1945 2042 65.231 1.602 9.413281 62.269 0.001 6.420249 -0.014588 48.783547 -79.037662 68.077395 79.037662 -0.171058 -0.226640 1945 2042 -61.203277\n",
|
| 189 |
-
"H2 1061 1040 84.749 1.625 13.046021 79.253 0.002 8.858342 0.079830 50.499762 -34.107495 14.646739 34.107495 0.795211 1.146812 1061 1040 310.853510\n",
|
| 190 |
-
"H3 746 674 118.580 1.641 15.797608 114.394 0.004 10.715046 0.104634 52.535211 -34.345155 20.858117 34.345155 0.925820 1.345478 746 674 253.551021\n",
|
| 191 |
-
"H4 564 537 124.489 1.706 17.901163 114.791 0.002 12.231112 0.036647 51.226158 -32.550191 32.550191 32.550191 0.354188 0.475141 564 537 29.157263\n",
|
| 192 |
-
"H6 391 357 146.281 1.706 22.362922 142.095 0.015 15.440084 0.132572 52.272727 -43.292993 3.449685 43.292993 1.112273 1.522858 391 357 136.101619\n",
|
| 193 |
-
"H8 280 291 163.279 2.223 25.821186 159.915 0.005 17.638392 0.011653 49.036778 -43.616079 20.017672 43.616079 0.106926 0.151853 280 291 -1.742563\n",
|
| 194 |
-
"H12 194 199 164.346 2.529 31.623690 160.160 0.083 22.337674 0.076544 49.363868 -35.009527 0.000000 35.009527 0.557358 0.807148 194 199 23.370903\n",
|
| 195 |
-
"D1 103 112 279.131 2.529 41.776200 267.327 0.083 28.581972 0.091853 47.906977 -33.712446 6.216186 33.712446 0.491381 0.695918 103 112 11.133365\n",
|
| 196 |
-
"W1 19 16 268.503 11.829 102.531600 240.537 0.199 79.664057 0.412969 54.285714 -4.554427 1.438610 4.554427 3.241721 10.023275 19 16 14.755072\n",
|
| 197 |
-
"MN1 5 2 425.899 64.520 207.365571 414.975 22.776 181.196429 0.531283 71.428571 -1.424498 0.000000 1.424498 7.277972 17.261885 5 2 3.737523"
|
| 198 |
-
]
|
| 199 |
-
},
|
| 200 |
-
{
|
| 201 |
-
"cell_type": "markdown",
|
| 202 |
-
"id": "b96950a4",
|
| 203 |
-
"metadata": {},
|
| 204 |
-
"source": [
|
| 205 |
-
"# How to delete internal files?\n",
|
| 206 |
-
"\n",
|
| 207 |
-
"type 'Run' in windows settings and press enter\n",
|
| 208 |
-
"type 'shell:AppsFolder' and OK\n",
|
| 209 |
-
"uninstall unwanted files\n",
|
| 210 |
-
"\n"
|
| 211 |
-
]
|
| 212 |
-
},
|
| 213 |
-
{
|
| 214 |
-
"cell_type": "markdown",
|
| 215 |
-
"id": "3c9ae7ce",
|
| 216 |
-
"metadata": {},
|
| 217 |
-
"source": [
|
| 218 |
-
"# Portfolio diversiofication\n",
|
| 219 |
-
"file:///C:/Users/User/Desktop/eBooks/Giuseppe%20A.%20Paleologo_Advanced%20Portfolio,%20A%20Quant%E2%80%99s%20Guide%20for%20Fundamental%20Investors%20(2021).pdf\n",
|
| 220 |
-
"\n",
|
| 221 |
-
"Maximunum risk single-position\n",
|
| 222 |
-
"maximum losses, loss threshold\n",
|
| 223 |
-
"Determine your levearage\n"
|
| 224 |
-
]
|
| 225 |
-
}
|
| 226 |
-
],
|
| 227 |
-
"metadata": {
|
| 228 |
-
"language_info": {
|
| 229 |
-
"name": "python"
|
| 230 |
-
}
|
| 231 |
-
},
|
| 232 |
-
"nbformat": 4,
|
| 233 |
-
"nbformat_minor": 5
|
| 234 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Concepts and Topics Folder/Basics/Foundation101.ipynb
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
Concepts and Topics Folder/Basics/code promting.ipynb
DELETED
|
@@ -1,65 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "markdown",
|
| 5 |
-
"id": "26ad7a9a",
|
| 6 |
-
"metadata": {},
|
| 7 |
-
"source": [
|
| 8 |
-
"### **Foundation**\n",
|
| 9 |
-
"\n",
|
| 10 |
-
"Use Python to fetch XAUUSDc H1 candles data from MT5. UTC-based timezone. Use plotly whitethemed default candlestick chart. Identify the 'trading_daily_session' as from market-open to market-close, which includes pre-market and overnight time. Plot virtical-dashed line for every first open-candle of the 'trading_daily_session' and the closing-candle of the 'trading_daily_session'. To easily identify the 'trading_daily_session', simply locate the very first candle recorded in pre-market and the last candle recorded at overnight."
|
| 11 |
-
]
|
| 12 |
-
},
|
| 13 |
-
{
|
| 14 |
-
"cell_type": "markdown",
|
| 15 |
-
"id": "bc4116cf",
|
| 16 |
-
"metadata": {},
|
| 17 |
-
"source": [
|
| 18 |
-
"```python\n",
|
| 19 |
-
"\n",
|
| 20 |
-
"# Parameters\n",
|
| 21 |
-
"symbol = \"XAUUSDc\"\n",
|
| 22 |
-
"timeframe = mt5.TIMEFRAME_H1\n",
|
| 23 |
-
"utc_timezone = pytz.UTC\n",
|
| 24 |
-
"lookback_days = 10 # fetch last 10 days of H1 candles\n"
|
| 25 |
-
]
|
| 26 |
-
},
|
| 27 |
-
{
|
| 28 |
-
"cell_type": "markdown",
|
| 29 |
-
"id": "4bdfd191",
|
| 30 |
-
"metadata": {},
|
| 31 |
-
"source": [
|
| 32 |
-
"Use Python to fetch XAUUSDc H1 candles data from MT5. UTC based timezone. Identify the 'trading_day' as from market-open to market-close, which includes pre-market and overnight session."
|
| 33 |
-
]
|
| 34 |
-
},
|
| 35 |
-
{
|
| 36 |
-
"cell_type": "markdown",
|
| 37 |
-
"id": "d31301b2",
|
| 38 |
-
"metadata": {},
|
| 39 |
-
"source": [
|
| 40 |
-
"Identify the 'trading_day' as from market-open to market-close, which includes pre-market and overnight session."
|
| 41 |
-
]
|
| 42 |
-
},
|
| 43 |
-
{
|
| 44 |
-
"cell_type": "markdown",
|
| 45 |
-
"id": "48c97277",
|
| 46 |
-
"metadata": {},
|
| 47 |
-
"source": [
|
| 48 |
-
"Identify the 'trading_day' as from market-open to market-close, which includes pre-market and overnight sessions. Make a developing RSI indicator that starts calculating from the start of the trading day and resets at the close of the trading day. PLot the tivk-volume bars on separate pane, plot the RSI indicaor in seeparate pane."
|
| 49 |
-
]
|
| 50 |
-
},
|
| 51 |
-
{
|
| 52 |
-
"cell_type": "markdown",
|
| 53 |
-
"id": "5a401c84",
|
| 54 |
-
"metadata": {},
|
| 55 |
-
"source": []
|
| 56 |
-
}
|
| 57 |
-
],
|
| 58 |
-
"metadata": {
|
| 59 |
-
"language_info": {
|
| 60 |
-
"name": "python"
|
| 61 |
-
}
|
| 62 |
-
},
|
| 63 |
-
"nbformat": 4,
|
| 64 |
-
"nbformat_minor": 5
|
| 65 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Concepts and Topics Folder/Basics/nothing.ipynb
DELETED
|
@@ -1,21 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "markdown",
|
| 5 |
-
"id": "92db2b5c",
|
| 6 |
-
"metadata": {},
|
| 7 |
-
"source": [
|
| 8 |
-
"arxiv\n",
|
| 9 |
-
"algorembrant@gmail.com\n",
|
| 10 |
-
"28903Rem nonon []"
|
| 11 |
-
]
|
| 12 |
-
}
|
| 13 |
-
],
|
| 14 |
-
"metadata": {
|
| 15 |
-
"language_info": {
|
| 16 |
-
"name": "python"
|
| 17 |
-
}
|
| 18 |
-
},
|
| 19 |
-
"nbformat": 4,
|
| 20 |
-
"nbformat_minor": 5
|
| 21 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Concepts and Topics Folder/Chart plotting using python.ipynb
DELETED
|
@@ -1,92 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "code",
|
| 5 |
-
"execution_count": 5,
|
| 6 |
-
"id": "d08b7f8f",
|
| 7 |
-
"metadata": {},
|
| 8 |
-
"outputs": [
|
| 9 |
-
{
|
| 10 |
-
"name": "stderr",
|
| 11 |
-
"output_type": "stream",
|
| 12 |
-
"text": [
|
| 13 |
-
"/tmp/ipykernel_6681/1176555379.py:5: FutureWarning: YF.download() has changed argument auto_adjust default to True\n",
|
| 14 |
-
" data = yf.download(symbol, interval=\"30m\", period=\"5d\")\n",
|
| 15 |
-
"[*********************100%***********************] 1 of 1 completed\n",
|
| 16 |
-
"\n",
|
| 17 |
-
"1 Failed download:\n",
|
| 18 |
-
"['XAUUSD=X']: YFPricesMissingError('possibly delisted; no price data found (period=5d) (Yahoo error = \"No data found, symbol may be delisted\")')\n"
|
| 19 |
-
]
|
| 20 |
-
},
|
| 21 |
-
{
|
| 22 |
-
"name": "stdout",
|
| 23 |
-
"output_type": "stream",
|
| 24 |
-
"text": [
|
| 25 |
-
"Empty DataFrame\n",
|
| 26 |
-
"Columns: [(Adj Close, XAUUSD=X), (Close, XAUUSD=X), (High, XAUUSD=X), (Low, XAUUSD=X), (Open, XAUUSD=X), (Volume, XAUUSD=X)]\n",
|
| 27 |
-
"Index: []\n",
|
| 28 |
-
"Price Ticker \n",
|
| 29 |
-
"Adj Close XAUUSD=X float64\n",
|
| 30 |
-
"Close XAUUSD=X float64\n",
|
| 31 |
-
"High XAUUSD=X float64\n",
|
| 32 |
-
"Low XAUUSD=X float64\n",
|
| 33 |
-
"Open XAUUSD=X float64\n",
|
| 34 |
-
"Volume XAUUSD=X float64\n",
|
| 35 |
-
"dtype: object\n"
|
| 36 |
-
]
|
| 37 |
-
},
|
| 38 |
-
{
|
| 39 |
-
"ename": "ValueError",
|
| 40 |
-
"evalue": "Data for column \"Open\" must be ALL float or int.",
|
| 41 |
-
"output_type": "error",
|
| 42 |
-
"traceback": [
|
| 43 |
-
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
|
| 44 |
-
"\u001b[31mValueError\u001b[39m Traceback (most recent call last)",
|
| 45 |
-
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[5]\u001b[39m\u001b[32m, line 15\u001b[39m\n\u001b[32m 12\u001b[39m cols = [\u001b[33m\"\u001b[39m\u001b[33mOpen\u001b[39m\u001b[33m\"\u001b[39m, \u001b[33m\"\u001b[39m\u001b[33mHigh\u001b[39m\u001b[33m\"\u001b[39m, \u001b[33m\"\u001b[39m\u001b[33mLow\u001b[39m\u001b[33m\"\u001b[39m, \u001b[33m\"\u001b[39m\u001b[33mClose\u001b[39m\u001b[33m\"\u001b[39m, \u001b[33m\"\u001b[39m\u001b[33mVolume\u001b[39m\u001b[33m\"\u001b[39m]\n\u001b[32m 13\u001b[39m data[cols] = data[cols].astype(\u001b[38;5;28mfloat\u001b[39m)\n\u001b[32m---> \u001b[39m\u001b[32m15\u001b[39m \u001b[43mmpf\u001b[49m\u001b[43m.\u001b[49m\u001b[43mplot\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdata\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mtype\u001b[39;49m\u001b[43m=\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mcandle\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43mvolume\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43mstyle\u001b[49m\u001b[43m=\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43myahoo\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43mtitle\u001b[49m\u001b[43m=\u001b[49m\u001b[33;43mf\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[38;5;132;43;01m{\u001b[39;49;00m\u001b[43msymbol\u001b[49m\u001b[38;5;132;43;01m}\u001b[39;49;00m\u001b[33;43m Price Chart\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43mylabel\u001b[49m\u001b[43m=\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mPrice (USD)\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43mylabel_lower\u001b[49m\u001b[43m=\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mVolume\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43mfigratio\u001b[49m\u001b[43m=\u001b[49m\u001b[43m(\u001b[49m\u001b[32;43m16\u001b[39;49m\u001b[43m,\u001b[49m\u001b[32;43m9\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtight_layout\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m)\u001b[49m\n",
|
| 46 |
-
"\u001b[36mFile \u001b[39m\u001b[32m/workspaces/Pinescript.TradingView-Indicators.and.Strategies/.venv/lib/python3.12/site-packages/mplfinance/plotting.py:417\u001b[39m, in \u001b[36mplot\u001b[39m\u001b[34m(data, **kwargs)\u001b[39m\n\u001b[32m 414\u001b[39m \u001b[38;5;66;03m# translate alias types:\u001b[39;00m\n\u001b[32m 415\u001b[39m config[\u001b[33m'\u001b[39m\u001b[33mtype\u001b[39m\u001b[33m'\u001b[39m] = _get_valid_plot_types(config[\u001b[33m'\u001b[39m\u001b[33mtype\u001b[39m\u001b[33m'\u001b[39m])\n\u001b[32m--> \u001b[39m\u001b[32m417\u001b[39m dates,opens,highs,lows,closes,volumes = \u001b[43m_check_and_prepare_data\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdata\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mconfig\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 419\u001b[39m config[\u001b[33m'\u001b[39m\u001b[33mxlim\u001b[39m\u001b[33m'\u001b[39m] = _check_and_convert_xlim_configuration(data, config)\n\u001b[32m 421\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m config[\u001b[33m'\u001b[39m\u001b[33mtype\u001b[39m\u001b[33m'\u001b[39m] \u001b[38;5;129;01min\u001b[39;00m VALID_PMOVE_TYPES \u001b[38;5;129;01mand\u001b[39;00m config[\u001b[33m'\u001b[39m\u001b[33maddplot\u001b[39m\u001b[33m'\u001b[39m] \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n",
|
| 47 |
-
"\u001b[36mFile \u001b[39m\u001b[32m/workspaces/Pinescript.TradingView-Indicators.and.Strategies/.venv/lib/python3.12/site-packages/mplfinance/_arg_validators.py:74\u001b[39m, in \u001b[36m_check_and_prepare_data\u001b[39m\u001b[34m(data, config)\u001b[39m\n\u001b[32m 72\u001b[39m \u001b[38;5;28;01mfor\u001b[39;00m col \u001b[38;5;129;01min\u001b[39;00m cols:\n\u001b[32m 73\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mall\u001b[39m( \u001b[38;5;28misinstance\u001b[39m(v,(\u001b[38;5;28mfloat\u001b[39m,\u001b[38;5;28mint\u001b[39m)) \u001b[38;5;28;01mfor\u001b[39;00m v \u001b[38;5;129;01min\u001b[39;00m data[col] ):\n\u001b[32m---> \u001b[39m\u001b[32m74\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[33m'\u001b[39m\u001b[33mData for column \u001b[39m\u001b[33m\"\u001b[39m\u001b[33m'\u001b[39m+\u001b[38;5;28mstr\u001b[39m(col)+\u001b[33m'\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m must be ALL float or int.\u001b[39m\u001b[33m'\u001b[39m)\n\u001b[32m 76\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m config[\u001b[33m'\u001b[39m\u001b[33mtz_localize\u001b[39m\u001b[33m'\u001b[39m]:\n\u001b[32m 77\u001b[39m dates = mdates.date2num(data.index.tz_localize(\u001b[38;5;28;01mNone\u001b[39;00m).to_pydatetime())\n",
|
| 48 |
-
"\u001b[31mValueError\u001b[39m: Data for column \"Open\" must be ALL float or int."
|
| 49 |
-
]
|
| 50 |
-
}
|
| 51 |
-
],
|
| 52 |
-
"source": [
|
| 53 |
-
"import yfinance as yf\n",
|
| 54 |
-
"import mplfinance as mpf\n",
|
| 55 |
-
"\n",
|
| 56 |
-
"symbol = \"XAUUSD=X\" # or \"GC=F\"\n",
|
| 57 |
-
"data = yf.download(symbol, interval=\"30m\", period=\"5d\")\n",
|
| 58 |
-
"\n",
|
| 59 |
-
"print(data)\n",
|
| 60 |
-
"print(data.dtypes)\n",
|
| 61 |
-
"\n",
|
| 62 |
-
"# FIX: Drop NaNs + convert to float\n",
|
| 63 |
-
"data = data.dropna()\n",
|
| 64 |
-
"cols = [\"Open\", \"High\", \"Low\", \"Close\", \"Volume\"]\n",
|
| 65 |
-
"data[cols] = data[cols].astype(float)\n",
|
| 66 |
-
"\n",
|
| 67 |
-
"mpf.plot(data, type=\"candle\",volume=True,style=\"yahoo\",title=f\"{symbol} Price Chart\",ylabel=\"Price (USD)\",ylabel_lower=\"Volume\",figratio=(16,9), tight_layout=True)\n"
|
| 68 |
-
]
|
| 69 |
-
}
|
| 70 |
-
],
|
| 71 |
-
"metadata": {
|
| 72 |
-
"kernelspec": {
|
| 73 |
-
"display_name": ".venv",
|
| 74 |
-
"language": "python",
|
| 75 |
-
"name": "python3"
|
| 76 |
-
},
|
| 77 |
-
"language_info": {
|
| 78 |
-
"codemirror_mode": {
|
| 79 |
-
"name": "ipython",
|
| 80 |
-
"version": 3
|
| 81 |
-
},
|
| 82 |
-
"file_extension": ".py",
|
| 83 |
-
"mimetype": "text/x-python",
|
| 84 |
-
"name": "python",
|
| 85 |
-
"nbconvert_exporter": "python",
|
| 86 |
-
"pygments_lexer": "ipython3",
|
| 87 |
-
"version": "3.12.1"
|
| 88 |
-
}
|
| 89 |
-
},
|
| 90 |
-
"nbformat": 4,
|
| 91 |
-
"nbformat_minor": 5
|
| 92 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Concepts and Topics Folder/Max Number of Losing Streak in Regards to Winrate.ipynb
DELETED
|
@@ -1,101 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "code",
|
| 5 |
-
"execution_count": null,
|
| 6 |
-
"id": "6447cec1",
|
| 7 |
-
"metadata": {
|
| 8 |
-
"vscode": {
|
| 9 |
-
"languageId": "plaintext"
|
| 10 |
-
}
|
| 11 |
-
},
|
| 12 |
-
"outputs": [],
|
| 13 |
-
"source": [
|
| 14 |
-
"!pip install numpy pandas plotly --quiet"
|
| 15 |
-
]
|
| 16 |
-
},
|
| 17 |
-
{
|
| 18 |
-
"cell_type": "code",
|
| 19 |
-
"execution_count": null,
|
| 20 |
-
"id": "ebe3fdb8",
|
| 21 |
-
"metadata": {
|
| 22 |
-
"vscode": {
|
| 23 |
-
"languageId": "plaintext"
|
| 24 |
-
}
|
| 25 |
-
},
|
| 26 |
-
"outputs": [],
|
| 27 |
-
"source": [
|
| 28 |
-
"import numpy as np\n",
|
| 29 |
-
"import pandas as pd\n",
|
| 30 |
-
"import plotly.express as px\n",
|
| 31 |
-
"\n",
|
| 32 |
-
"# Parameters\n",
|
| 33 |
-
"initial_capital = 100\n",
|
| 34 |
-
"win_rate = 0.1 # 10% chance to win\n",
|
| 35 |
-
"risk_per_trade = 0.01 # 1% risk per trade\n",
|
| 36 |
-
"lot_size = initial_capital * risk_per_trade\n",
|
| 37 |
-
"n_simulations = 1000 # number of Monte Carlo runs\n",
|
| 38 |
-
"\n",
|
| 39 |
-
"# Function to simulate one run until account goes to zero\n",
|
| 40 |
-
"def simulate_run(initial_capital, win_rate, lot_size):\n",
|
| 41 |
-
" capital = initial_capital\n",
|
| 42 |
-
" attempts = 0\n",
|
| 43 |
-
" history = [capital]\n",
|
| 44 |
-
" while capital > 0:\n",
|
| 45 |
-
" attempts += 1\n",
|
| 46 |
-
" outcome = np.random.rand() < win_rate\n",
|
| 47 |
-
" if outcome:\n",
|
| 48 |
-
" capital += lot_size\n",
|
| 49 |
-
" else:\n",
|
| 50 |
-
" capital -= lot_size\n",
|
| 51 |
-
" history.append(capital)\n",
|
| 52 |
-
" return attempts, history\n",
|
| 53 |
-
"\n",
|
| 54 |
-
"# Run multiple simulations\n",
|
| 55 |
-
"results = []\n",
|
| 56 |
-
"histories = []\n",
|
| 57 |
-
"for _ in range(n_simulations):\n",
|
| 58 |
-
" attempts, history = simulate_run(initial_capital, win_rate, lot_size)\n",
|
| 59 |
-
" results.append(attempts)\n",
|
| 60 |
-
" histories.append(history)\n",
|
| 61 |
-
"\n",
|
| 62 |
-
"# Create DataFrame of attempts\n",
|
| 63 |
-
"df = pd.DataFrame(results, columns=['Attempts'])\n",
|
| 64 |
-
"\n",
|
| 65 |
-
"# Histogram of attempts before ruin\n",
|
| 66 |
-
"fig_hist = px.histogram(df, x='Attempts', nbins=50,\n",
|
| 67 |
-
" title='Distribution of Attempts Before Account Goes to Zero',\n",
|
| 68 |
-
" labels={'Attempts':'Number of Attempts'})\n",
|
| 69 |
-
"fig_hist.show()\n",
|
| 70 |
-
"\n",
|
| 71 |
-
"# --- Find the peak of the distribution ---\n",
|
| 72 |
-
"mode_attempts = df['Attempts'].mode()[0] # most frequent attempt count\n",
|
| 73 |
-
"count_mode = (df['Attempts'] == mode_attempts).sum()\n",
|
| 74 |
-
"print(f\"Peak of distribution: {mode_attempts} attempts (occurred {count_mode} times)\")\n",
|
| 75 |
-
"\n",
|
| 76 |
-
"# Select all runs that ended at this mode attempt count\n",
|
| 77 |
-
"mode_runs = [hist for hist, att in zip(histories, results) if att == mode_attempts]\n",
|
| 78 |
-
"\n",
|
| 79 |
-
"# Build DataFrame for plotting\n",
|
| 80 |
-
"curve_data = []\n",
|
| 81 |
-
"for i, hist in enumerate(mode_runs, 1):\n",
|
| 82 |
-
" curve_data.extend([{'Attempt': j, 'Capital': c, 'Run': f'Run {i}'} for j, c in enumerate(hist)])\n",
|
| 83 |
-
"\n",
|
| 84 |
-
"df_curves = pd.DataFrame(curve_data)\n",
|
| 85 |
-
"\n",
|
| 86 |
-
"# Plot equity curves for mode runs\n",
|
| 87 |
-
"fig_curves = px.line(df_curves, x='Attempt', y='Capital', color='Run',\n",
|
| 88 |
-
" title=f'Equity Curves for Peak Distribution ({mode_attempts} Attempts, {count_mode} runs)',\n",
|
| 89 |
-
" labels={'Capital':'Account Balance'})\n",
|
| 90 |
-
"fig_curves.show()"
|
| 91 |
-
]
|
| 92 |
-
}
|
| 93 |
-
],
|
| 94 |
-
"metadata": {
|
| 95 |
-
"language_info": {
|
| 96 |
-
"name": "python"
|
| 97 |
-
}
|
| 98 |
-
},
|
| 99 |
-
"nbformat": 4,
|
| 100 |
-
"nbformat_minor": 5
|
| 101 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Concepts and Topics Folder/Risk Management Logic.ipynb
DELETED
|
@@ -1,56 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "markdown",
|
| 5 |
-
"id": "95497985",
|
| 6 |
-
"metadata": {},
|
| 7 |
-
"source": [
|
| 8 |
-
"# Risk Management\n",
|
| 9 |
-
"*algorembrant*"
|
| 10 |
-
]
|
| 11 |
-
},
|
| 12 |
-
{
|
| 13 |
-
"cell_type": "markdown",
|
| 14 |
-
"id": "a3f2b08d",
|
| 15 |
-
"metadata": {},
|
| 16 |
-
"source": [
|
| 17 |
-
"## Trading Formula Reference\n",
|
| 18 |
-
"\n",
|
| 19 |
-
"This document outlines key formulas used in trading calculations, along with their descriptions.\n",
|
| 20 |
-
"\n",
|
| 21 |
-
"| **Formula** | **Description** |\n",
|
| 22 |
-
"|------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|\n",
|
| 23 |
-
"| *BuyOrders = BuyStop, BuyLimit, BuyMarket* | Defines the types of buy-side orders used to enter a trade in different ways. |\n",
|
| 24 |
-
"| *SellOrders = SellStop, SellLimit, SellMarket* | Defines the types of sell-side orders used to exit or short a trade. |\n",
|
| 25 |
-
"| *TickDisplacement = abs(Price - Price)* | Measures the absolute difference between two price points. The tick size to be calculated dynamically based on the price difference of the instrument. |\n",
|
| 26 |
-
"| *1PriceDisplacement = 1Tick* | Establishes that one unit of price movement equals one tick. |\n",
|
| 27 |
-
"| *TargetPrice = Ticks + EntryPrice* | Calculates the target price by adding a number of ticks to the entry price. |\n",
|
| 28 |
-
"| *RiskInCash = RiskPercentInDecimal × Capital* | Converts the percentage of capital at risk into a cash amount. |\n",
|
| 29 |
-
"| *PositionLotSize = (RiskInCash / StopLossDisplacement) × 0.01StandardBrokerLot* | Determines the appropriate lot size based on risk and stop-loss distance. |\n",
|
| 30 |
-
"| *1RiskInCash = 0.01LotSize* | Determines the appropriate lot size based on risk and stop-loss distance. In this case, the broker has minimum of 0.01 lot size to execute an order. |\n",
|
| 31 |
-
"| *CommissionSpread = 0.02* | Represents the cost of executing a trade, measured as the difference between bid and ask prices. This spread acts as an implicit commission charged by the broker. |\n",
|
| 32 |
-
"| ** | |"
|
| 33 |
-
]
|
| 34 |
-
},
|
| 35 |
-
{
|
| 36 |
-
"cell_type": "markdown",
|
| 37 |
-
"id": "5c9e884d",
|
| 38 |
-
"metadata": {},
|
| 39 |
-
"source": [
|
| 40 |
-
"## Natural Occurences\n",
|
| 41 |
-
"\n",
|
| 42 |
-
"- The LotSize decreases as the StopLoss area increases, but still the same in RiskInPercent.\n",
|
| 43 |
-
"- The LotSize increases as the StopLoss area decreases, but still the same in RiskInPercent.\n",
|
| 44 |
-
"\n",
|
| 45 |
-
"\n"
|
| 46 |
-
]
|
| 47 |
-
}
|
| 48 |
-
],
|
| 49 |
-
"metadata": {
|
| 50 |
-
"language_info": {
|
| 51 |
-
"name": "python"
|
| 52 |
-
}
|
| 53 |
-
},
|
| 54 |
-
"nbformat": 4,
|
| 55 |
-
"nbformat_minor": 5
|
| 56 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Concepts and Topics Folder/The Law of Large Numbers (LLN).ipynb
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
Concepts and Topics Folder/concepts from other sources/lists.ipynb
DELETED
|
@@ -1,28 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "markdown",
|
| 5 |
-
"id": "33a4be8c",
|
| 6 |
-
"metadata": {},
|
| 7 |
-
"source": [
|
| 8 |
-
" # Title: The Ultimate Order Book Guide: Heatmap, Depth and Overlay\n",
|
| 9 |
-
"by: @exitpumpBTC at X.com\n",
|
| 10 |
-
"type: acticle\n",
|
| 11 |
-
"link: https://x.com/exitpumpBTC/status/2002814707380707576\n"
|
| 12 |
-
]
|
| 13 |
-
},
|
| 14 |
-
{
|
| 15 |
-
"cell_type": "markdown",
|
| 16 |
-
"id": "97de9ae1",
|
| 17 |
-
"metadata": {},
|
| 18 |
-
"source": []
|
| 19 |
-
}
|
| 20 |
-
],
|
| 21 |
-
"metadata": {
|
| 22 |
-
"language_info": {
|
| 23 |
-
"name": "python"
|
| 24 |
-
}
|
| 25 |
-
},
|
| 26 |
-
"nbformat": 4,
|
| 27 |
-
"nbformat_minor": 5
|
| 28 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|