Spaces:
Running
Running
Commit Β·
7cd981e
1
Parent(s): b1cf532
patch
Browse filesThis view is limited to 50 files because it contains too many changes. Β See raw diff
- assets/hierarchy.js +1 -1
- assets/highlight.css +7 -0
- assets/navigation.js +1 -1
- assets/search.js +0 -0
- classes/types.ActionBase.html +0 -0
- classes/types.BrokerBase.html +10 -10
- classes/types.MarkdownFileBase.html +9 -9
- classes/types.MarkdownFolderBase.html +4 -4
- classes/types.MemoryBacktestAdapter.html +12 -12
- classes/types.MemoryLiveAdapter.html +12 -12
- classes/types.Performance.html +4 -4
- classes/types.PersistBase.html +9 -9
- classes/types.PersistBreakevenInstance.html +5 -5
- classes/types.PersistCandleInstance.html +5 -5
- classes/types.PersistIntervalInstance.html +7 -7
- classes/types.PersistLogInstance.html +5 -5
- classes/types.PersistMeasureInstance.html +7 -7
- classes/types.PersistMemoryInstance.html +9 -9
- classes/types.PersistNotificationInstance.html +5 -5
- classes/types.PersistPartialInstance.html +5 -5
- classes/types.PersistRecentInstance.html +5 -5
- classes/types.PersistRiskInstance.html +5 -5
- classes/types.PersistScheduleInstance.html +5 -5
- classes/types.PersistSessionInstance.html +6 -6
- classes/types.PersistSignalInstance.html +5 -5
- classes/types.PersistStateInstance.html +6 -6
- classes/types.PersistStorageInstance.html +5 -5
- classes/types.Position.html +3 -3
- classes/types.ReportBase.html +8 -8
- classes/types.StateBacktestAdapter.html +9 -9
- classes/types.StateLiveAdapter.html +9 -9
- documents/concept_02_zero_expectation_escape.html +144 -0
- documents/data_test-guidelines.html +76 -0
- documents/docs.html +17 -5
- documents/docs_class_BacktestLogicPublicService.html +13 -4
- documents/docs_class_CronUtils.html +324 -0
- documents/docs_class_LiveLogicPublicService.html +7 -4
- documents/docs_class_MarkdownFileBase.html +3 -3
- documents/docs_class_PersistBase.html +2 -2
- documents/docs_class_ReportBase.html +3 -3
- documents/docs_class_TimeMetaService.html +5 -1
- documents/docs_function_listenAfterEnd.html +46 -0
- documents/docs_function_listenAfterEndOnce.html +49 -0
- documents/docs_function_listenBeforeStart.html +46 -0
- documents/docs_function_listenBeforeStartOnce.html +49 -0
- documents/docs_interface_AfterEndContract.html +103 -0
- documents/docs_interface_BacktestStatisticsModel.html +2 -2
- documents/docs_interface_BeforeStartContract.html +97 -0
- documents/docs_interface_CronEntry.html +65 -0
- documents/docs_interface_CronHandle.html +27 -0
assets/hierarchy.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
window.hierarchyData = "
|
|
|
|
| 1 |
+
window.hierarchyData = "eJylmVFv2zYUhf+LntlOvCIl0W+tiwHB0sFwhvVh6AMnMY5gWSpEultW5L8PNBWHtCmLVF/sxNbh+cRLUjcnP5Kh75VMVn/hnGCESwwIsyxFmJECYZbrnwr9WckQZqxEkGKKICWpfmEI0hwQpIV+KTMEKQMEOCUIMM4QYKAIgJQIiP6JZiUCqn+ltECkKLOvKBnEYysq1fSdTFY/EgwF0+8dP4hklXwc+r0YPnIpEpTsm65OVhhKlByHNlklVculFPIX9fxNyPdv175/Uoc2Qeb7ZJUoWb/T4nfmgxeU6Pu1bO6M9uwBNH/1aDolhkdenW3Gayc9zgL95VPT1oPo9AxDwb5q56LMbOf7fhdme9/vAjy1Q4nhwmEXem/m2uh706XUzixLbeeNGGQjlVO+m/aWIJYhIxgMAyl8DIPge/FddHedVLyrIoEu1fF0pDR0uW+G1ryrW7EIzZXGcxXYcBXg4brTqu+8XUR2KY5nY+OqKpmH7b7fLcKydNFEFFNDxEoP0WfB5XFYVsYLbTwZnNaXPp+9ZId+eF4IZkvjuWhquIhv3f/eq+axqbg+/hfR+QaIZzSnl36ieRg3fFDNwi1woY0nY2NVc9/u3IpKdGoRmCuN5soBGy7vqbFt5H4ZlSWMZyLUMLnP13Hoh+pJ1MeFZ+ylOJ4tH9mYb74ehJRLN8CFNp6sJCcynBIfWbPrFi59VxrNVaS54cLeaiquFpbSVsZTgakjBt8p+6D6ge+WcjnaeLJx9ePc6Ws3x7/bpjK12Pb/BCK5olgWgPzUienO32bRu3v9JKr9h2Enw0gcSTRHhgvD4Z6eetDIGXEkYV24dr90/ZO3TX16Vm34c9vzOtz9ShpKAU4NXk+y2tzNWq+18GmYUoeyFOkNlqUUS1ZoNnZLxN3HZsBPqg8Eeb082p9kFAEZtyzJPBCvzXMkjCULLAohHvfwWiwuAc4x0iviNAU0zV2I/5put+EDP8gPf2xDURxR4O1Td5fag/za/CvqjRh0p8R3gcf5jQFCiWCS6DfRts/xHCdZqHtWXrvrHXfgkZU4i6KXBh2f/ZRMsvxEbbwDxDOOzxZKPdUyFtHVsmTxPGB4CnD+hvnC270YtkIeWxX4zHUkYatGZy+Wqy/2mUztQiKfc2ynYxSP0WS2M+sanOtYCAW+RpgIcOb8A8Mby5xl1+aTKc2cfXBC8wZAnXzhRhQz5x0Sw1i24Kn7VN4yZx2atVj2NPXZe0OVefegQMUyLz01v5mczCFEpSYWCPMUYSoemWMIjUbe7HPwbLyJDGTOPTD/sMyJZ917g45Z65CQwzLOPcaTacaceXCSYQGUxAMwEVnM+gfGFW/2hdMa3s4lZt3DMgnLHHyT7w0fZr2DggfL2rfgphKGefOwdOFsT9z/UpmeYN0fvrVCiXXfqYFXKqif8Euj+5sCGCIlPjWG+v0KTs9vI1VTyc99LdoItgtlSMvz8vI/AmXVAw=="
|
assets/highlight.css
CHANGED
|
@@ -39,6 +39,8 @@
|
|
| 39 |
--dark-hl-18: #CE9178;
|
| 40 |
--light-hl-19: #000000;
|
| 41 |
--dark-hl-19: #D7BA7D;
|
|
|
|
|
|
|
| 42 |
--light-code-background: #FFFFFF;
|
| 43 |
--dark-code-background: #1E1E1E;
|
| 44 |
}
|
|
@@ -64,6 +66,7 @@
|
|
| 64 |
--hl-17: var(--light-hl-17);
|
| 65 |
--hl-18: var(--light-hl-18);
|
| 66 |
--hl-19: var(--light-hl-19);
|
|
|
|
| 67 |
--code-background: var(--light-code-background);
|
| 68 |
} }
|
| 69 |
|
|
@@ -88,6 +91,7 @@
|
|
| 88 |
--hl-17: var(--dark-hl-17);
|
| 89 |
--hl-18: var(--dark-hl-18);
|
| 90 |
--hl-19: var(--dark-hl-19);
|
|
|
|
| 91 |
--code-background: var(--dark-code-background);
|
| 92 |
} }
|
| 93 |
|
|
@@ -112,6 +116,7 @@
|
|
| 112 |
--hl-17: var(--light-hl-17);
|
| 113 |
--hl-18: var(--light-hl-18);
|
| 114 |
--hl-19: var(--light-hl-19);
|
|
|
|
| 115 |
--code-background: var(--light-code-background);
|
| 116 |
}
|
| 117 |
|
|
@@ -136,6 +141,7 @@
|
|
| 136 |
--hl-17: var(--dark-hl-17);
|
| 137 |
--hl-18: var(--dark-hl-18);
|
| 138 |
--hl-19: var(--dark-hl-19);
|
|
|
|
| 139 |
--code-background: var(--dark-code-background);
|
| 140 |
}
|
| 141 |
|
|
@@ -159,4 +165,5 @@
|
|
| 159 |
.hl-17 { color: var(--hl-17); }
|
| 160 |
.hl-18 { color: var(--hl-18); }
|
| 161 |
.hl-19 { color: var(--hl-19); }
|
|
|
|
| 162 |
pre, code { background: var(--code-background); }
|
|
|
|
| 39 |
--dark-hl-18: #CE9178;
|
| 40 |
--light-hl-19: #000000;
|
| 41 |
--dark-hl-19: #D7BA7D;
|
| 42 |
+
--light-hl-20: #EE0000;
|
| 43 |
+
--dark-hl-20: #DCDCAA;
|
| 44 |
--light-code-background: #FFFFFF;
|
| 45 |
--dark-code-background: #1E1E1E;
|
| 46 |
}
|
|
|
|
| 66 |
--hl-17: var(--light-hl-17);
|
| 67 |
--hl-18: var(--light-hl-18);
|
| 68 |
--hl-19: var(--light-hl-19);
|
| 69 |
+
--hl-20: var(--light-hl-20);
|
| 70 |
--code-background: var(--light-code-background);
|
| 71 |
} }
|
| 72 |
|
|
|
|
| 91 |
--hl-17: var(--dark-hl-17);
|
| 92 |
--hl-18: var(--dark-hl-18);
|
| 93 |
--hl-19: var(--dark-hl-19);
|
| 94 |
+
--hl-20: var(--dark-hl-20);
|
| 95 |
--code-background: var(--dark-code-background);
|
| 96 |
} }
|
| 97 |
|
|
|
|
| 116 |
--hl-17: var(--light-hl-17);
|
| 117 |
--hl-18: var(--light-hl-18);
|
| 118 |
--hl-19: var(--light-hl-19);
|
| 119 |
+
--hl-20: var(--light-hl-20);
|
| 120 |
--code-background: var(--light-code-background);
|
| 121 |
}
|
| 122 |
|
|
|
|
| 141 |
--hl-17: var(--dark-hl-17);
|
| 142 |
--hl-18: var(--dark-hl-18);
|
| 143 |
--hl-19: var(--dark-hl-19);
|
| 144 |
+
--hl-20: var(--dark-hl-20);
|
| 145 |
--code-background: var(--dark-code-background);
|
| 146 |
}
|
| 147 |
|
|
|
|
| 165 |
.hl-17 { color: var(--hl-17); }
|
| 166 |
.hl-18 { color: var(--hl-18); }
|
| 167 |
.hl-19 { color: var(--hl-19); }
|
| 168 |
+
.hl-20 { color: var(--hl-20); }
|
| 169 |
pre, code { background: var(--code-background); }
|
assets/navigation.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
window.navigationData = "eJytfdmS3DiS7b/I7mPXbe1Lv6mk0nT2qKo0Ut7uh7E2GsVARnKSQcaQjJSyxubfr4HggsXhfpzqJy1xFgAEQayO//yfR6P5Pj76y6OyH+uqMY/+9Ki6rZtDb9pHf/nP9dfHT4qm6+6K8taUh+JrXQ6P/vToXI63j/7y6NBVl5Npx+HPs0aRov/v7XhqHv3p0V3dHh795fWz169fPn79v3/a9J8Wg6m69lB0/cH0RXVbdrwFRRBdnhVVU14Ophj78mB61iDCitrPi+481l1b3JrDsW6PrHgMFtVfFGVdDGNfjub4UHzr+rubpvvGetAU0ellQPvaXMy5r9uRtcpwRK9Xlteab8NUyHV7LIb62JYN/+izLNHvtWU29X9f6kM9PhS3ZX9vhlF6WFmW6PemONetGaq+Po9F01VlU5zK/s6MfAbzNMnxyePiUJVFeW/68jiVzPxQOL8siXb7p+f31RzrNt9mnPvuv0w1Ft296e9rQ9bXSaIgwECbcTTj6BJc9qM5FFXX3tTHS1/ad4sxE5hAOzI8DKM5FWVf3dajqcZLb5Bc8kSgjWmaU3HT9aYqh7Ew7bFuTdF0x7piTBkW0O6svHN9No1ldpfR/sk4Miyk/Tnc10PXD+4ddzW/OJRjyTgyLKAVmig3ZqxubZ2oSvfn9B/2J8ZX5AJtUtc05aksqu50boytf5whBQfaobWlXBrpG/O1ePr46Uu2hZg9ETrQMrlWujia1rj3rBhMO9bWqjiV53OmHXaJwPhiKp4U526oJ3JT35jqwTaA5ns9Sm+RxBSdnxZfy+puNMNYnLrDpTHFTV+eDNpmYXwxFc/sk+svZf/gHl9VDqYYxsvhoTib/qbrT2VbMa82KCCm4/mWm7t6dFmxXRTGOUcRvV6sRFuFzXdTXabH2Jtz1+e+/rOpyBXdXy71dhjL0RSnqYHgSpgmiD6viqa+N+ubeuoOnAmBFh1eF3093BWnsi2Pxqox+glWVH8T9CFt9/hU/+Fe829lc0f31mc3kSu5P31cmO/VbdkeTVG3oznODYx705j2WCCKvk+Kqvo+bhrloTyPXF5zDNHpaTE8nL52DdrgZAiiz7Pi2HTDUPbMF8UDyX3Mqqn/3JvycCLrc9XUhftVSlnVtZU5j39+/KQ4dW1n3+DiXPZl05hme7NJD8cseKbkfzCnLtNVXtoYJp+WvTWAWI6XOiLJrnUJk7UthyQ5tS6YnP+6SrLBq43J26HUOEjCDsVK/jN4lraNzg98uKGA4xYeChjp3Bnb5yrtcIFsjRbREAkMZOp2GMumcSVatodiMOPlzFnkOMDo5b8vdXXnxlzF8VLTX6jFh4ADw5Wq66c+kX1h2ZKKoMC4ZPv6288lK56AgUHI/NXfOpdIJWJowMjDjiG61vafe3Ospw9opglc/HIcZAhiTueuL5uiHjqv7tiZwp/cTOG5N/e2R88nQacEjEv8sThjHCGBoUZTPpi+6M1w7tqh/lo39Viz9SbLAUYXB3M27cG01UNRt3YiZRogTbMNnCNLBIYTVdfaf9jZm3N5lOoPTQBGC9PjBLITIoGhwfnytamrojzbbsSN6U1m+LMY0AxgFBD0ooqbS1tlh/qLV5YEDAbo1xTzldnAWGHtq5TnmjMLkcAwIRi4COIpGhgJuCGDIB3ggG7+2fRDPYy2shSXUW4KchSgn79255CHTeKBTr57zZopfaZnHRKwKP/cq4BDdWtO9HrTYkDARYsX23gRcEjRosHLrVwBgxQtGryaJ4AA9QgqSs+jd0A5RIrCb4qh/mOaSJSlY6wk/mx9I2XxBCuKP1nGHpg+ARctnhZVU9s6XNuZXatXSm9vliOaPZuJ3PTvYhJjRfHnM2Gp05x4jBXFX8yEqUpzygFQlH05o2195lR9nCj6aim5qSZzsiFSFH49w892Ea9sOOUIKkq/mfFrBebEE7Ak//xxMdjxSWVcV5cRj6Gi9JMVD6/LLVYCVbR+artq7dJ5dlLci0sTRJtnc2MCWSRgUf55cV829aGEc0ESRJsXdvbvq53hBiwSsCj/0q3IQOoxVhR/NS0tHrpvWAERcNHidTKm5xxStGjwJlhhYNMfQSXpF9QqnR2bb9WEcQPYYgKeTJXeTr4fuM0kiyMBFy2eLqn0OuicB4UXTZ4V57YpqrKpLo1YbglYlH/ur2tx0gFQlN2Wy7wJsNxOpcUiSxLtXhZ2+df1bbcqw3nRDNHoVXFTDuNPN13/rextTTkBTyVLEu1eB8NWziNEisLzeBh/NiRBsnn5uKj6crgtelPZLyjXuUywovgTO0vf/GSfo12Oqceu5wspwxCNnk4rev192RTjbd+Ndv8K60MSRJtny1Akt2S7yAdAUfb5goYfdo4iWnmjYzsQL/t6YN8MmiDavFyS5xbfuXY9wYrir5DF7UU9AYvy8zj53Hc3dWZBeRGPoKL0G4eHvrApWJJ/9Xjb9zL2ZXXHvwMUXLR4sm2nmD73ZVs2D2NdccWUJ4l2T7c+mZPAvh0sTzR95m+PKU5m7IX8kQTR5vnUUasHWxBg7yHLEc1eFPOY0lVWuxNqGKBawjNF45fFrSnHU3nGqgoBFy1eyfskFvlXuh0Sr14vIxrYgWaIRm/80ZndsHAyIz9Xm6NIVq8f236VfRUhGwouWjwpqr4bhp+qi9u6O63c9uz0WJYjmj2140K3GVpac0qwovizwvR91xe3ZXsQ+hQJVhR/HqwbSHMsFFy0eGE329pm6VCM3Zl/+VKwKP+yqC7D2J3InVWcFUsUbV8tbL9A7MjEtAc2hyxRtH29sKMPM2uZJYl2b4rTpRnrn+a9XXM/jF+LypMkuzePi7L+6dx9M70dYFM79BhfgC0mwJ+IBxf6sxzR7Om04byouqaZZ/aW7e+cXZ4lGj6btvZjr0cKFuWf+/30AzjGZlii4QvbB6hb25beD8Wy7ba37zJXQVkesJuryzRhXaa1ovd9VU05DJk9YW+nB/tzOdA1obM9L0svNqBUWA75bp1F/uLmFyH9hIWa9UZns+Ixg099952eLYilJyQm+mWaBdekO2BgJn9f22CNUcKSzH6eZ8redadT2R4wL5qEWn20E+Sf+vq+HMGHzzB1ptNOmz2ePhG1/HUe3On8IhZq9nkaQOqsAg5q9P/GOjMDnhpMWFG4N+Wd3dChbXnyRNjy36ZRkNIuIMFWytqQocF2qvpAkmArqEYEYFm6uzP92/zRhUDZw2LCwFdzA0qS78rq1iBFsAFFyWkF3DXokqgHxWR/4bZQxMK/gHsoHPpDdgNFrPsB2UHhoJ9z2ydizc/A/gmH/JLfPBGLfoF2T7zrmstJ/cXOsGQzO2WjNyNZgNkwli3U6gdYSfj95XTGXnAPKYku1VX7JcnycEO0H0swUBNNt5PkoEbIww6wqLC20mZ5kuHUvmhrAU0CrdDnH8Mhec2TTwmQhfbR0CTJ6q+mVHaLCQZioun+JHjEAHlHVpwoWB9vzTB+mpYulOXDUFW2qhLLElWWUBkmBMnial4yR9QDrCT8sb43qmFySkAs9MPjDAs3UwyLaRJipavXBAMx0dTiBI8YILVqxYmC3RHrA21AQPJoerAAfKws3N1dzlD2N6QkujxhrBQiNCr+oW4MMOSL4bB81xygMWVKQC2QUg+wqPA/+npEB9okRzb6/r4vv1me7v3PExWWmtYgR1PYYY8phIvy5tT1D+AT8rGY8DJTpzGIOJiRbRM1Jh5eMvitG+ubupr6oZgFwdCY6AqNYWpM/2qaM9qwZ3kaQ/yJZViS2Se3Y0c7TMvRQDvNlC9FAW10rR1NAq00rRxFAW2Q1s2HirJ8eChfFY8D5UGVTyBLVFiqnkSGBtjZPSFAf8NDoqLLLP3VNJOH5IGkae2gqkVxQKN3dq+T0WUq5KiMFNnxCKDFMmTV5SZmKc0UOVINqWfOx+6oy45HwC0UmVjQoPivphwuvbKCRSSdlSIvPgM2sV0wbXZ8jspIlZmVAFr4nRNdjijmDlNF7hIaaDd/dnXZi0g6K0WmlH0CS/lsKtOOuuyEHJWRIjMeAbWohztlTjyGwkSTiwUOyn+ZjzTq8hGzlGaK/AQU1MYMg7pJiEg6K02GPAZqMh0JVWYn4KiMNJnZCKiFPRuszIpP0dhoMrLiYYOuL4/qnAQknZUqNxtDNJmPYEnKMwyV+1L/gaU4xosGfV2ZX80IrpnGcEnefQWwyZEAiwnr5pdIDmaET/EkeNngxm4+R56uD5Vl7VAZTbOHxYSBUfUGxCSxEliRmKhm3p5giCb1cKedliM5iJFmQi7BIwa6iSCCgZhopn4SPGKg2QOS4BEDqKKiHUcL1G4pITmS0dL10z3kDAs10zxskoMaIc9E1fmdO5ZYyxGCQWndx4smgVb45ysliBbTxk9tI5hhYWaahpBgYCaaZoRgYCbaNz/DEs1sfxysAB4UklVWY4IC2SiqcASX5afuPSrug0FpbRFRJNBKU0wxQbZwZwvV73qOhxuim0YJBmqi/C7SLNRM9V2kOKiRqhWjOKgR9AH2saiwuonM8UTDh7ZSVoKUgZioHn6MRwygZ7HgZEEbWQGTXJGS6HV9Usw6RGhJ/B9T/CHVBlSKgtnoN6FmeRpDxUbUHA2z070RJAcz0rwVBAMz0TSHBAMzQd4VD4mJapvBDIs284/kL6HIM8fpy8PBP6mdTcUiU0QEKbfl4RAeyYEcQgrg4R3+gAw8PKC+TStA4hsc0PbHGpC6T0D0g14A5hBQAA//1YIcfIKkby+CNG67SP4tXMV9tKh8a6o7XNlDi8rd6VRPp1On78ESGBUwoYmg33TvrPn5kg/8EButDMxh3YSEGqwETP+dXfhp1OUV0UCvphvMJ9NmA4NSRh4Hc5k3AXzsBqSKxRS1x7tuoOMt8j6WpvJyx5KUTo60w2dHrjYi5ufWaqd9KPDb43Mwl+u+rG3ssS9jR98MRrj4HL2Lpuhins7turzLd2IyTpajd9mTp4UnuvXGNrzTk51mngCjmCJ5HOzB7qNdHG2Hb8zEzuoQERD9X2ysO0x5giKaf8sFo00k/wZEobW4z6bqeqCZ37CI6nX5NRPpPRGdoJCm/Ssmab6LtWzaAD1Oq++yqAfGdP/jUrZjPQLtWIiX1I9m1I0VIgKifzz25liO5nDdl7mrAROPiIT4uI4P+AQiAqC/zPZeLzHSIZOEhTjhXTIfDSjDPeMNi6hOXSi43Dc4oj0FFgFT7LCQqo0gAopaKKY5Qi3KhgVU30PfqxmI6Jmb8tKoijWkaDzgQg4YgIN2/iGhAB6q+YcQD6h/tDeGzN1NSN4nAPre2cz3tdt996ltsG4WS9/t/cn0dt9VyYRrklOwiSDpqNvLaIYvdVsZv/jeTb07oI8iayCpyN1ckFgBNxcczfib+a5qxz08oP57b89zd10+TpWvvaIB5XmMrajyAQNxmLdWTnMtZn5ymBPFVDi+6y7tOJ3v3mEakxW+67HyHbYRV+H6y82NmQoK/+bTVI2nvVROmcOZo3R5+P3e9E0JDOYzRI3fMNanctxVVyOuwnWOQ+O1sJpPg6jyoylRfihALX2qfqBQdpfED2f/R/M8zbHpBiC8xN407Om1IEL/gvT84BPKy+1N257mgxLY66//DqT0vd52YD2M5UnXXtMSijRctfdmGM1BXTd94i6/S+b6JdnwIt/F5PE+mnvDLJJTVo6i8PAj4+yowyl9n/eeNuaHvnv/kg/ev+BL50uo3+GYvM933/tLCSj85xWlPT29kKr31NXwhaTx2VGZ9TV4q3Fao5mm8PpHWdsrK/a0ECEV8PxcftMMrjc4oq3YcxLAAe11pVwxvo44iIs7e/C+HLEseHhEXbNEF+Ihdc2unIiA6Ct35SQUxGO6YwjTnqCApq4B1rS2191YTu3KNOOPzbdFHNRlblS0RgEN8NLtiooIkv5tOfzWKWfJUg7kom4tKBbgNC3ewQsjEUHSb6brxNyU3Sdox0/M0Dr8zh18z7r8Dpx8d5xlsfBT3x17g2wvonmg2zJEf3tf1g22wJ5j7nXUlCjNxpzfd+16XAf18zl6F03OYh7uZs8GaVwsXqeuzcfCwV1cG6nxcAytgzYnGwtzAvfneGBQ9zuyLW/DYqrBDAgqH5B2+GgeQULE/K4OjeprsOB16pqM+BzMxRvdoiYeRe2hyUxEw7y8banqbw3F3e+qyWqOr3J31XdvriP2jzjvyDmhAKYACIcaW+JxUR2BvUspEkeuU9qQmpJa8Jj60oHWtE8+R++iyUvMA93AEYSP1ihre20ha4+TqswSpsZR03vbGFoHfX50fTjdPvuUo3fR52jjadz0PgqH9Ry83dMOuwSsPU6qPCVM0PGhrWCPh7bCVVWpn/GY+nYOE9XfGJiDbpyjGeOsZ6PPjUHmTimWxknzFLSjKIfXzoCELMRJu4U05SAuqk2kEQHRdzGEMWmHRVQ1CxUhHlHXTcTHDMhBORWfchAX3WRwzJAcunvT9/XB6I5nUCzUSftG0DzUTfVmECTUR1OXUw7qoqvTFAt2UtZtmoe66eo4xZKcelMe0FZsw8qqp+7e4LobWlS+tFftr111By9rxAzJYTBlX92iaffRsjJ+8GOAz9MM+HmaAT1PM5jR3egGaToooKlavx5U69eDcv16UK1fD7eXEZsOXJCi4tidlzYBUPXQkvK96xcDZbAgJcVvZT1+6PrPpjwAafXRsnJ/gvd7eGBR14aoRV9hD0zr+sFfansnyU05dcCp6C9JoAlhgLnqFRmmlNUMzb//Yb+5rwIlZJq9sg1tX1ZwpgOSaLMG2MBLNqJoLbRlydAl62Uqy7ZK9TDW1WCPJeXn9zbXDFM0TFZ1lbnlBWB7+GFGDKXB3szteJIbFX4bEg5s8ss9txWQcJgIsPyO6pihSpZR4Bm4WpC8XWbKKiJqiInwIuDg2U1IehttRlkB0X7qzKK1x0OLwn091lXZTCv62izluJKp3Z+geK99uCRtb3o/lWf9G0cTRTt/mV+RJZKnMkObrJSkstlRkAxdsr5yMz+Ay4wEBd+VTfO1rO7y3eREeaWAFp/Kvjwp9B0eFBemMBJxbPJiAUvjqFQeHEtdZfrFn7tvqBnNxozr8WE62Qp7LQRZPgzwwo7IfZOUJltF3WG07FKaaPVzfUBzMkNlSfEspi+Knrq8ijqWYJmkLNwILhifAMh33KJaoNsBC2pX77xok3iLlLIAI4tGS2VDy8JeVEtFDhKWbLRUAvaqId/DJ4jy87Y5RZ8gpogW7y+nszSP68l7cEhavCwt0kbvSbv6hQ8G5sn+AoUBu1rWcCDJGQuLqvoOCQm2wet6yIAN8D6Ebkns6pfvprpMXSa8LsYc0eQDG7PMU/6AhClzKNWTDRmYAf5MPTgmjT9Nxarj1TwIAr+nG1oU/tjl11c8xY+duLZiMXCvbsEiotxyTSgJrNZcLSHqbcP4+9nWdKgeEDTY6rrsjwZ6+0KGbIBdQu0bqK6gvvrVjLfdQdF8BARRvr3p9kxvkDzRzAfjTyRlqYz4GwEyPtDlAFdrkCy0rxcQRPlPZT+Yt/1R0deLKLjFZzNcGuhxRBTEwm45B6UtFJVES92Do9IuzrZi/ETxULNlpktvFzFlQ3epLtqr9+Cw9DLG0zSJOS5q6gY3OxxDImp3ZXXugWusU8OYilp+7I473DwWavSrKYdLv6csIyZuqP2AkkTUzm/kd5hSdNR6fmd3uEZM1NBdh7zDLyTCdvVwt8fMo6FWy6znDruYClu6DUN7HEMmbBhce6/xC4iwHXSbPeGmudL+KrzVfZed6t75qyVczBzV52N5OGBjGZII29k74N9ef1Z03Ciiyu5D/d0ctlhR+6xJEVUy/t00zcM+c48qW063qelmWmMOaOLeJ7RjFlJEC9fUwmMUDw5I2yvalIPshATa4MM5Hy+Lc2dBfVHgHOgEmneFzbUOlQ5ZkJFqAi0gYPJ2Ut+OwmD5hYDLa6pNxIFM8FZiQ0PCn81/ubtu8VEtQYOs8LlG/OiBg2panYAAyQOH4iJ9/FBcBP+ww+KD1uRT+dB0ZT5AVNZpJsp2F80c/oYWhaPYS27TF/jcc1yt6T47yEjfbdb2l11i3o8dJL6AQdllwK6S90igDfoA8HKfDiBhmn8AAQhm2LuyqS5NOc49w7fXn3GLlLvPFJ29ypL32UZd490piHT2JWbqKu9OwsTGjfF+TEQBLXbUJW0V+sFH+CNPbtcD0z8n17VQFeJKUVnoXr+NozLZ/aRIuspa+aQ8kmyjnWPRTa5MaLxT7cEB6WnaZf3+wJWA4KnNXLeGu2KWcVzJels+5CjnCUUdTWi/n027z9Ax1Yby3b2MJ3yD78KEJzl8PCCO79CF9+au4VFUH7+YBNt8aj9qDD61H2FpfAQcMmADfACsO6e+wq/r6s6lyc3CaKxi7g5TZeOTpe+xVjRANHeHqd1puc/SMncYalo9mrvDVNnyZek7rOfA9fuMZ7JoG94OrdhYQBJhO3dx8w67gCjazfGNNI1zRAEtXKErDGYCKI+3nZq4GwtY/QWgeIDZenQe73omJMnGxq3TH7ciWJKRFwVVsT2dYCmM0ONqMUVhoS+7PFm0NcNQHg1s5MFl6bGvK5sepJp5aEl43mGBPgkfDkoHwWaVuy0lCUUS4GPACUdtsj+T+jPAARl+bQkWaBQF0N2XVUZElQztM/VZO4x+JLO7n6z6FDHJA830rSVNFO220MianKUshdGOvGXJou0ctXEJIKLJZIaKWi4hMNWGIVGym9a9cRMfjkij36MVi4iuy9zKFznLRUz11Y5gSUbrsAwtt5CAyivPLlI01EpfbBmmaMgH+/b0oTjfDvV/nsCCxRNQ8iku+RSTXKdolO8DwwaN7RyNpiKlLIXRzuwlVNBy+tCDywQxBbOwW/gUNczC0VpmjzepH4xPwm12PZWYiNnZ2TJ1rnwSbrOztqVUzHJtx3e5kmzQ+KGtVJV8IeDy0xu4L18UGze2D2O3b0wWbedZJ/jL7eNR8R1fU5opGj60FZyTBYuI7shBypKM7HQzmvoVK4omE8uIekLS2yirMC+A2m/z2QrLjaS32ZlLWkCyn3dPGnD/sQ8Hpeuu3XMsmWFLxuGdCYrPJE1E7dQ2Gnl9a0HyULPurM6PT6Jt/Ai548OZC47btb9xgTAsu9hwUq7Yyu20gPqMBUma5FThkVzMoy2SlbT/eXYgSZjXmjyFVczBnLxpWYVXylK5uYlCvV/Awxy9kZXCL2Vp3Gx/TG3mkTAv/+OpcCNoOj/7Gdvh59FEv0t1Z0a5fdlwkuIUWOxD3ZgPc7RwXjiBw/r/bh7ktixGy+riybtZFz1tt5zFd1vnEdUFKypPIV+FmwycrofEVKVixS5amGHMbIavJs9iLHr5ybJAT5woW/SeYXrPUL3nmN5zVO8FpvcC1XuJ6b1E9V5heq9QvdeY3mtU7w2m9wbVkxqHWU9uG2a9r5jeV1nPDnmgL0YAlXTf18O5HKtbXnJBoWpSs7Dg5Hbhfd+dP9Q9c+emE1xgsJ6YxAUop9HFNbwSHsuCktUuJ0npchJV5qh/8vffR0qqU/Q57IMXQCFdOakrTNSDOihov2TBSVVmwck1ZlUUPnerovi9+zfj4lowR1cnxQ0nKjbdV7vEIfdBfKS4+25ZHv/YHevqU+9CQpv+vmbOl0wuHFN0lbd4Og98R6fdqafPQ4Ylui3HM8Xeq49EVfEuPcXQuEAde4IgerggFkK8eafuQ+XN0NRhRMGA5IBOCgOVrrBv19eFDzuEh2sk7QgOb0Nf3nphU/DiQpF2bHkHfTYCuMVZ32JkeeIG5O4oNxczSN6X60KMyp9oHynvjZ3ir8mp9ICypo2xhkguOHBz8OeOOWUyS65AUPO66xq7wR/SXcCStr+EIJdDjNao81P0iTw0M/+b1Pn9Te77IsE2Jy1FmM1lrtbcS1n2kYpdjm7r97VbL+DkKYro0zZupCloLzBxf9wU1Eku4A0nK9oYS3L7suFkxWHsevOlLc/DbSe06BEY2R8I5H5GIWq/lmdZ7NfyjGgBpTijVJsvZckVim4WlMvQR4qq0/WzX8xoD5wJnagQKyvLd7XOsvAlrV/AEdsXeMS27RoTFFccuukLGfCHWEzZ/zxAc1tZGrhJyBbk9eUsfcpjtGLvk7Se7Ot7eNnB9s3lN3vDyVuMyhF5AReYrDf18BHFFQhqSlNrKwzdVuVGf/LHNsWjDnNgK1MOUsNJMWAXu7aqMtkIsAfQcQixuLKdbAHfGJKDOgHvjYdEtrXBNSjAirukkBmMa2zuYoZJk5YzTJ6znIHvxi4fjdZXtEBQE5mduNbchXe9e5aRYypdXVzVHaY+UfYU72SbLdDr2K7djgPgOW9AUdO/UQpQjuGivnhnlNNFr4u6Bq9ZClXBuhnfloRVkQxLdOOvWnLa0C1L18hNRZ4eWBq75tFzLIWb4u2kSbJXdwSq+owS1ZaJNXbvvpP0oSpdILkxXNbHbkuY1VU3JERwJPUJQfRI7tgBbEiO6CRdO+O0wRtnrpGLU2ZF/M4UHwuUQ4SG1eNbVRRWFBX1De9WwU1THuoYX66Ce1JM1NW7ZAU3jEioV3THCu5HEHFPZbOQ5aGO1CUruG+OjbpHl63gxgQR9QwvXMEtUx7s6N26ovCLWKhbfOkK7kgxYdcwkLTCNCXCnsHlKwrLhAc7+jFCFYYxDfcLbmDROCZE0dO77wIwitCAul3+AD7qG1ChCSXYB8va3G0YsyJwEcYEEmcyLAiYxwAuQdj0wFHM/P69PZTnkbmtx+mGYFRbUX33tAZC+PVZGIq8PsPE5+VgwBPD97Bca/awXE8tCvjMPCimq3le6pbNDzgLGYRwQF+IUbvoYuFpV6BcJ2YgUiuweK6hLlgzdu7WyfNUjoq5iRwN9IPKThPK0WHdzgRe1kdiqvIs/oajFf8ZHM4038uTWwqkzmc+flIc3fJwMYxlP9KRV2eNIkVLeXr8tLiZ9pd/nSd/WfkYLKo/Ky7twfS2TTlMqZq6a+Sq+GqS4Yhez4umvjfF2JeHzDdktQihovKLorcf9VPZlkdzyhzwX8UTtKj/sijrojuP9an+I3tke9VP0KL+q6JpTlDBBMhc7d2Uz2V1Vx7NkKm8N33Xjn/uTXmgX5mFXkzAwgGl3Bz78nyLiE5AUPTUtccOEZ2AoGjXNOWpRFQdEpQ9160ZB0TWIUHZoT6Yu7q6Q4QXLCw9vcGY8gRlhYMa6L5vmQpYNeUwGLK5mYnFDJGycDPvM2e1VpCkth7nZ+U2lFwO9sPjiZ06O/gf/jz9d8h+ygUCCMd0c9nMKhsiFHzy1M/aFDDe9jiW4EBxOI8tV54uwYhS/eKlbEJHvUAN81EvCPNMMDvaiwlhF0qXhwO9Fr3WrFk2AoaaL5+HkrllREKUW0SMZcmVOEIzuw4XC1JDYkIvNyCO5ejxGiGYH60lkpnOPiXKdPVjWboXTIjm+8ChZFMf2+su3TGXSIZARnILfiG/zxGUfZciLPoGMzTO7uekk3tf9rUNIrwo/0z2bJ89JUSyUWKS5GYYbErTDRVJUum9FGFaF4wQcjlNMkuEUi5WlAipENVmQllLNprYvidYSDjcnjgpxXrpxsSnj9+8evKCfLpR1LF8KomQY5kkKmp3hsLb2E07XN22v7MVW4jjExYqEL+HKt4pFg/TJdoQXJdIigOUJpWP/5NLKRf/J/WQ4v4ILpm4P1kfJt5PzomL95P6SHF+eBcyzk/OJBvfJ+fBxvdJXcS4PpIPGdcn75ON55P6TPFu8u/t9DPz2lb29/kGk3y3xEcxfRK3VxkfaJB4rpUiCeC3R+QKxkmUIP/x5aIDUc+Ljg6UqtGdwFSxsteVy4/QQ3GPcHpdzTTRJz+/BMyWYYJGnxxLZC3JgElBUWcDJRGPbsJKX18PxSWtmjKSjHyZB0gTmGc5M9avrKi9IkVRojdMa2b6xIRk9H5KwhFclvcqkajtYUVh77Mt6XpQjey7zh8gidIWjsq7TgAo7sA6aUXaNwLXPtEBj8JXOhvoiGg8J7B3fkx8S3ysWBZ+x0ES9rEqYaSMYzxsYLsiqLjFqoQ1KV/wbOWYFsuZ2YQFwfWIemPb1+2oH5PAGMqlra/HuiobJhpw+inJcbgPy/uuJaL+Jto+jJW7nM758rS/MmV5uJzOb4+mHd+2wzd/eBmXZARkytEip/LgxSaIIPO34HwcpfK35EDcy+d/ckNOq2HOvalKuwQcKX82Vdczn7ANIyTx2hY2rzNBJBn7V17FfOfeLHOqx9H02QWN5fdQ4jm9slGuU/BfLl/t0fB8/Vp1Ew5T65bF8KVzYEeHuBPD5jzXORfcKKJw71HXmnXOEjYgWILHdM+kSt9jCNrzVLlKPeAw+sa+7b84JiDtwznV7/WoEN3QjOZtfbw1w+j6OnhhUDTGpT40yvcrYjDaJ+8+TVg+JTEO560vizukJNlB+xQoGueyxWTBq1FK4hyiy+UUNjQT8HLvpN4p4DE+dq8O/kg8NKM5eDeX4doEi/O4vYzTjbZwyUQMTnvqYuqfMskTfbT6qK79Vmi1PY6o78ZkiuebsjiPINSAwoXicT72nhtcfUMzmvfrdSK4csJh9L8FV4fgHiRP9MHr0Dewzfm23uGhTbvHSfT97UBpMGB/yoIOApzOVqTn2ePk0UfZn4UiwkHzVBM4Yx5YTF+w8VMfyMbDDg/EjDwc6j8u5VREktqCYwQzwYr9x8EEKU6fydEwQ6uj4UZVRzNiu4sioCB5PPbmaIel13154NYECLAg7WaIhQcbAXnJ5eN0XZ/MTRiUgNBN0IK4PE3to3gxcYllwwhC0/SyWIYbTJCL72+gtKjrG1KhcJ2E1EkXSgiZkZ1v2DC80Ht28m0GCBLmprw0UBGFUFBWLLAAyYv+cnNj3CyHfeZ22oFVTuGCPLjpMIHystCmwxDHC34sp/mK6BpfQtEH8pK/bqPP97U7TjXFtOQmn1naHrtPpreHOssjX6clsmBdt5fRDF/qtjJ++bybZqqZGUmZKxh3ByFf3UFI+2/mO9TGejhe8Pf+YPqfu+6OlVtRvNi8HAjUywApiHZDbdluU/L8AHhxioGZvOsu7TTe1PjEJMxqqcEap4iDGYWNIOQTUkCbduxrMB8zFhd++P3e9E3JrA9mCKDFMNanclTVroiDGf3VzVF6DRjSyIrsHzAHm1xQQ5WQHVnfk9/dmfyBnE2zn1jPmqfusNV8vhGBH0vCzqLPy+xIjua1pog7LPG2NqXtsLNjvWEsT1gDSVMx26v23gyj3RsIVi2foLW4tFqPS7xvIWcyBZnHqoSDYrJew6ipdSlNbad53fd+QX7o0/Fj3wyfDb9bMUltpXuvKCJmOW/v0vRyQorKBquTCxiUVlQ/VZ3b6gqqPcMx+X+UtQ09oHlZQwpv87n8hozXNpggB5w2DGC83Lo1FBiyRVhBmIr6T4nmgv4ngshesxCn3ZQ0sZHTlxFQSDh4+jKBCrIPp6+d8MAmCC+DtW9gY3bdjfNZFn4SxcMhgt0wwqIrFhCemwlUO4Dz8tjR2AjISNL3CfqrMfl7BNPFmNty+K0Dp2pSLJPMCQw3KRSaF59WX8SZ8wjISP7VlMwipv2VWb6zP5/KM37ikCZw20qDbjqTUB/GpdjHAbtfSTycXul0ZwqGpRVlztA4uyt6yTHRv8qvOBKCRPiG4PY/Wp5m8WbhgmX4FSZcUjgr/3N9kCRnCC8THnQWiiJFC+LhWV1KMD2tG4lQJ9pSoey5tkgszaXfgufuT03b76t5GyLwCsdQNoF2n3rSuqaSHkyUS2OX03p02PJIMLc4l0pya3ORKLk0lypmV+YiubmRF+ryhmLFPnZHTuVjF3/qE/o0Ey5oTBhJ6Mi/Sw7BiizR7+3j/v08hlGJUkUCzstnYuUTykyg/Ei0vek0R1FIPGuQRLvn1BMwn/Z4807cbaD37gQ9Bvru5KDVyt6ZnLZb9Yz9Mprzr8xwOMQx/bfam1m87sRJAhLOyF+tq57SFyAAsk8lOIIIfPUoPGKwdNpwi4jBm1AXJBDKudsRMnLxBQSIdsxBjMJLBwCXkIBYxHcMACYxBbHxbhYAHDw0Ih5dIwAYRAzMBG23SQJiQd0RABhRNMQuuhkAcIoYiEl4FwDgERIgCy/8P2LgwRH5ONY/YBFTIJswnjfiEjIgkyCeP+IRECALP8414uDjMYMgYD9kETB4k3nq/Ev9h3l7/flT2ZcntrNDEmCLD/V3c9hWmHR2JBm2/nfTNA86Q4/C20xRquN7DoPumA8Rx5EOjA1yYyyQUFfJpd5HCGVlvRsfOEkPJsjZ+xjA8UgC5qXr4W4Oojk/Z1Y7QYvi72ykmrf9kU+zDxQl5UFwblWJEkOefQAUJf++nrWRNDekQvSDQja+T5oVTuJwSOp0VI7QIpo3ny/A5Ys7x9EY6SxEcfzjrPkqz5d0jx0ruIAAqXWUi0h6YEBaKlCsHKfVyHdlU12ackw+d8EXgsSKnwqS9fb6M592mqPPSvRFVptGfH0Cpi+02nZiAWbA81I9JsXT0TyUnc9i7yNQlbyuwONPHVHg5HcuV+AODBX4CoWTqS5wkgbbgQXugXlpdNyCD1jmcQfRfobPMYLJz9K76YdP6YYTEur2c3xqP/J6KwyS+2yGS8Mu0YRISFTu/XG7UzKi13V1F6c2ekYxEHhKMcV1nZGkxxxlJlyPKYi7h3itNK1dtDEF8iJ2p4hGdpVQZ2MZShN7+E6bG8dRGhHRERGvTJRE0W7eDKgzm0msVRiNDpjIJwmQhQsbp7AICKyF2+Hkcs22qgEQkJQbrPzmKloQbl4pPGfQ1F/zy3BN/ZVZgWvqYTTtdh9HfnUrRjILWzH095bbTk2hRfHlDPqnObCNJB/jZYMk1L9okTB2mCBFRbNEs/deJDLJwseqhJH0x3jI4GPwCc4Lf0w+u4wgmtoFCwm7txeRdUiFKJreDS2KC2EcPZAs9Z2LYrthRKHMvkRakdmdKEkjxZkQRItlT5SkvOBgQSS5PlYU9o6TSLoeVCOLJDmCi/LelgW4baY4u4yQDOV4qKGra9q8RaydZor8EUzZdAusJ7psUFE2vMqa1kvvss4IIUWw4ETBL174OknUx6qEkRTHeNlA2F7vo0AxtPcRopXiUGEkDNAE6YVsSIUonmq4L4LFU0+xKmE83RseNMClMdEgBKAoHKCV4lDKE4Zs8tBWouxDW0FCUBpnnChILZ3SkrmlU0IU60eDfeh/BEEOMdEFDYojJaromDsoOr4N0YI4GoUqxQrCUByqCChIuu14vJrDCELIydYQJwhiZzljpCQKnuZMsYIwdmQwRjKi4acwnnVKP3/BtNMUsRw+ZUWguemw4FhDkrD4UEOYru6Y34s+/yitIHzsursLc12D+51JxHI0IS+xIACRD3VjuMv6YlwoGV7Zt2K75sBfAZgiEd3fgsiTftH7CKn8F+w/+poNUBvi2KIkhsmpWmaAnJMCTlcRaK7ee3DpcGQMBWXxVzZPYq3c/u78K+gBxGoQfTiSB0Z8NJ6lAvLluCEOFnx7KM9B/YzeIArMvkQTgSu65Xes5Pj2fcOIGbYgKLMekM/oMJRHI9ZAD8bXuQn3uWtybc8GkEtugl53XfOubBpWbwHJmuNtd0DDRFNo9gmNfV3ZN5RbO/NQXEnSp9jiFObPrgUp82HyO0ihQfH8GxOjpCfl4/m3J0aCSY2qfC6tVJVPEtvdm76vDwaLfU2hmb7hAkcHGjQeMIAGHAQYkEbGCykWEMbGDRQaEQfHDzQeMMDGERSaET+X/WDC3eax4gphZOaJ6fx7NwOY121G5BsFDyC9YjNU6ov5MK55pZYVwIPDEhW0Fe+iTbAqYX1mdBfRBkSx802gAfFoUUSXJYYMW6PPyEcrxfdkateTgiPJkHjAAB/P0ATO4uy2xr6vb26YVm0Dcc2jQ1130+47PgpeipWF/142F2bq0kdxrS+1thf287NremEP34MhDz9Fs49+g7t+7fXDOdPzJ6Fiq7+RFNUrSxKykh6TT0qcPiKflHhw2j0ZryVfUprAfVnFQ/h0yvkD+GQ23ClCNA8BWs5A7nA/mXruYD+Z9OVwD5r4CC8nPx84gMwAHzSAzMLH7oimfoPKCSdDEZBpzoYhIJM7TymhSQ7hcrKzQQ7IpLMBDjLJt1MneOo9NJJ4OnhCJu35wAlk0v3eAJoBgiNngw/QQGZGDs5AZmnuJqC5CeFyRrKhH8g8sGEfyOS7k81o6gO0nPhcSAky7Vw4CTrp9owzmvANCySbDFNBJzobooJM8rIlB012hJeTng+BQSafD39BZ8GdmoVzEMCBDOTO79Lp547w0smfto/AqffRQOIzQTvotDMBO+ik2+NscMo9MJBw+kgdne78qbpMsqezbXjCfTiS9EyQkUzimQAjUfKTMAuRIhlYgdawITmYnHsoLsPR3cHIQClDYYcYwcXBCpOQwFn0pjxIuzw2DDMAdd+MfMm635kydQB5tSHEiYL5ycTtd2lU6ZD8qsKGYZN007B3q84ARqI3p+7eyI9sQ7EPzcY94ZJjf2czZAHcGHhDcG+nQ+W3IGy/y8/KIqXtBz6Ky16wtTkRSTY1J2TgnfVh3JtqcUxlnn8Vi6ce7qQ58RUjJeezsbf+1l0LTkpmOZIRPpdDoNnmr7u0B3tyk1n82DDMm9Rf2qv21666EyOYx0hGdOkT5qvggmCq4QLJ1x0fIdWf9SCtVIlCIPcM/M3xwPtCwRF5vA5lGJzJYMq+upVaZR/FPXbXlWaeugNwD90h5K9pBJQlmWqUu+2DqEUOyn9RPRCTrIG7fHpgL58egJuDB+Tm4EG+OXgAbg4ezBgHYyZkqGjMsQx0QcuAXtAygBe0DD90Qctwexn5w3ALgnt1vOBXjTmA3yWGxbYsjuaWeuR2K0WD4spsJBTZhnmp19/Fd3oeRN90cGH4YDmRFq0qiZiAWMRxtdOyoCNr58rDBrmAy8MHy4l18TNUJZJSZJv1Q65yIlmA2UNbTRVYZ0axQLPk2aRP3MdhT306u3M2aL84T2L7HMulRV9u6xsb85y/OI+Ec61+MyHWWOoTjZVP4VxLHX5Lko9/+gkJeyP2d6B748NQOWG/LIXlxrYTnmlhl5/FqmWBQpdpgUhZBbYFxzgui8PYnZfNbEwV8VBszZgmBrlcTgA2jxMCqR8BUJbknuMKkJ/kBJWe5QpikxWXeqpDlTgp4jaY5rdkpDg5p/NBSxeO1JRDLrgxhYTVbdsPiW9AWHvaOyV8Jkgs6iCOpH0c+1VbtpPiI12awZoE52CTypacgA0r2kNbidldMFIqFNlM0bz4MJoTl0n7O5PNa3f71LvRD+7iVxgPINWSa/8GJUYxhom6dSVOBK4YrrSuP3ZHJl3zr2JylgNh4VxyIOVDZL1gQwSTwBQoaid39TDyJFZyGDu3m9Lufw3CEsef1AjIfFWvyf1qQVLzN7qkReBhmcxHKFg13nYGWFAU1C/cKCabpXjUKd7RJXtRDNTN24slG0Vg1CPaNCX7EATcC3yns3jUidqBJPvlWKhrtGdINiQIqFe4x0e2SvGwk7cxB/CJ0KhLvH9GdqIYsFu42wUwSwmwV7A7BbBK8LCTv58EMIrhuE+w9QNxSgjiJ/Ssmh0h4czndDyrZkdIOPe1TqK9ct20BMz21xI0OEvFExHLLbAsYLOBddLK3NBE1tK7goapuhFKfDeorRSRIL2TgtDCm6c97RLaTOjbBz/4OiscwiTdexf3iHn9FwTzSi4QW1k6MUAbhdauiC0a4G3uJHyvJ3zRe4aw2xe1k0LfbbGuNJe8MiyuSfhW1uOHrnfjgnziAxiT9hn32ZQHZjrVRzFicSSveDaDiuEVzGaE8biAxSyawJUfvMER39jokO7kGN2M+AipBZmPUhOLpZkkZtdNiUTiE1kknq+Y/clVN2aPgwfiKqXdLCftcPFAidQ///ef/x8AK3Qs"
|
|
|
|
| 1 |
+
window.navigationData = "eJytfVmT3DiS5n+R7WPXtm6p+k2lYyq7VVUaKXf6YayNRjGQkZxkkLEkI6WstfnvayB44HC4f07Nk474DgAEQZyO//x/j0bzfXz0t0dlP9ZVYx795VF1WzeH3rSP/vaf66+PnxRN190V5a0pD8XXuhwe/eXRuRxvH/3t0aGrLifTjsNfZ40iRf/v2/HUPPrLo7u6PTz62+tnr1+/fPz6v/+y6T8tBlN17aHo+oPpi+q27HgLiiC6PCuqprwcTDH25cH0rEGEFbWfF915rLu2uDWHY90eWfEYLKq/KMq6GMa+HM3xofjW9Xc3TfeN9aApotPLgPa1uZhzX7cja5XhiF6vLK8134apkOv2WAz1sS0b/tFnWaLfa8ts6v97qQ/1+FDclv29GUbpYWVZot/PxbluzVD19Xksmq4qm+JU9ndm5DOYp0mOTx4Xh6osynvTl8epZOaHwvllSbTbvzy/r+ZYt/k249x3/2WqsejuTX9fG7K+ThIFAQbajKMZR5fgsh/Noai69qY+XvrSvluMmcAE2pHhYRjNqSj76rYeTTVeeoPkkicCbUzTnIqbrjdVOYyFaY91a4qmO9YVY8qwgHZn5Z3rs2kss7uM9k/GkWEh7c/hvh66fnDvuKv5xaEcS8aRYQGt0ES5MWN1a+tEVbo/p/+wPzG+Ihdok7qmKU9lUXWnc2Ns/eMMKTjQDq0t5dJI35ivxdPHT1+yLcTsidCBlsm10sXRtMa9Z8Vg2rG2VsWpPJ8z7bBLBMYXU/GkOHdDPZGb+sZUD7YBNN/rUXqLJKbo/LT4WlZ3oxnG4tQdLo0pbvryZNA2C+OLqXhmn1x/KfsH9/iqcjDFMF4OD8XZ9Dddfyrbinm1QQExHc+33NzVo8uK7aIwzjmK6PViJdoqbL6b6jI9xt6cuz739Z9NRa7o/nKpt8NYjqY4TQ0EV8I0QfR5VTT1vVnf1FN34EwItOjwuujr4a44lW15NFaN0U+wovrPQR/Sdo9P9Z/uNf9WNnd0b312E7mS+9PHhfle3Zbt0RR1O5rj3MC4N41pjwWi6PukqKrv46ZRHsrzyOU1xxCdnhbDw+lr16ANToYg+jwrjk03DGXPfFE8kNzHrJr6r70pDyeyPldNXbhfpZRVXVuZ85jvrZ66trPvdXEu+7JpTLO976Sz0yt4JtCL/dP0XWG+n001uspjhqo807ldPLMsuTxtn+ivtkX76XipD1PnjKzgFldEOCk3B3PqMgW8tKPMs7TsrZHHnuryHkiy6/uCydrWUZKcWlBMzm+SJNmg+cLk7XBxHCRhh2Ilg3pi7Hco/7pwwx3HLTwU8B7cGduvLO2QiK6Qs2iIBAZrdTuMZdO4Ei3bQzGY8XLmLHIcYIT2fy91defGlcX04nA+BBwYklVdP/X7bFPAllQEBcZeWw/HdglY8QQMDLTmns3WgUYqEUMDRld2nNS1dozQm2M9dRIyDfril+MgwyxzOnd92RT10Hl1x86G/uRmQ8+9ubejFj4JOiVg7OXPNzDGERIYTjXlg+mL3gznrh3qr3VTjzVbb7IcYAR1MGfTHkxbPRR1ayeLpkHgNKPCObJEYMhUda39h52hOpdHqf7QBGBEND1OIDshEhj+nC9fm7oqyrPtKt2Y3mSGeIsBzQBGOkFPsbi5tFV2OmPxypKAAQ/9mmK+MhsYD619lfJcc2YhEhgKBYMzQTxFA6MdNywSpAMcMJQ5m36oh9FWluIyyk1BjgKMZdbuHPKwSTwwkHGvWTOlz/SsQwIW5Z97FXCobs2JXlNbDAi4aPFiGxMDDilaNHi5lStgkKJFg1fzJBegHkFF6XmGAlAOkaLwz8VQ/zlNlsrSMVYSf7a+kbJ4ghXFnyxjD0yfgIsWT4uqqW0dru3stdUrpbc3yxHNns1Ebop7MYmxovjzmbDUaU48xoriL2bCVKU55QAoyr6c0bY+c6o+ThR9tZTcVJM52RApCr+e4We7UFk2nHIEFaV/nvFrBebEE7Ak//xxMdjxSWVcV5cRj6Gi9JMVD689LlYCVbR+artq7dJ5dlLci0sTRJtnc2MCWSRgUf55cV829aGEc0ESRJsXdobzq53FBywSsCj/0q06QeoxVhR/NS2fHrpvWAERcNHidTKm5xxStGjwc7CKwqY/gkrSL6iVSDs236oJ4wawxQQ8mSq9XWA4cBtmFkcCLlo8XVLpddA5Dwovmjwrzm1TVGVTXRqx3BKwKP/cX7vjpAOgKLstCXoTYLndWItFliTavSzsErfr225VhvOiGaLRq+KmHMafbrr+W9nbmnICnkqWJNq9DoatnEeIFIXn8TD+bEiCZPPycVH15XBb9KayX1Cuc5lgRfEndpa++ck+R7u4VI9dzxdShiEaPZ1WLfv7sinG274b7R4d1ockiDbPlqFIbll6kQ+AouzzBQ0/7BxFtPJGx3YgXvb1wL4ZNEG0ebkkz20w4Nr1BCuKv0IW8Bf1BCzKz+Pkc9/d1JlF80U8gorSPzs89IVNwZL8q8fb3p6xL6s7/h2g4KLFk23LyPS5L9uyeRjriiumPEm0e7r1yZwE9u1geaLpM38LUHEyYy/kjySINs+njlo92IIAew9Zjmj2opjHlK6y2t1ewwDVEp4pGr8sbk05nsozVlUIuGjxSt4Lssi/0u0CefV6GdHADjRDNPrZH53Z7RcnM/JztTmKZPX6se1X2VcRsqHgosWTouq7YfipurjtydPKbc9Oj2U5otlTOy50G76lNacEK4o/K0zfd31xW7YHoU+RYEXx58G6gTTHQsFFixd2Q7Ftlg7F2J35ly8Fi/Ivi+oyjN2J3D3GWbFE0fbVwvYLxI5MTHtgc8gSRdvXCzv6MLOWWZJo93NxujRj/dO8f23uh/FrUXmSZPfz46Ksfzp330xvB9jULkTGF2CLCfAn4sGF/ixHNHs6baovqq5p5pm9ZYs/Z5dniYbPpuML2OuRgkX5534//QCOsRmWaPjC9gHq1ral90OxbC3u7bvMVVCWB+zm6jJNWJdpreh9X1VTDkNmT9ib6cH+Ug50Tehsz8vSiw0oFZZDvl1nkb+4+UVIP2GhZr3R2ax4zOBT332nZwti6QmJiX6ZZsE16Q4YmMl/rG2wxihhSWa/zDNlb7vTqWwPmBdNQq0+2gnyT319X47gw2eYOtNpp80eT5+IWv42D+50fhELNfs8DSB1VgEHNfo/Y52ZAU8NJqwo3Jvyzm7o0LY8eSJs+W/TKEhpF5BgK2VtyNBgO1V9IEmwFVQjArAs3d2Z/k3+eEag7GExYeCruQElybdldWuQItiAouS0Au4adEnUg2Ky77ktFLHwe3APhUN/yG6giHU/IDsoHPRzbvtErPkZ2D/hkF/ymydi0S/Q7om3XXM5qb/YGZZsZqds9GYkCzAbxrKFWv0AKwr3HdRwrDhJ8N3ldMZaDA8piS71X/tpyvJwQ7RjTDBQE00/luSgRsiDDrCosPYtyPIkw6nB0tYCmgRaoc8/hkPymiefEiAL7aOhSZLVr6ZU9rMJBmKi6U8leMQAeUdWnChYH2/NMH6a1kKU5cNQVbaqEssSVZZQGSYEyeJqXoNH1AOsJPyxvjeqcXdKQCz04+0MCzdTjLNpEmKlq9cEAzHR1OIEjxggtWrFiYLdEesDbUBA8mh6sAB8rCzc3V3OUPY3pCS6PGGsFCI0Kv6hbgwwhozhsHzXHKBBakpALZBSD7Co8D/7ekRH7iRHNvr+ri+/WZ7u/c8TFZaa1iBHU9hhjymEi/Lm1PUP4BPysZjwMvWnMYg4mJFtEzUmHl4y+L0b65u6mvqhmAXB0JjoCo1hakx/Nc0ZbdizPI0h/sQyLMnsk9sCpB2m5WignWYOmaKANrrWjiaBVppWjqKANkjr5kNFWT6mlq+KB8/yoMonkCUqLFVPIkMD7OwmE6C/4SFR0WXa/2qaGkTyQNK0dlDVojig0Vu7ecroMhVyVEaK7HgE0GIZsupyE7OUZoocqYbUM+djd9RlxyPgFopMLGhQ/DdTDpdeWcEiks5KkRefAZvYLpg2Oz5HZaTKzEoALfzOiS5HFHOHqSJ3CQ20mz+7uuxFJJ2VIlPKPoGlfDaVaUdddkKOykiRGY+AWtTDnTInHkNhosnFAgflv8xnJHX5iFlKM0V+AgpqY4ZB3SREJJ2VJkMeAzWZzpgqsxNwVEaazGwE1MIeNlZmxadobDQZWfGwQdeXR3VOApLOSpWbjSGazGe6JOUZhsp9qf/EUhzjRYO+rsxvZgTXTGO4JO++AtjkSIDFhHXzSyQHM8KneBK8bHBjd7MjT9eHyrJ2qIym2cNiwsCoegNiklgJrEhMVDNvTzBEk3q4007LkRzESDMhl+ARA91EEMFATDRTPwkeMdDsAUnwiAFUUdGOowVqt5SQHMlo6frpHnKGhZppHjbJQY2QZ6Lq/M4dS6zlCMGgtO7jRZNAK/zzlRJEi2knqbYRzLAwM01DSDAwE00zQjAwE+2bn2GJZrY/DlYADwrJKqsxQYFsFFU4gsvyU/ceFffBoLS2iCgSaKUpppggW7jDiup3PcfDDdFNowQDNVF+F2kWaqb6LlIc1EjVilEc1Aj6APtYVFjdROZ4ouFDWykrQcpATFQPP8YjBtCzWHCyoA3VgEmuSEn0uj4pZh0itCT+zymgkWoDKkXBbPSbULM8jaFiI2qOhtnp3giSgxlp3gqCgZlomkOCgZkg74qHxES1zWCGRZv5Z/yX2OaZ8/nl4eAf/c6mYpEpIoKU2/JwCI/kQA4hBfDwDn9ABh4eUN+mFSDxDQ5o+2MNSN0nIPpBLwBzCCiAh/9qQQ4+QdK3t2cat10k/xau4j5aVL411R2u7KFF5e50qqfjrtP3YIm0CpjQRNBvuqzX/HLJR5KIjVYG5rBuQkINVgKm/9Yu/DTq8opooFfTDeaTabORRikjj4O5zJsAPnYDUsViitrjbTfQARx5H0tTebljSUonR9rhsyNXGxHzc2u10z4U+O3xOZjLdV/WNpjZl7GjrxojXHyO3kVTdDFP53Zd3uU7MRkny9G77MnTwhPdemMb3unJTjNPgFFMkTwO9mD30S6OtsM3ZmJndYgIiP57GzwPU56giObfc9FtE8m/A2FtLe6zqboeaOY3LKJ6XX7NhI5PRCcopGn/ikma72ItmzZAj9PquyzqgTHdf7+U7ViPQDsW4iX1oxl1Y4WIgOgfj705lqM5XPdl7q7BxCMiIT6u4wM+gYgA6C+zvddL0HXIJGEhTniXzEcDynDPeMMiqlMXCi73DY5oT5FKwBQ7LKRqQ5KAohaKaY5Qi7JhAdV30PdqBiJ65qa8NKpiDSkaD7iQAwbgoJ1/SCiAh2r+IcQD6h/tFSRzdxOS9wmAvnc2813tdt99ahusm8XSd3t/Mr3dd1Uy8Z/kFGwiSDrq9jKa4UvdVsYvvrdT7w7oo8gaSCpyVyEkVsBVCEcz/m6+q9pxDw+o/9Hb89xdlw985WuvaEB5HmMrqnzAQBzmrZXTXIuZnxzmRDEVjm+7SztO57t3mMZkhe96rHyHbcRVuL6/uTFTQeHffJqq8bS31ClzOHOULg9/3Ju+KYHBfIao8RvG+lSOu+pqxFW4znFovBZW82kQVX40JcoPBailT9UPFMrukvjh7P9onqc5Nt0AhJfYm4Y9vRZE6H8gPT/4hPJye9O2p/mgBPb6678DKX2vtx1YD2N50rXXtIQiDVftvRlGc1DXTZ+4y++Suc9JNrzIlzt5vI/m3jCL5JSVoyg8/Mg4O+pwSt/nvaeN+aHv3v/IB+9/4EvnS6jf4Zi8z3ff+0sJKPznFaU9Pb2QqvfU1fCFpPHZUZn1NXircVqjmabw+mdZ2zsw9rQQIRXw/Fx+0wyuNziirdhzEsAB7XWlXDG+jjiIizt78K4csSx4eERds0QX4iF1za6ciIDoK3flJBTEY7q0CNOeoICmrgHWtLbX3VhO7co044/Nt0Uc1GVuVLRGAQ3w0u2KigiS/m05/N4pZ8lSDuSibi0oFuA0Ld7BCyMRQdJvpvvJ3JTdJ2jHT8zQOvzBHXzPuvwBnHyfOTej6d+3QAUO8Tp1VS48DuayLHh+6rtjb5AtUjQPdDM39hzJWPZA/Uooag9N0UU00GuZNnlzX9YNtukhx9zrqMokycac33XteoQK9fM5ehdNzmIe7mbPa2lcLF6nrs3HwsFd3HdL4+EYWgdtTjYW5gTumfLAoO53ZKvkhsVUg1kpVD4g7fDRPIKEiPldHRrVF3rB69Q1GfE5mIs344CaeBS1hyYzEQ3z8rYKq781FHe/qyarOb7K3VXfvbmO2D/ivCPnhAKYAiBEbWyJx6p1BPbCrEgcuTNrQ2pKasFj6sugRtM++Ry9iyYvMQ90A0d1PlqjrO21haw9TqoyS5gaR03vbWNoHfT50fXhdGcfUo7eRZ+jjadx0/soHNbYBPacAewSsPY4qfKUMEHHh7aCPR7aCldVpX7GY+rb2VhUf2NgDrpxjmaMs55XPzcGmc+mWBonzVPQjqIcXjujE7IQJ+223pSDuKg29kYERN/FdcakHRZR1SwehXhEXbc4EjMgB+XySMpBXHQT9DFDcujuTd/XB6M7MkOxUCftG0HzUDfVm0GQUB9NXU45qIuuTlMs2ElZt2ke6qar4xRLcupNeUBbsQ0rq566e4PrbmhR+dJetb911R281BQzJIfBlH11i6bdR8vK+GGcAT7jNOBnnAb0jNNgRnfLHqTpoICmak/BoNpTMCj3FAyqPQXD7WXEpgMXpKg4duelTQBUPbSkfO/6xUAZLEhJ8VtZjx+6/rMpD0BafbSs3J/gPTgeWNS1YYPRV9gD07p+QJ7a3hNzU04dcCoiTxL8QxhgrnpFhillNUPz7+TYb+6rQAmZZq9sQ9uXFZzpgCTazMvUGpOIIlqscVXwhxdRtBbax8XQJetltsw2fPUw1tVgT6PlpxA31wxTNNxWxxUPjWCJRskKtbJYeQHYHq41EUNpsDdzO6rMRsWfX8yBTd7fc1tNCYeJAMvvqPcZqmQZBTaCqwXJ22WmrCKihpgIL8ISnt2EpLfRZpQVEO2njjlaezy0KNzXY12VzbQ7QZulHFc2nc80QiYzFhH9deqrgaoOLMnafSGKNsiHS9K/mnI8lWd960ATRTt/e4UiSyRPZYY2rylJZbOjIBm6ZH3lZtwAlxkJCr4tm+ZrWd3lhyeJ8koBLT6VfXlS6Ds8KC5MHSXi2KTRApbGr6k8OIa9yoxHPnffUDOajRnX4wPaIoYEWT4MdsTOhPgmKU22isYIaNmlNNHql/qA5mSGypLiuWRfFD2BfBV1gsEySVm4EVwwPgGQ77jFzEC3AxYyr956kVfxFillAUYWjZbKhpaFvQivihwkLNloqQTstVu+h08Q5eftioo+QUwRLd5dTmdp/tyT9+CQtHhxYKSN3hl49Z4PjOfJvodC4l0ta2eQ5IyFRVV9h4QE2+B1PWTABngfQrcUefX+u6kuU5cJr4sxRzT5wMbv85Q/ICH7HEr1ZEMGZoA/Uw+OSeNPU7HaezUPgsDv6YYWhT92+XUtT/FjJ65pWQzcq1uwiCi3TBZKAqtkV8t1DbZh/ONsazpUDwgabHVd9kcDvX0hQzbALmT3DVTXsV/9Zsbb7qBoPgKCKN/edHumYkieaOaD8SeSslRG/O0YGR/oooyrNWAc2tcLCKL8p7IfzJv+qOjrRRTc4rMZLg30OCIKYmG3+oPSFopKoqXuwVFpF3NeMX6ieKjZMtOlt4uYsqG7YBrt1XtwWHoZ42maxBwXNXWDmx2OIRG1u7I698CV7qlhTEUtP3bHHW4eCzX6zZTDpd9TlhETN9R+QEkiauc38jtMKTpqPb+zO1wjJmrorgbf4RcSYbt6uNtj5tFQq2XWc4ddTIUt3UatPY4hEzac9m7t8QuIsJ3dJLbHzefhZtNdoLvsAqZsOIdOmiNcfSwPB2wsQxJhuy/1n+bN9WdFx40iquw+1N/NYYubts+aFFEl4x+maR72mXtU2XK6WVA30xpzQBP3PqEds5AiWrimFh6jeHBA2l5XqBxkJyTQBh/O+XhZnDuD64sC528n0Lwbb651qHTIgoxUE2gBAZO3k/p2FAbLLwRcXlNtIg5kgrcSGxoS/mz+y937jI9qCRpkhc814kc+HFTT6gQESB44jBjp44cRI/iHHRYftCafyoemK/OxprJOM1G2u2jm8De0KBzFIXMb1MDnnuNqTffZQUb6brO2v+wS827sIPEFDMouA3aVvEcCbdAHgJf7dPAL0/wTCPwww96WTXVpynHuGb65/oxbpNx9pujsVZa8zzbqGu9OQaSzLzFTV3l3EiY2boz3YyIKaLGjLmmr0A8+wh95crsemP45ua6FqhBXispC9/ptHJXJ7idF0lXWyiflkWQb7RyLbnJlQuOdag8OSE/TLuv3B64EBE9t5ro13HXLjONK1tvy4Xc5TygCb0L742zafYaOqTaU77FmPOHbrBcmPMnh4wFxfIcuvDd3DUuj+vjFJNjmU/tRY/Cp/QhL4yPgkAEb4ANgXXyAFX5dV3cuTW4WRmMVc3eYKhufLH2PtaIBork7TK+wAy0Z5g5DTatHc3eYKlu+LH2H9XyJwz7jmSzahjelKzYWkETYzl1ivsMuIIp2c1wpTeMcUUALV+gKg5kAyuNtpybeyQJWfwEoHmC2hizAu54JSbKx8QL1x60IlmTkRZ9VbE8nWAoj9LhaTFFY6MsuTxZtzTCURwMbeXBZeuzryqYHqWYeWhKed1igT8KHg9JBkF/lbktJQpEE+MhywlGb7M+k/rxyQIZfW4IFGkWBi/dllRFRJUP7TH3WDqMfyezuJ6s+RUzyQDN9a0kTRbstJLUmZylLYbQjb1myaDtHy1yiqmgymaGilkvoUbVhSJTspnVv3MSHI9Lo92jFIqLrMrfyRc5yEVN9tSNYktE6LEPLLSSg8sqzixQNtdIXW4YpGvJB1j19KL66Q/2vJ7Bg8QSUfIpLPsUk1yka5fvAsEFjO0ejqUgpS2G0M3sJFbScPvTgMkFMwSzsFj5FDbNwtJbZ403qB+OTcJtdTyUmYnZ2tkydK5+E2+ysbSkVs1zb8V2uJBs0fmgrVSVfCLj89AbuyxfFxo3tw9jtG5NF23nWCf5y+3hUfMfXlGaKhg9tBedkwSKiO3KQsiQjO92Mpn7FiqLJxDKinpD0NsoqzAug9tt8tsJyI+ltduaSFpDs592TBtx/7MNB6bpr9xxLZtiScXhXheIzSRNRO7WNRl7fWpA81Kw7q/Pjk2gbPzLx+HDmghJ37e9cIAzLLjaclCu2cjstoD5jQZImOVV4JBfzaItkJe1/nh1IEua1Jk9hFXMwJ29aVuGVslRubqJQ7xfwMEdvZKXwS1kaN9sfU5t5JMzL/3gq3Aiazs9+xnb4eTTR71LdmVFuXzacpDgFFvtQN+bDHKWdF07gsP4/zIPclsVoWV08eTfroqftlrP4bus8orpgReUpPK1wg4TT9ZCYqlSs2AUXM4yZzfDV5FmMRS8/WRboiRNli94zTO8Zqvcc03uO6r3A9F6gei8xvZeo3itM7xWq9xrTe43q/Yzp/YzqSY3DrCe3DbPeV0zvq6xnhzzQFyOAirr9FhxXkPWQkuq7ejiXY3XLKy4oVE1qbBac3Nq867vzh7pnblB1ggsM1hOTuADlNLpoiVfCw15QstrlJCldTqLKHEtQ7lX4SEl1immHfUYDKKQrJ3WFiXpQtwft7Sw4qcosOLnGrIrCR3RVFL+i/2ZctAzmQOykuOFExab7ahdO5J6NjxT39C2L7h+7Y1196l2gadPf18yplcmFY4qu8sZR54HvE7X7//R5yLBEt+XQp9gn9pGoKj5QoBgaF2i4QBBEDxcaQ4hi79R9qLzFmjriKBiQHNBJYaDSFXYD+7rwEYrwyI6kHcHhze3LWy9sNV5cKNKOjfSgz0YAN07rW4wsT3L8h3kQKpJFICrSd89i5G/ex+4oN18zSN597AKpyl0GHynvAJ6izMmp9ICypo0kh0guOHAL9OeOOUszS65AUPO66xo7cIB0F7Ck7S+UyOUQozXq/EJEIg+tP/wudcZ/l/viSEjRSUsRTHSZkTb3UpZ9pGIvp9vgfu1WRTh5iiL6tI0bTwvaC0zcBTiFrpILeMPJijaSlNy+bDhZcRjtlXxteR5uO+ELE4GRXZBA7mcUovZbeZbFfivPiBZQijNKtcVUllyh6JZIuQx9pKg6XW78xYz2WJ3wLQ6xsrJ8E/AsC18B/AUcQX6BR5Db3jhBccWhW9uQCYgQiyn7nwdoBi9LA7dC2YK8vpylT3mMVuzwklbNfX0PLzvYsYL8Zm84eSNVOSIv4AKT9aYRB6K4AkFNaapvhaGbx9xoVP7YpnjUYQ7fZcpBajgpBuxiV5BVJhsB9gA6DiEWV7aTP+AbQ3JQJ+C98ZDI5j24BgVYcS8YMqNyjc2lzDBpMDnD5PHkDHw7dvmYu76iBYKayGzJtebGv+vds54cU+nqosfuMPWJsqd489xsgV46d+32VQDPeQOKmv69WYByDBf1xZuxnC56KdY1eJlUqArWzfhOKKyKZFiiG3+hlNOG7pK6Ru5j8vTA0tg1r59jKdwUbydNkr26I1DVZ5SotkyssScUnKQPVekCyY3hsj52J8SsrroHIoIjqU8IokdykxBgQ3JEJ+lyHacN3qtzjVwPMyviN8P4WKAcIjSsHt8do7CiqKhveIMMbpryUMf4Chnck2Kirt5VMrhhREK9optkcD+CiHsqm4UsD3WkrpLBfXNs1D26UgY3JoioZ3itDG6Z8mBH724ZhV/EQt3iq2VwR4oJu4bhshWmKRH2DK6YUVgmPNjRj4SqMIxpuF9wz4zGMSGKnt6tHoBRhAbU7fIH8FHfgApNKME+WNbm7vyYFYHrPiaQOJNhQcA8BnDVw6YHjmLm9+/NoTyPzJ1ETjcEo9qK6runNRCCzM/CUHz5GSY+LwcDnhi+p+Zas6fmempRwGfmQTFdzfNSt2x+WF3IIIQD+kIk3kUXC8K7AuU6MQORWoFFrQ11wZqxc/dQnqdyVMxN5GigH1R2moCVDut2JvCyPhJTlWfxNxyt+K/gCKr5Xp7cUiB1CvXxk+LoloeLYSz7kY4vO2sUKVrK0+Onxc203/3rPPnLysdgUf1ZcWkPprdtymFK1dRdI1fFV5MMR/R6XjT1vSnGvjxkviGrRQgVlV8Uvf2on8q2PJpTJozBKp6gRf2XRVkX3XmsT/Wf2YPpq36CFvVfFU1zggomQOZq76Z8Lqu78miGTOW96bt2/GtvygP9yiz0YgIWDijl5tiX51tEdAKCoqeuPXaI6AQERbumKU8louqQoOy5bs04ILIOCcoO9cHc1dUdIrxgYenpDcaUJygrHNRA933LVMCqKYfBkM3NTCxmiJSFm3nfO6u1giS1NWgBK7eh5HKwHx5P7NTZwf/w1+m/Q/ZTLtxBOKaby2ZW2RCh4JOnftamsPi2x7GEQIqDlmy58nQJRpTqFy9lEzq2B2qYj+1BmGdC9tFeTKC+ULo8HOi16LVmzbIRMNR8+TyUzC0jEqLcImIsS67EEZrZdbhYkBoSE3q5AXEsR4/XCMH8aC2RzHT2KVGmqx/L0r1gQjTfBw4k39yMpn/fHpD6GUHZ2tnUx/a6SzfiJSkNgVxK18ghcjMRQdlXNMKiDQND4+x+SfrO92Vf2wjMi/IvZIf52VNCJBtiJ0luhsGm1NzYDcZ2bABUDgLNiX81xzq90jKuHD6KqRkT7Lr2uwukkoUwMsTGlOTZ0HtSwoezYIQA3WkRskT2US1M8c2IkApRbSaUr8VGk6tajIWEw22ek1Ksl27wfPr451dPXpBPN4pRl08lEaAuk0TF65yh8DZ28xNXt+3vbMUWoj6FhQpEe6KKd4rcxHQtNwTXtZSiRqVJ5aNF5VLKRYtKPaQoUYJLJkpU1oeJDpVz4qJDpT5SVCjehYwKlTPJRoPKebDRoFIXMQqU5ENGgcr7ZKM/pT5TdKT8ezv9zLy2lf19vu8m/4H0Ucw30u35xgdsJJ5rpUgC+O0RuYJxElPKf3y5WFLU86JjSaVqdK83Vazs5fbyI/RQ3COcXlczTZjKzy8Bs2WYoNEnxxJZSzK8VlDU2bBaxKObsNLX10NxSaumjCQzCMwDpAnMs5wZ61dW1F6RoijRG6Y1M31iQjJ6PyXhCC7Le5VI1PaworD32ZZ0PahG9m03MMMgEo7Ku04AKO7AOmlF2jcC1z7R4bHCVzobFotoPCewdw5PfEt8rFgWfsdBEvaxKmGkjGM8bGC7Iqi4xaqENSlf8GzlmDYdMNMnC4LrEfXGtq/bkUkmgTGUS1tfj3VVNkzs6PRTkuOw37y+Y+Yo7K9M5ukoccHblY0OR3ww+6593479A5vHGSPl6dep7yIoORAn9a5riRDaiZgPY+Uup3O+tO2vTGkfLqfzm6Npxzft8M0ffccVLQIy1cwip+rCi00QQebvwTFMSuXvybnLl8//4kbkVsOce1OVdqdBpPzZVF3PfOE3jJDEa1vYvM4EkWTYecYFwYiYUz2Ops+umy2/hxLP6QW0cl3p+XL5aiMQ5OvXqptwmFpXzjP1CvWQwWgv+zmWfpkdmOM+DJvz3CaXFVYJiXNYJ9Rw/YjCtQJda9YZeNiAYAke05WzKn2PIWjP60kq9YDD6Bv7dcClfTinalvA946EqHpwTvV7PSpENzSjeVsfb80wuu4xXg4UjXGpD42yzYkYjPbJu7AXlk9JjMN5G/7gDilJdtA+BYrGuWzhkPBqlJI4h+j2SoUNzQS83Juudwp4jI/dJoc/Eg/NaA7e1Yi4NsHiPG4v43RlNlwyEYPTnkYl+qdM8kQfrT6qa79AWm2PI+q7Ybzi+aYsziOI8qFwoXicj71IC1ff0Izm/XpfEa6ccBj9b8HdRLgHyRN98Dr0DWxzvq2XBGnT7nESfX8nXhoX3B+H0/HA0zF4GkoiTh4dReJZKCLEeEg1gfAOgcX0BRs/9YFsPBTzQMxozKH+/VJORSSpLThGMBO33H8cTLzy9JkcDTPcPBpupHk0I7axLwIKksdjb452qH7dlwduGYkAC9JuUUF4sBGQl1w+TnbHzk0YD4TQTdCCuLyy4aN4MXFVbsMIQtOKhFiGG0yQiy+IobSo+2FSoXBpjdRJ19YIGX6v14bhhd6x87UzQJAwN+WlgYoohIKyYoEFSF70/c2NcTM/9pnb6RJWOYUL8uB+3wTKy0L7fUMcL/ixnGZBonvCCUUfyEv+to0+39XuJOMUTpZbr2Bpe+w+md6epy6PfJ2WyIJ13V5GM3yp28r45fN2WtxgZmllrmDcHYR8dQch7b+b71Ab6+F4wT/6g+l/6bo7Vm5F8WLzCjJQLwOkINoNtWW78wDzA+DFKQZm8ra7tNN4U+MTkzCrpQZrnCIOZhQ2gpBPSAFt2rGvwXzMWFz44Y970zcls6ScIYAWw1ifylFVuyIOZvSrm6P0GjCkkRXZP2AONrmghiohO7K+J7+7M/kDOZtmP7GeNU/dYav5fCMCP5aEnUWfl9mRHM1rTRF3WOJtbUrbYWfHesNYnrAGkqZitlftvRlGu50UrFo+QWtxabUel3irS85kut8BqxIOisl6DaOm1qU0tZ3mdd/7BfmhT8ePfTN8NvxuxSS1le69ooiY5bwjUNPLCSkqG6xOLmBQWlH9VHVuqyuo9gzH5P9Z1jbqh+ZlDSm8zefyGzJe22CCHHDQN4DxcutuYmDIFmEFYerCDUo0d99GIohsTwxx2o1aExs5+BwBhYSDB58TqCD7cPraCQ9sgvAyWPsGNmbX3Tgff+InUTwcItgNIyy6YgHhuZlAtQM4L4+dSo+AjCR9tai/GpO/UjRdjLkth987cKomxTLJnMBwk0KhefFp9UWcOY+AjOSvpmQWMe2vzPKd/flUnvFDqjSB22obdNOZhPowLsU+DtgRTOLh9EoHglMwLK0oc4bG2V3RS46J/lV+xZEQJCKnBBeB0vI0izcLFyzDrzDhksJZ+V/qgyQ5Q3iZ8Gy8UBQpWhAPj3dTgukB70iEOgSZCmWPQkZiaS79Fjx3lXLafl/N2xCBVziGsgm0e/eT1jWV9GCiXHptAK1H3xgQCeYW51JJbm0uEiWX5lLF7MpcJDc38kJd3lCs2MfuyKl87OJPfUKXzqKsGEnoyL9LDsGKLBdP2Mf9x3kMA4KligScl89cU0EoM3dURKLtTac5vUTiWYPkoglOPQHzaY8378TdBnrvTtBjoK9RD1qt7PXpabtVz9gvozn/xgyHQxzTf6u9mcXrTpwkIOGM/NW66il9AQIg+1SCU6vAV4/CIwZLpw23iBi8CXU3CaGcu5gkIxff/YFoxxzEKLzvA3AJCYhFfL0HYBJTEBvvUg/AwUMj4tENHoBBxMBM0HabJCAW1PUcgBFFQ+yiSzkAp4iBmITXcAAeIQGy8G7eQAw8OCIfX7MBWMQUyCYMpY+4hAzIJLhKA/EICJCFH2IecfDxmEFwVwZkETB4k3nq/Ev9p3lz/flT2ZcntrNDEmCLD/V3c9hWmHR2JBm2/odpmgedoUfhbaYA8fEVo0F3zIeI40gHxga5MRZIqKvkUu8jhLKy3mUrnKQHE+TsVSjgeCQB89L1cDfHr52fM6udoEXxtza40Zv+yKfZB4qS8iA4t6pEiSHPPgCKkv+xnrWRNDekQvSDQja+yp0VTkK3SOp0IJfQIpo3n++e5os7x9EY6SxEcfzjrPkqO/N3Y8cKLiBAah3lIpIeGJCWChQrx2k18m3ZVJemHJPPXfCFILHip4Jkvbn+zKed5uizEn2R1aYRX5+A6Quttp1YgBnwvFSPSfF0NA9l57PY+whUJa8r8PhTRxQ4+Z3LFbgDQwW+QuFkqgucpMF2YIF7YF4aHbfgA5Z53EG0n+FzjGDys/Qu2eJTuuGEhLr9HJ/aj7zeCoPkPpvh0rBLNCESEpV7f9zulIzodV3dxamNnlEMBJ5STHFdZyTpMUeZCddjCkI1Il4rTWsXbUyBvIjdKaLRFR9mLMNQmtjDd9rcOI7SiAioiXhlAmuKdvNmQJ3ZTGKtwgCGwEQ+SYAsXKRBhUVAYC3cDieXa7ZVDYCApNxg5TdX0YJw80rhOYOm/ppfhmvqr8wKXFMPo2m3q3Dyq1sxklnYiqF/tNx2agoti88B1ETZGQcLQmn1sKLwclr+0xyCRxKP8bLBFnhN1N6gGlmkTCK4LJ/cviE6JIwdJlBWSJZo9s6LHydZ+FiVMJL+GA8ZfAy6OHnhj0m3hhFEU7tgIWHXOiKyDqkQRdO7oUVxIXSoB5KlvnOBpTeMKJTZ90krMrs/JWmkOBOCaLHsOZOUFxwsiCTXx4rC3nEdSdeDamSRJEdwUd7bEgK3zRRnlxGSoRwPNXR1TZu3iLXTTJE/gimbboELRZcNKsra9QNJz2IgIaQIFpwo+MULDyiJ+liVMJLiGC8bCMcXfBQohvY+QrRSHCqMhAGaIL2QDakQxVMN90WwKw5SrEoYT/eGBw1waUw0CLEoCgdopTiU8oQhmzy0lSj70FaQEJTGGScKUkvTtGRuaZoQxfrRYB/6n0EQSUx0QYPiSIkqOuYOio7KQ7Qgjkb5SrGCMBTnKwIKkm67I6/mMIIQcnI4xAmC2FnZGCmJgqdlU6wgjB3JjJGMaPgpjGf10s9fMK03xZmHT7ERaG66MTg2kiQsPjQSpqs75vf6zz9KKzQfu+7uwlwR4n5nErEc/chLLAhA5EPdGO7+zBgXSoa3aK7Yrjnwt3KmSET39yCyp1/0PkIq/wX7z75mAwCHOLYoiWFyqpYZIOekgNNrBJqr9x5cOnwaQ0FZ/JXNk1grt38+/wp6ALEaRB+O5IERH41nqYB8QXeIgwXfHMpzUD+jN4gCsy/RROCKbvkdKzm+fd8wYoYtCMqsB+QzOgzl0Yg10IPxdW7Cfe6aXNuzAeSSm6DXXdfYG7NYvQUka4633QENw02h2Sc09nVl31BubdJDcSVJnxKMU5g/GxikzIfJ7yCFBsXzb0yMkp6Uj+ffnhgJJjWq8rm0UlU+SWx3b/q+PhgstjiFZvqGCxwdaNB4wAAacBBgQBoZL6RYQBgbN1BoRBwcP9B4wAAbR1BoRvxc9oMJd/PHiiuEkZknpvPv3QxgXrcZkW8UPID0is1QqS/mw7jmlVpWAA9mS1TQVrweOsGqhPWZ0d0NHRDFzjeBBsSjRRFdlhgybI0+Ix+tFN+TqV1PCo7UQ+IBA3w8QxM4i7PbevyuvrlhWrUNxDWPDnXdTbsb+SiDKVYW/o+yuTBTlz6Ka32ptb2wn59d0wt7+B4Mefgpmn30G9z1a68fzpmePwkVW/2NpKheWZKQlTQMQVLidAiCpMSDaALJeC35ktIE7ssqBjmgU84HOCCz4U5ponkI0HIGcsETyNRzgRPIpC+Hp9DER3g5+fnADGQG+KAMZBY+dkc09RtUTjgZ6oFMczbMA5nceUoJTXIIl5OdDSJBJp0NIJFJvp06wVPvoZHE08EpMmnPB6Ygk+73BtAMEBw5G3wADDIzcvALMktzNwHNTQiXM5INrUHmgQ2rQSbfnRxHUx+g5cTnQnaQaefCddBJt2fI0YRvWCDZZBgQOtHZECBkkpctOWiyI7yc9HyIETL5fHgROgvuVDKcgwAOZCB3PppOP3dEmk7+tH0ETr2PBhKfCYpCp50JiEIn3R4XhFPugYGE00cW6XTnTy1mkj2dHcQT7sORpGeCuGQSzwRwiZKfhLGIFMnAFbSGDXnC5NxDcRmO7mZGBkoZCjvECC5mVpiEBM6iN+VB2uWxYZgBqPtm5EvW/c6UqQPIqw0hThTMTyZuv0ujSofkVxU2DJukm4a9u3YGMBK9OXX3Rn5kG4p9aDauDJcc+zubIQvgxsAbgns7HSq/BWH7XX5WFiltP/BRXPaCrc2JSLKpOSED76wP495Ui2Mq8/yrWDz1cCfNia8YKTmfjb1Vue5acFIyy5GM8LkcAs02f92lPdiTsczix4Zh3qT+0l61v3XVnRghPkYyokufMF8FFwRTDRdIvu74CKn+rAeVpUoUArln4G+OB94XCo7I43Uow+BMBlP21a3UKvso7rG7rjTz1B2Ae+gOIX9NI6AsyVSj3G0qRC1yUP6L6oGYZA3c5d4De7n3ANzMPCA3Mw/yzcwDcDPzYMY42DUhQ0W7jmWgC3AG9AKcAbwAZ/ihC3CG28vIH4ZbENyr4wUXa8wB/C4xLLZlcTS31CO3WykaFFdmI6HINsxLvf4uvtPzIPqmgwvDB8uJtGhVScQExCKOW56WBR25PFceNogIXB4+WE6si0+iKpGUItusH3KVE8kCzB7aaqrAOjOKBZolzyZ94j4Oe+rT2Z2zQfvFeRLb51guhfpyW9/YmPL8xYQknGv1mwmxxqqfaKx8Cuda6vBbknz8009I2BuxvwPdGx+Gygn7ZSksN7ad8EwLu/wsVi0LFLpMC0TKKrAtOMZxWRzG7rxsZmOqiIdia8Y0McjlcgKweZwQSP0IgLIk9xxXgPwkJ6j0LFcQm6y41FMdqsRJEbfBNL8lI8XJOZ0PWrpwr6YccsGjKSSsbtt+SHwDwtrT3inhM0FiUQdxJO3j2K/asp0UH+nSDNYkOAebVLbkBGxY0R7aSszugpFSochmiubFh9GcuEza35lsXrvbvd6OfnAXv8J4AKmWXPs3VDGKMUzUrStxInDFcKV1/bE7MumafxWTsxwIC+eSAykfIusFGyKYBKZAUTu5C4mRJ7GSw9h9asraHlNnI1cEMOaLOnZuc6bdThtEkSYEfSAjeU1ufwtynr+AJy1RD8uUZYSCVeNdbIAFRUH9wn1nslmKR53iDWKyF8VA3bytXbJRBEY9oj1Ysg9BwL3AJiKLR52oDU2yX46FukZbkGRDgoB6hVuGZKsUDzt5+3wAnwiNusTbcWQnigG7hZtnALOUAHsFm10AqwQPO/nbUwCjGI77BDtJEKeEIH6Rz6rJFhLOfaHPqskWEs59rZPgvFyvLwGz3b8EDU568UTEcosDDNhsYJ20Mjc0kbX0bgxiqm6EEt8NamdGJEhvzCC08OZpT7uENhP69sGPlc8KhzBJ996FUWJe/wXBvJILxFaWToz3RqG1C2yLxifTHux7B1oG8L2e0dU8smtE2O2L2kmR9LbQWZo7eRkW1yR8K+vxQ9e7cUE+8QGMSfuM+2zKAzM766MYsTgwWDw5QoUECyZHwvBewNoYTeDKD94vie+TdEh3EI1uRnyE1ILMJ7OJtddMErPLsEQi8XkxEs9XzP7kqhuzZcIDcZXS7r2TNsx4oETqX//9r/8PKW4O/g=="
|
assets/search.js
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
classes/types.ActionBase.html
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
classes/types.BrokerBase.html
CHANGED
|
@@ -39,7 +39,7 @@ Extend this class to implement a real exchange adapter for:</p>
|
|
| 39 |
</div><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-1" class="tsd-anchor"></a>Example<a href="#example-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-6">// Minimal implementation β only handle opens and closes</span><br/><span class="hl-3">class</span><span class="hl-1"> </span><span class="hl-11">NotifyBroker</span><span class="hl-1"> </span><span class="hl-3">extends</span><span class="hl-1"> </span><span class="hl-11">BrokerBase</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-3">async</span><span class="hl-1"> </span><span class="hl-0">onSignalOpenCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-11">BrokerSignalOpenPayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-0">sendTelegram</span><span class="hl-1">(</span><span class="hl-2">`Opened </span><span class="hl-3">${</span><span class="hl-4">payload</span><span class="hl-9">.</span><span class="hl-4">position</span><span class="hl-3">}</span><span class="hl-2"> on </span><span class="hl-3">${</span><span class="hl-4">payload</span><span class="hl-9">.</span><span class="hl-4">symbol</span><span class="hl-3">}</span><span class="hl-2">`</span><span class="hl-1">);</span><br/><span class="hl-1"> }</span><br/><br/><span class="hl-1"> </span><span class="hl-3">async</span><span class="hl-1"> </span><span class="hl-0">onSignalCloseCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-11">BrokerSignalClosePayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">pnl</span><span class="hl-1"> = </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">pnl</span><span class="hl-1">.</span><span class="hl-4">profit</span><span class="hl-1"> - </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">pnl</span><span class="hl-1">.</span><span class="hl-4">loss</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-0">sendTelegram</span><span class="hl-1">(</span><span class="hl-2">`Closed </span><span class="hl-3">${</span><span class="hl-4">payload</span><span class="hl-9">.</span><span class="hl-4">symbol</span><span class="hl-3">}</span><span class="hl-2">: PnL $</span><span class="hl-3">${</span><span class="hl-4">pnl</span><span class="hl-9">.</span><span class="hl-0">toFixed</span><span class="hl-9">(</span><span class="hl-7">2</span><span class="hl-9">)</span><span class="hl-3">}</span><span class="hl-2">`</span><span class="hl-1">);</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span>
|
| 40 |
</code><button type="button">Copy</button></pre>
|
| 41 |
|
| 42 |
-
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IBroker.html" class="tsd-signature-type tsd-kind-interface">IBroker</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 43 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.BrokerBase.html#onaveragebuycommit" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Average<wbr/>Buy<wbr/>Commit</span></a>
|
| 44 |
<a href="types.BrokerBase.html#onbreakevencommit" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Breakeven<wbr/>Commit</span></a>
|
| 45 |
<a href="types.BrokerBase.html#onpartiallosscommit" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Partial<wbr/>Loss<wbr/>Commit</span></a>
|
|
@@ -58,7 +58,7 @@ Extend this class to implement a real exchange adapter for:</p>
|
|
| 58 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-2" class="tsd-anchor"></a>Example<a href="#example-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-0">onAverageBuyCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-4">BrokerAverageBuyPayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">super</span><span class="hl-1">.</span><span class="hl-0">onAverageBuyCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">); </span><span class="hl-6">// Keep parent logging</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1">.</span><span class="hl-0">placeMarketOrder</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">symbol:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">symbol</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">side:</span><span class="hl-1"> </span><span class="hl-2">"BUY"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">quantity:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">cost</span><span class="hl-1"> / </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">currentPrice</span><span class="hl-1">,</span><br/><span class="hl-1"> });</span><br/><span class="hl-1">}</span>
|
| 59 |
</code><button type="button">Copy</button></pre>
|
| 60 |
|
| 61 |
-
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IBroker.html">IBroker</a>.<a href="../interfaces/types.IBroker.html#onaveragebuycommit">onAverageBuyCommit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 62 |
<p>Triggered explicitly after all validations pass, before <code>strategyCoreService.breakeven()</code>.
|
| 63 |
<code>newStopLossPrice</code> equals <code>effectivePriceOpen</code> β the position's effective entry price.
|
| 64 |
<code>newTakeProfitPrice</code> is unchanged by breakeven.</p>
|
|
@@ -67,7 +67,7 @@ Extend this class to implement a real exchange adapter for:</p>
|
|
| 67 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-3" class="tsd-anchor"></a>Example<a href="#example-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-0">onBreakevenCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-4">BrokerBreakevenPayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">super</span><span class="hl-1">.</span><span class="hl-0">onBreakevenCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">); </span><span class="hl-6">// Keep parent logging</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1">.</span><span class="hl-0">updateStopLoss</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">symbol:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">symbol</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">price:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">newStopLossPrice</span><span class="hl-1">, </span><span class="hl-6">// = entry price</span><br/><span class="hl-1"> });</span><br/><span class="hl-1">}</span>
|
| 68 |
</code><button type="button">Copy</button></pre>
|
| 69 |
|
| 70 |
-
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IBroker.html">IBroker</a>.<a href="../interfaces/types.IBroker.html#onbreakevencommit">onBreakevenCommit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 71 |
<p>Triggered explicitly from strategy.ts / Live.ts / Backtest.ts after all validations pass,
|
| 72 |
before <code>strategyCoreService.partialLoss()</code>. If this method throws, the DI mutation is skipped.
|
| 73 |
Use to partially close the position on the exchange at the loss level.</p>
|
|
@@ -76,7 +76,7 @@ Use to partially close the position on the exchange at the loss level.</p>
|
|
| 76 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-4" class="tsd-anchor"></a>Example<a href="#example-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-0">onPartialLossCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-4">BrokerPartialLossPayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">super</span><span class="hl-1">.</span><span class="hl-0">onPartialLossCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">); </span><span class="hl-6">// Keep parent logging</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1">.</span><span class="hl-0">reducePosition</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">symbol:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">symbol</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">dollarAmount:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">cost</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">price:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">currentPrice</span><span class="hl-1">,</span><br/><span class="hl-1"> });</span><br/><span class="hl-1">}</span>
|
| 77 |
</code><button type="button">Copy</button></pre>
|
| 78 |
|
| 79 |
-
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IBroker.html">IBroker</a>.<a href="../interfaces/types.IBroker.html#onpartiallosscommit">onPartialLossCommit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 80 |
<p>Triggered explicitly from strategy.ts / Live.ts / Backtest.ts after all validations pass,
|
| 81 |
before <code>strategyCoreService.partialProfit()</code>. If this method throws, the DI mutation is skipped.
|
| 82 |
Use to partially close the position on the exchange at the profit level.</p>
|
|
@@ -85,7 +85,7 @@ Use to partially close the position on the exchange at the profit level.</p>
|
|
| 85 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-5" class="tsd-anchor"></a>Example<a href="#example-5" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-0">onPartialProfitCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-4">BrokerPartialProfitPayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">super</span><span class="hl-1">.</span><span class="hl-0">onPartialProfitCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">); </span><span class="hl-6">// Keep parent logging</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1">.</span><span class="hl-0">reducePosition</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">symbol:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">symbol</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">dollarAmount:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">cost</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">price:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">currentPrice</span><span class="hl-1">,</span><br/><span class="hl-1"> });</span><br/><span class="hl-1">}</span>
|
| 86 |
</code><button type="button">Copy</button></pre>
|
| 87 |
|
| 88 |
-
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IBroker.html">IBroker</a>.<a href="../interfaces/types.IBroker.html#onpartialprofitcommit">onPartialProfitCommit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 89 |
<p>Triggered automatically via syncSubject when a pending signal is closed.
|
| 90 |
Use to place the exit order and record final PnL.</p>
|
| 91 |
<p>Default implementation: Logs signal-close event.</p>
|
|
@@ -93,7 +93,7 @@ Use to place the exit order and record final PnL.</p>
|
|
| 93 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-6" class="tsd-anchor"></a>Example<a href="#example-6" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-0">onSignalCloseCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-4">BrokerSignalClosePayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">super</span><span class="hl-1">.</span><span class="hl-0">onSignalCloseCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">); </span><span class="hl-6">// Keep parent logging</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1">.</span><span class="hl-0">closePosition</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">symbol</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">db</span><span class="hl-1">.</span><span class="hl-0">recordTrade</span><span class="hl-1">({ </span><span class="hl-4">symbol:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">symbol</span><span class="hl-1">, </span><span class="hl-4">pnl:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">pnl</span><span class="hl-1"> });</span><br/><span class="hl-1">}</span>
|
| 94 |
</code><button type="button">Copy</button></pre>
|
| 95 |
|
| 96 |
-
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IBroker.html">IBroker</a>.<a href="../interfaces/types.IBroker.html#onsignalclosecommit">onSignalCloseCommit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 97 |
<p>Triggered automatically via syncSubject when a scheduled signal's priceOpen is hit.
|
| 98 |
Use to place the actual entry order on the exchange.</p>
|
| 99 |
<p>Default implementation: Logs signal-open event.</p>
|
|
@@ -101,7 +101,7 @@ Use to place the actual entry order on the exchange.</p>
|
|
| 101 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-7" class="tsd-anchor"></a>Example<a href="#example-7" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-0">onSignalOpenCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-4">BrokerSignalOpenPayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">super</span><span class="hl-1">.</span><span class="hl-0">onSignalOpenCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">); </span><span class="hl-6">// Keep parent logging</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1">.</span><span class="hl-0">placeMarketOrder</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">symbol:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">symbol</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">side:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">position</span><span class="hl-1"> === </span><span class="hl-2">"long"</span><span class="hl-1"> ? </span><span class="hl-2">"BUY"</span><span class="hl-1"> : </span><span class="hl-2">"SELL"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">quantity:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">cost</span><span class="hl-1"> / </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">priceOpen</span><span class="hl-1">,</span><br/><span class="hl-1"> });</span><br/><span class="hl-1">}</span>
|
| 102 |
</code><button type="button">Copy</button></pre>
|
| 103 |
|
| 104 |
-
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IBroker.html">IBroker</a>.<a href="../interfaces/types.IBroker.html#onsignalopencommit">onSignalOpenCommit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 105 |
<p>Triggered explicitly after all validations pass, before <code>strategyCoreService.trailingStop()</code>.
|
| 106 |
<code>newStopLossPrice</code> is the absolute SL price β use it to update the exchange order directly.</p>
|
| 107 |
<p>Default implementation: Logs trailing stop event.</p>
|
|
@@ -109,7 +109,7 @@ Use to place the actual entry order on the exchange.</p>
|
|
| 109 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-8" class="tsd-anchor"></a>Example<a href="#example-8" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-0">onTrailingStopCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-4">BrokerTrailingStopPayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">super</span><span class="hl-1">.</span><span class="hl-0">onTrailingStopCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">); </span><span class="hl-6">// Keep parent logging</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1">.</span><span class="hl-0">updateStopLoss</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">symbol:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">symbol</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">price:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">newStopLossPrice</span><span class="hl-1">,</span><br/><span class="hl-1"> });</span><br/><span class="hl-1">}</span>
|
| 110 |
</code><button type="button">Copy</button></pre>
|
| 111 |
|
| 112 |
-
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IBroker.html">IBroker</a>.<a href="../interfaces/types.IBroker.html#ontrailingstopcommit">onTrailingStopCommit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 113 |
<p>Triggered explicitly after all validations pass, before <code>strategyCoreService.trailingTake()</code>.
|
| 114 |
<code>newTakeProfitPrice</code> is the absolute TP price β use it to update the exchange order directly.</p>
|
| 115 |
<p>Default implementation: Logs trailing take event.</p>
|
|
@@ -117,14 +117,14 @@ Use to place the actual entry order on the exchange.</p>
|
|
| 117 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-9" class="tsd-anchor"></a>Example<a href="#example-9" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-0">onTrailingTakeCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-4">BrokerTrailingTakePayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">super</span><span class="hl-1">.</span><span class="hl-0">onTrailingTakeCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">); </span><span class="hl-6">// Keep parent logging</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1">.</span><span class="hl-0">updateTakeProfit</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">symbol:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">symbol</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">price:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">newTakeProfitPrice</span><span class="hl-1">,</span><br/><span class="hl-1"> });</span><br/><span class="hl-1">}</span>
|
| 118 |
</code><button type="button">Copy</button></pre>
|
| 119 |
|
| 120 |
-
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IBroker.html">IBroker</a>.<a href="../interfaces/types.IBroker.html#ontrailingtakecommit">onTrailingTakeCommit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 121 |
<p>Called once by BrokerProxy via <code>waitForInit()</code> (singleshot) before the first event.
|
| 122 |
Override to establish exchange connections, authenticate API clients, load configuration.</p>
|
| 123 |
<p>Default implementation: Logs initialization event.</p>
|
| 124 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-10" class="tsd-anchor"></a>Example<a href="#example-10" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-0">waitForInit</span><span class="hl-1">() {</span><br/><span class="hl-1"> </span><span class="hl-3">super</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(); </span><span class="hl-6">// Keep parent logging</span><br/><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">ExchangeClient</span><span class="hl-1">(</span><span class="hl-4">process</span><span class="hl-1">.</span><span class="hl-4">env</span><span class="hl-1">.</span><span class="hl-8">API_KEY</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1">.</span><span class="hl-0">authenticate</span><span class="hl-1">();</span><br/><span class="hl-1">}</span>
|
| 125 |
</code><button type="button">Copy</button></pre>
|
| 126 |
|
| 127 |
-
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IBroker.html">IBroker</a>.<a href="../interfaces/types.IBroker.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 128 |
|
| 129 |
<!-- Yandex.Metrika counter -->
|
| 130 |
<script type="text/javascript">
|
|
|
|
| 39 |
</div><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-1" class="tsd-anchor"></a>Example<a href="#example-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-6">// Minimal implementation β only handle opens and closes</span><br/><span class="hl-3">class</span><span class="hl-1"> </span><span class="hl-11">NotifyBroker</span><span class="hl-1"> </span><span class="hl-3">extends</span><span class="hl-1"> </span><span class="hl-11">BrokerBase</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-3">async</span><span class="hl-1"> </span><span class="hl-0">onSignalOpenCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-11">BrokerSignalOpenPayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-0">sendTelegram</span><span class="hl-1">(</span><span class="hl-2">`Opened </span><span class="hl-3">${</span><span class="hl-4">payload</span><span class="hl-9">.</span><span class="hl-4">position</span><span class="hl-3">}</span><span class="hl-2"> on </span><span class="hl-3">${</span><span class="hl-4">payload</span><span class="hl-9">.</span><span class="hl-4">symbol</span><span class="hl-3">}</span><span class="hl-2">`</span><span class="hl-1">);</span><br/><span class="hl-1"> }</span><br/><br/><span class="hl-1"> </span><span class="hl-3">async</span><span class="hl-1"> </span><span class="hl-0">onSignalCloseCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-11">BrokerSignalClosePayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">pnl</span><span class="hl-1"> = </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">pnl</span><span class="hl-1">.</span><span class="hl-4">profit</span><span class="hl-1"> - </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">pnl</span><span class="hl-1">.</span><span class="hl-4">loss</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-0">sendTelegram</span><span class="hl-1">(</span><span class="hl-2">`Closed </span><span class="hl-3">${</span><span class="hl-4">payload</span><span class="hl-9">.</span><span class="hl-4">symbol</span><span class="hl-3">}</span><span class="hl-2">: PnL $</span><span class="hl-3">${</span><span class="hl-4">pnl</span><span class="hl-9">.</span><span class="hl-0">toFixed</span><span class="hl-9">(</span><span class="hl-7">2</span><span class="hl-9">)</span><span class="hl-3">}</span><span class="hl-2">`</span><span class="hl-1">);</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span>
|
| 40 |
</code><button type="button">Copy</button></pre>
|
| 41 |
|
| 42 |
+
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IBroker.html" class="tsd-signature-type tsd-kind-interface">IBroker</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L28723">types.d.ts:28723</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.BrokerBase.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 43 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.BrokerBase.html#onaveragebuycommit" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Average<wbr/>Buy<wbr/>Commit</span></a>
|
| 44 |
<a href="types.BrokerBase.html#onbreakevencommit" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Breakeven<wbr/>Commit</span></a>
|
| 45 |
<a href="types.BrokerBase.html#onpartiallosscommit" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Partial<wbr/>Loss<wbr/>Commit</span></a>
|
|
|
|
| 58 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-2" class="tsd-anchor"></a>Example<a href="#example-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-0">onAverageBuyCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-4">BrokerAverageBuyPayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">super</span><span class="hl-1">.</span><span class="hl-0">onAverageBuyCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">); </span><span class="hl-6">// Keep parent logging</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1">.</span><span class="hl-0">placeMarketOrder</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">symbol:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">symbol</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">side:</span><span class="hl-1"> </span><span class="hl-2">"BUY"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">quantity:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">cost</span><span class="hl-1"> / </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">currentPrice</span><span class="hl-1">,</span><br/><span class="hl-1"> });</span><br/><span class="hl-1">}</span>
|
| 59 |
</code><button type="button">Copy</button></pre>
|
| 60 |
|
| 61 |
+
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IBroker.html">IBroker</a>.<a href="../interfaces/types.IBroker.html#onaveragebuycommit">onAverageBuyCommit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L28923">types.d.ts:28923</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="onbreakevencommit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>on<wbr/>Breakeven<wbr/>Commit</span><a href="#onbreakevencommit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="onbreakevencommit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">onBreakevenCommit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">payload</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.BrokerBreakevenPayload.html" class="tsd-signature-type tsd-kind-type-alias">BrokerBreakevenPayload</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#onbreakevencommit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Called when the stop-loss is moved to breakeven (entry price).</p>
|
| 62 |
<p>Triggered explicitly after all validations pass, before <code>strategyCoreService.breakeven()</code>.
|
| 63 |
<code>newStopLossPrice</code> equals <code>effectivePriceOpen</code> β the position's effective entry price.
|
| 64 |
<code>newTakeProfitPrice</code> is unchanged by breakeven.</p>
|
|
|
|
| 67 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-3" class="tsd-anchor"></a>Example<a href="#example-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-0">onBreakevenCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-4">BrokerBreakevenPayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">super</span><span class="hl-1">.</span><span class="hl-0">onBreakevenCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">); </span><span class="hl-6">// Keep parent logging</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1">.</span><span class="hl-0">updateStopLoss</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">symbol:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">symbol</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">price:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">newStopLossPrice</span><span class="hl-1">, </span><span class="hl-6">// = entry price</span><br/><span class="hl-1"> });</span><br/><span class="hl-1">}</span>
|
| 68 |
</code><button type="button">Copy</button></pre>
|
| 69 |
|
| 70 |
+
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IBroker.html">IBroker</a>.<a href="../interfaces/types.IBroker.html#onbreakevencommit">onBreakevenCommit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L28899">types.d.ts:28899</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="onpartiallosscommit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>on<wbr/>Partial<wbr/>Loss<wbr/>Commit</span><a href="#onpartiallosscommit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="onpartiallosscommit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">onPartialLossCommit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">payload</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.BrokerPartialLossPayload.html" class="tsd-signature-type tsd-kind-type-alias">BrokerPartialLossPayload</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#onpartiallosscommit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Called when a partial close at loss is executed.</p>
|
| 71 |
<p>Triggered explicitly from strategy.ts / Live.ts / Backtest.ts after all validations pass,
|
| 72 |
before <code>strategyCoreService.partialLoss()</code>. If this method throws, the DI mutation is skipped.
|
| 73 |
Use to partially close the position on the exchange at the loss level.</p>
|
|
|
|
| 76 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-4" class="tsd-anchor"></a>Example<a href="#example-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-0">onPartialLossCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-4">BrokerPartialLossPayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">super</span><span class="hl-1">.</span><span class="hl-0">onPartialLossCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">); </span><span class="hl-6">// Keep parent logging</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1">.</span><span class="hl-0">reducePosition</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">symbol:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">symbol</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">dollarAmount:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">cost</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">price:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">currentPrice</span><span class="hl-1">,</span><br/><span class="hl-1"> });</span><br/><span class="hl-1">}</span>
|
| 77 |
</code><button type="button">Copy</button></pre>
|
| 78 |
|
| 79 |
+
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IBroker.html">IBroker</a>.<a href="../interfaces/types.IBroker.html#onpartiallosscommit">onPartialLossCommit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L28832">types.d.ts:28832</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="onpartialprofitcommit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>on<wbr/>Partial<wbr/>Profit<wbr/>Commit</span><a href="#onpartialprofitcommit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="onpartialprofitcommit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">onPartialProfitCommit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">payload</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.BrokerPartialProfitPayload.html" class="tsd-signature-type tsd-kind-type-alias">BrokerPartialProfitPayload</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#onpartialprofitcommit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Called when a partial close at profit is executed.</p>
|
| 80 |
<p>Triggered explicitly from strategy.ts / Live.ts / Backtest.ts after all validations pass,
|
| 81 |
before <code>strategyCoreService.partialProfit()</code>. If this method throws, the DI mutation is skipped.
|
| 82 |
Use to partially close the position on the exchange at the profit level.</p>
|
|
|
|
| 85 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-5" class="tsd-anchor"></a>Example<a href="#example-5" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-0">onPartialProfitCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-4">BrokerPartialProfitPayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">super</span><span class="hl-1">.</span><span class="hl-0">onPartialProfitCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">); </span><span class="hl-6">// Keep parent logging</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1">.</span><span class="hl-0">reducePosition</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">symbol:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">symbol</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">dollarAmount:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">cost</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">price:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">currentPrice</span><span class="hl-1">,</span><br/><span class="hl-1"> });</span><br/><span class="hl-1">}</span>
|
| 86 |
</code><button type="button">Copy</button></pre>
|
| 87 |
|
| 88 |
+
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IBroker.html">IBroker</a>.<a href="../interfaces/types.IBroker.html#onpartialprofitcommit">onPartialProfitCommit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L28808">types.d.ts:28808</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="onsignalclosecommit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>on<wbr/>Signal<wbr/>Close<wbr/>Commit</span><a href="#onsignalclosecommit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="onsignalclosecommit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">onSignalCloseCommit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">payload</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.BrokerSignalClosePayload.html" class="tsd-signature-type tsd-kind-type-alias">BrokerSignalClosePayload</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#onsignalclosecommit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Called when a position is fully closed (SL/TP hit or manual close).</p>
|
| 89 |
<p>Triggered automatically via syncSubject when a pending signal is closed.
|
| 90 |
Use to place the exit order and record final PnL.</p>
|
| 91 |
<p>Default implementation: Logs signal-close event.</p>
|
|
|
|
| 93 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-6" class="tsd-anchor"></a>Example<a href="#example-6" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-0">onSignalCloseCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-4">BrokerSignalClosePayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">super</span><span class="hl-1">.</span><span class="hl-0">onSignalCloseCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">); </span><span class="hl-6">// Keep parent logging</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1">.</span><span class="hl-0">closePosition</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">symbol</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">db</span><span class="hl-1">.</span><span class="hl-0">recordTrade</span><span class="hl-1">({ </span><span class="hl-4">symbol:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">symbol</span><span class="hl-1">, </span><span class="hl-4">pnl:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">pnl</span><span class="hl-1"> });</span><br/><span class="hl-1">}</span>
|
| 94 |
</code><button type="button">Copy</button></pre>
|
| 95 |
|
| 96 |
+
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IBroker.html">IBroker</a>.<a href="../interfaces/types.IBroker.html#onsignalclosecommit">onSignalCloseCommit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L28784">types.d.ts:28784</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="onsignalopencommit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>on<wbr/>Signal<wbr/>Open<wbr/>Commit</span><a href="#onsignalopencommit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="onsignalopencommit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">onSignalOpenCommit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">payload</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.BrokerSignalOpenPayload.html" class="tsd-signature-type tsd-kind-type-alias">BrokerSignalOpenPayload</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#onsignalopencommit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Called when a new position is opened (signal activated).</p>
|
| 97 |
<p>Triggered automatically via syncSubject when a scheduled signal's priceOpen is hit.
|
| 98 |
Use to place the actual entry order on the exchange.</p>
|
| 99 |
<p>Default implementation: Logs signal-open event.</p>
|
|
|
|
| 101 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-7" class="tsd-anchor"></a>Example<a href="#example-7" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-0">onSignalOpenCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-4">BrokerSignalOpenPayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">super</span><span class="hl-1">.</span><span class="hl-0">onSignalOpenCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">); </span><span class="hl-6">// Keep parent logging</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1">.</span><span class="hl-0">placeMarketOrder</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">symbol:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">symbol</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">side:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">position</span><span class="hl-1"> === </span><span class="hl-2">"long"</span><span class="hl-1"> ? </span><span class="hl-2">"BUY"</span><span class="hl-1"> : </span><span class="hl-2">"SELL"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">quantity:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">cost</span><span class="hl-1"> / </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">priceOpen</span><span class="hl-1">,</span><br/><span class="hl-1"> });</span><br/><span class="hl-1">}</span>
|
| 102 |
</code><button type="button">Copy</button></pre>
|
| 103 |
|
| 104 |
+
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IBroker.html">IBroker</a>.<a href="../interfaces/types.IBroker.html#onsignalopencommit">onSignalOpenCommit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L28764">types.d.ts:28764</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="ontrailingstopcommit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>on<wbr/>Trailing<wbr/>Stop<wbr/>Commit</span><a href="#ontrailingstopcommit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="ontrailingstopcommit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">onTrailingStopCommit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">payload</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.BrokerTrailingStopPayload.html" class="tsd-signature-type tsd-kind-type-alias">BrokerTrailingStopPayload</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#ontrailingstopcommit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Called when the trailing stop-loss level is updated.</p>
|
| 105 |
<p>Triggered explicitly after all validations pass, before <code>strategyCoreService.trailingStop()</code>.
|
| 106 |
<code>newStopLossPrice</code> is the absolute SL price β use it to update the exchange order directly.</p>
|
| 107 |
<p>Default implementation: Logs trailing stop event.</p>
|
|
|
|
| 109 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-8" class="tsd-anchor"></a>Example<a href="#example-8" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-0">onTrailingStopCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-4">BrokerTrailingStopPayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">super</span><span class="hl-1">.</span><span class="hl-0">onTrailingStopCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">); </span><span class="hl-6">// Keep parent logging</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1">.</span><span class="hl-0">updateStopLoss</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">symbol:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">symbol</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">price:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">newStopLossPrice</span><span class="hl-1">,</span><br/><span class="hl-1"> });</span><br/><span class="hl-1">}</span>
|
| 110 |
</code><button type="button">Copy</button></pre>
|
| 111 |
|
| 112 |
+
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IBroker.html">IBroker</a>.<a href="../interfaces/types.IBroker.html#ontrailingstopcommit">onTrailingStopCommit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L28854">types.d.ts:28854</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="ontrailingtakecommit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>on<wbr/>Trailing<wbr/>Take<wbr/>Commit</span><a href="#ontrailingtakecommit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="ontrailingtakecommit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">onTrailingTakeCommit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">payload</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.BrokerTrailingTakePayload.html" class="tsd-signature-type tsd-kind-type-alias">BrokerTrailingTakePayload</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#ontrailingtakecommit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Called when the trailing take-profit level is updated.</p>
|
| 113 |
<p>Triggered explicitly after all validations pass, before <code>strategyCoreService.trailingTake()</code>.
|
| 114 |
<code>newTakeProfitPrice</code> is the absolute TP price β use it to update the exchange order directly.</p>
|
| 115 |
<p>Default implementation: Logs trailing take event.</p>
|
|
|
|
| 117 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-9" class="tsd-anchor"></a>Example<a href="#example-9" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-0">onTrailingTakeCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">: </span><span class="hl-4">BrokerTrailingTakePayload</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">super</span><span class="hl-1">.</span><span class="hl-0">onTrailingTakeCommit</span><span class="hl-1">(</span><span class="hl-4">payload</span><span class="hl-1">); </span><span class="hl-6">// Keep parent logging</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1">.</span><span class="hl-0">updateTakeProfit</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">symbol:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">symbol</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">price:</span><span class="hl-1"> </span><span class="hl-4">payload</span><span class="hl-1">.</span><span class="hl-4">newTakeProfitPrice</span><span class="hl-1">,</span><br/><span class="hl-1"> });</span><br/><span class="hl-1">}</span>
|
| 118 |
</code><button type="button">Copy</button></pre>
|
| 119 |
|
| 120 |
+
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IBroker.html">IBroker</a>.<a href="../interfaces/types.IBroker.html#ontrailingtakecommit">onTrailingTakeCommit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L28876">types.d.ts:28876</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Performs async initialization before the broker starts receiving events.</p>
|
| 121 |
<p>Called once by BrokerProxy via <code>waitForInit()</code> (singleshot) before the first event.
|
| 122 |
Override to establish exchange connections, authenticate API clients, load configuration.</p>
|
| 123 |
<p>Default implementation: Logs initialization event.</p>
|
| 124 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-10" class="tsd-anchor"></a>Example<a href="#example-10" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-4">async</span><span class="hl-1"> </span><span class="hl-0">waitForInit</span><span class="hl-1">() {</span><br/><span class="hl-1"> </span><span class="hl-3">super</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(); </span><span class="hl-6">// Keep parent logging</span><br/><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">ExchangeClient</span><span class="hl-1">(</span><span class="hl-4">process</span><span class="hl-1">.</span><span class="hl-4">env</span><span class="hl-1">.</span><span class="hl-8">API_KEY</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-3">this</span><span class="hl-1">.</span><span class="hl-4">exchange</span><span class="hl-1">.</span><span class="hl-0">authenticate</span><span class="hl-1">();</span><br/><span class="hl-1">}</span>
|
| 125 |
</code><button type="button">Copy</button></pre>
|
| 126 |
|
| 127 |
+
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IBroker.html">IBroker</a>.<a href="../interfaces/types.IBroker.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L28741">types.d.ts:28741</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#onaveragebuycommit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Average<wbr/>Buy<wbr/>Commit</span></a><a href="#onbreakevencommit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Breakeven<wbr/>Commit</span></a><a href="#onpartiallosscommit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Partial<wbr/>Loss<wbr/>Commit</span></a><a href="#onpartialprofitcommit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Partial<wbr/>Profit<wbr/>Commit</span></a><a href="#onsignalclosecommit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Signal<wbr/>Close<wbr/>Commit</span></a><a href="#onsignalopencommit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Signal<wbr/>Open<wbr/>Commit</span></a><a href="#ontrailingstopcommit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Trailing<wbr/>Stop<wbr/>Commit</span></a><a href="#ontrailingtakecommit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on<wbr/>Trailing<wbr/>Take<wbr/>Commit</span></a><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 128 |
|
| 129 |
<!-- Yandex.Metrika counter -->
|
| 130 |
<script type="text/javascript">
|
classes/types.MarkdownFileBase.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
| 11 |
<p>File format: ./dump/markdown/{markdownName}.jsonl
|
| 12 |
Each line contains: markdownName, data, symbol, strategyName, exchangeName, frameName, signalId, timestamp</p>
|
| 13 |
<p>Use this adapter for centralized logging and post-processing with JSONL tools.</p>
|
| 14 |
-
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../types/types.TMarkdownBase.html" class="tsd-signature-type tsd-kind-type-alias">TMarkdownBase</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 15 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.MarkdownFileBase.html#_basedir" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_base<wbr/>Dir</span></a>
|
| 16 |
<a href="types.MarkdownFileBase.html#_filepath" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_file<wbr/>Path</span></a>
|
| 17 |
<a href="types.MarkdownFileBase.html#_stream" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_stream</span></a>
|
|
@@ -22,16 +22,16 @@ Each line contains: markdownName, data, symbol, strategyName, exchangeName, fram
|
|
| 22 |
<a href="types.MarkdownFileBase.html#waitforinit" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a>
|
| 23 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructormarkdownfilebase" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">MarkdownFileBase</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">markdownName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">keyof</span> <span class="tsd-signature-type">IMarkdownTarget</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.MarkdownFileBase.html" class="tsd-signature-type tsd-kind-class">MarkdownFileBase</a><a href="#constructormarkdownfilebase" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates a new JSONL markdown adapter instance.</p>
|
| 24 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">markdownName</span>: <span class="tsd-signature-keyword">keyof</span> <span class="tsd-signature-type">IMarkdownTarget</span></span><div class="tsd-comment tsd-typography"><p>Type of markdown report (backtest, live, walker, etc.)</p>
|
| 25 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.MarkdownFileBase.html" class="tsd-signature-type tsd-kind-class">MarkdownFileBase</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 26 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 27 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 28 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 29 |
Protected by singleshot to ensure one-time execution.
|
| 30 |
Sets up error handler that emits to exitEmitter.</p>
|
| 31 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 32 |
Waits for drain event if write buffer is full.
|
| 33 |
Times out after 15 seconds and returns TIMEOUT_SYMBOL.</p>
|
| 34 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 35 |
Appends a single line with JSON object containing:</p>
|
| 36 |
<ul>
|
| 37 |
<li>markdownName: Type of report</li>
|
|
@@ -42,10 +42,10 @@ Appends a single line with JSON object containing:</p>
|
|
| 42 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Markdown content to write</p>
|
| 43 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/types.IMarkdownDumpOptions.html" class="tsd-signature-type tsd-kind-interface">IMarkdownDumpOptions</a></span><div class="tsd-comment tsd-typography"><p>Path and metadata options</p>
|
| 44 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws" class="tsd-anchor"></a>Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Error if stream not initialized or write timeout exceeded</p>
|
| 45 |
-
</div></div><aside class="tsd-sources"><p>Implementation of TMarkdownBase.dump</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 46 |
Safe to call multiple times - singleshot ensures one-time execution.</p>
|
| 47 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 48 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMarkdownBase.waitForInit</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 49 |
|
| 50 |
<!-- Yandex.Metrika counter -->
|
| 51 |
<script type="text/javascript">
|
|
|
|
| 11 |
<p>File format: ./dump/markdown/{markdownName}.jsonl
|
| 12 |
Each line contains: markdownName, data, symbol, strategyName, exchangeName, frameName, signalId, timestamp</p>
|
| 13 |
<p>Use this adapter for centralized logging and post-processing with JSONL tools.</p>
|
| 14 |
+
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../types/types.TMarkdownBase.html" class="tsd-signature-type tsd-kind-type-alias">TMarkdownBase</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16287">types.d.ts:16287</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.MarkdownFileBase.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 15 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.MarkdownFileBase.html#_basedir" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_base<wbr/>Dir</span></a>
|
| 16 |
<a href="types.MarkdownFileBase.html#_filepath" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_file<wbr/>Path</span></a>
|
| 17 |
<a href="types.MarkdownFileBase.html#_stream" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_stream</span></a>
|
|
|
|
| 22 |
<a href="types.MarkdownFileBase.html#waitforinit" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a>
|
| 23 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructormarkdownfilebase" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">MarkdownFileBase</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">markdownName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">keyof</span> <span class="tsd-signature-type">IMarkdownTarget</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.MarkdownFileBase.html" class="tsd-signature-type tsd-kind-class">MarkdownFileBase</a><a href="#constructormarkdownfilebase" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates a new JSONL markdown adapter instance.</p>
|
| 24 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">markdownName</span>: <span class="tsd-signature-keyword">keyof</span> <span class="tsd-signature-type">IMarkdownTarget</span></span><div class="tsd-comment tsd-typography"><p>Type of markdown report (backtest, live, walker, etc.)</p>
|
| 25 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.MarkdownFileBase.html" class="tsd-signature-type tsd-kind-class">MarkdownFileBase</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16300">types.d.ts:16300</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="_basedir" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>_base<wbr/>Dir</span><a href="#_basedir" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">_baseDir</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Base directory for all JSONL markdown files</p>
|
| 26 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16294">types.d.ts:16294</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="_filepath" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>_file<wbr/>Path</span><a href="#_filepath" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">_filePath</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Absolute path to the JSONL file for this markdown type</p>
|
| 27 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16290">types.d.ts:16290</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="_stream" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>_stream</span><a href="#_stream" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">_stream</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">WriteStream</span></div><div class="tsd-comment tsd-typography"><p>WriteStream instance for append-only writes, null until initialized</p>
|
| 28 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16292">types.d.ts:16292</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="wait_for_init_symbol" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>[WAIT_<wbr/>FOR_<wbr/>INIT_<wbr/>SYMBOL]</span><a href="#wait_for_init_symbol" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">"[WAIT_FOR_INIT_SYMBOL]"</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-type">ISingleshotClearable</span><span class="tsd-signature-symbol"><</span><br/>Β Β Β Β <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>Singleshot initialization function that creates directory and stream.
|
| 29 |
Protected by singleshot to ensure one-time execution.
|
| 30 |
Sets up error handler that emits to exitEmitter.</p>
|
| 31 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16306">types.d.ts:16306</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="write_safe_symbol" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>[WRITE_<wbr/>SAFE_<wbr/>SYMBOL]</span><a href="#write_safe_symbol" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">"[WRITE_SAFE_SYMBOL]"</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">line</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">symbol</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>Timeout-protected write function with backpressure handling.
|
| 32 |
Waits for drain event if write buffer is full.
|
| 33 |
Times out after 15 seconds and returns TIMEOUT_SYMBOL.</p>
|
| 34 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16312">types.d.ts:16312</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="markdownname" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>markdown<wbr/>Name</span><a href="#markdownname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">markdownName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">keyof</span> <span class="tsd-signature-type">IMarkdownTarget</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16288">types.d.ts:16288</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="dump" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>dump</span><a href="#dump" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="dump-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">dump</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/types.IMarkdownDumpOptions.html" class="tsd-signature-type tsd-kind-interface">IMarkdownDumpOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#dump-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Writes markdown content to JSONL file with metadata.
|
| 35 |
Appends a single line with JSON object containing:</p>
|
| 36 |
<ul>
|
| 37 |
<li>markdownName: Type of report</li>
|
|
|
|
| 42 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Markdown content to write</p>
|
| 43 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/types.IMarkdownDumpOptions.html" class="tsd-signature-type tsd-kind-interface">IMarkdownDumpOptions</a></span><div class="tsd-comment tsd-typography"><p>Path and metadata options</p>
|
| 44 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws" class="tsd-anchor"></a>Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Error if stream not initialized or write timeout exceeded</p>
|
| 45 |
+
</div></div><aside class="tsd-sources"><p>Implementation of TMarkdownBase.dump</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16332">types.d.ts:16332</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the JSONL file and write stream.
|
| 46 |
Safe to call multiple times - singleshot ensures one-time execution.</p>
|
| 47 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 48 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMarkdownBase.waitForInit</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16319">types.d.ts:16319</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#_basedir" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_base<wbr/>Dir</span></a><a href="#_filepath" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_file<wbr/>Path</span></a><a href="#_stream" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_stream</span></a><a href="#wait_for_init_symbol" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>[WAIT_<wbr/>FOR_<wbr/>INIT_<wbr/>SYMBOL]</span></a><a href="#write_safe_symbol" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>[WRITE_<wbr/>SAFE_<wbr/>SYMBOL]</span></a><a href="#markdownname" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>markdown<wbr/>Name</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#dump" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>dump</span></a><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 49 |
|
| 50 |
<!-- Yandex.Metrika counter -->
|
| 51 |
<script type="text/javascript">
|
classes/types.MarkdownFolderBase.html
CHANGED
|
@@ -10,22 +10,22 @@
|
|
| 10 |
<p>File format: {options.path}/{options.file}
|
| 11 |
Example: ./dump/backtest/BTCUSDT_my-strategy_binance_2024-Q1_backtest-1736601234567.md</p>
|
| 12 |
<p>Use this adapter (default) for organized report directories and manual review.</p>
|
| 13 |
-
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../types/types.TMarkdownBase.html" class="tsd-signature-type tsd-kind-type-alias">TMarkdownBase</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 14 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.MarkdownFolderBase.html#markdownname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>markdown<wbr/>Name</span></a>
|
| 15 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.MarkdownFolderBase.html#dump" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>dump</span></a>
|
| 16 |
<a href="types.MarkdownFolderBase.html#waitforinit" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a>
|
| 17 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructormarkdownfolderbase" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">MarkdownFolderBase</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">markdownName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">keyof</span> <span class="tsd-signature-type">IMarkdownTarget</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.MarkdownFolderBase.html" class="tsd-signature-type tsd-kind-class">MarkdownFolderBase</a><a href="#constructormarkdownfolderbase" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates a new folder-based markdown adapter instance.</p>
|
| 18 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">markdownName</span>: <span class="tsd-signature-keyword">keyof</span> <span class="tsd-signature-type">IMarkdownTarget</span></span><div class="tsd-comment tsd-typography"><p>Type of markdown report (backtest, live, walker, etc.)</p>
|
| 19 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.MarkdownFolderBase.html" class="tsd-signature-type tsd-kind-class">MarkdownFolderBase</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 20 |
Creates directory structure automatically.
|
| 21 |
File path is determined by options.path and options.file.</p>
|
| 22 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">content</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Markdown content to write</p>
|
| 23 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/types.IMarkdownDumpOptions.html" class="tsd-signature-type tsd-kind-interface">IMarkdownDumpOptions</a></span><div class="tsd-comment tsd-typography"><p>Path and file options for the dump</p>
|
| 24 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws" class="tsd-anchor"></a>Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Error if directory creation or file write fails</p>
|
| 25 |
-
</div></div><aside class="tsd-sources"><p>Implementation of TMarkdownBase.dump</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 26 |
This adapter doesn't need initialization since it uses direct writeFile.</p>
|
| 27 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves immediately</p>
|
| 28 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMarkdownBase.waitForInit</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 29 |
|
| 30 |
<!-- Yandex.Metrika counter -->
|
| 31 |
<script type="text/javascript">
|
|
|
|
| 10 |
<p>File format: {options.path}/{options.file}
|
| 11 |
Example: ./dump/backtest/BTCUSDT_my-strategy_binance_2024-Q1_backtest-1736601234567.md</p>
|
| 12 |
<p>Use this adapter (default) for organized report directories and manual review.</p>
|
| 13 |
+
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../types/types.TMarkdownBase.html" class="tsd-signature-type tsd-kind-type-alias">TMarkdownBase</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16349">types.d.ts:16349</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.MarkdownFolderBase.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 14 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.MarkdownFolderBase.html#markdownname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>markdown<wbr/>Name</span></a>
|
| 15 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.MarkdownFolderBase.html#dump" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>dump</span></a>
|
| 16 |
<a href="types.MarkdownFolderBase.html#waitforinit" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a>
|
| 17 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructormarkdownfolderbase" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">MarkdownFolderBase</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">markdownName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">keyof</span> <span class="tsd-signature-type">IMarkdownTarget</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.MarkdownFolderBase.html" class="tsd-signature-type tsd-kind-class">MarkdownFolderBase</a><a href="#constructormarkdownfolderbase" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates a new folder-based markdown adapter instance.</p>
|
| 18 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">markdownName</span>: <span class="tsd-signature-keyword">keyof</span> <span class="tsd-signature-type">IMarkdownTarget</span></span><div class="tsd-comment tsd-typography"><p>Type of markdown report (backtest, live, walker, etc.)</p>
|
| 19 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.MarkdownFolderBase.html" class="tsd-signature-type tsd-kind-class">MarkdownFolderBase</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16356">types.d.ts:16356</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="markdownname" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>markdown<wbr/>Name</span><a href="#markdownname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">markdownName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">keyof</span> <span class="tsd-signature-type">IMarkdownTarget</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16350">types.d.ts:16350</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="dump" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>dump</span><a href="#dump" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="dump-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">dump</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">content</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/types.IMarkdownDumpOptions.html" class="tsd-signature-type tsd-kind-interface">IMarkdownDumpOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#dump-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Writes markdown content to a separate file.
|
| 20 |
Creates directory structure automatically.
|
| 21 |
File path is determined by options.path and options.file.</p>
|
| 22 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">content</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Markdown content to write</p>
|
| 23 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/types.IMarkdownDumpOptions.html" class="tsd-signature-type tsd-kind-interface">IMarkdownDumpOptions</a></span><div class="tsd-comment tsd-typography"><p>Path and file options for the dump</p>
|
| 24 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws" class="tsd-anchor"></a>Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Error if directory creation or file write fails</p>
|
| 25 |
+
</div></div><aside class="tsd-sources"><p>Implementation of TMarkdownBase.dump</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16373">types.d.ts:16373</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>No-op initialization for folder adapter.
|
| 26 |
This adapter doesn't need initialization since it uses direct writeFile.</p>
|
| 27 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves immediately</p>
|
| 28 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMarkdownBase.waitForInit</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16363">types.d.ts:16363</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#markdownname" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>markdown<wbr/>Name</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#dump" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>dump</span></a><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 29 |
|
| 30 |
<!-- Yandex.Metrika counter -->
|
| 31 |
<script type="text/javascript">
|
classes/types.MemoryBacktestAdapter.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
<li>Memoized instances per (signalId, bucketName) pair; cleared via disposeSignal() from MemoryAdapter</li>
|
| 9 |
</ul>
|
| 10 |
<p>Use this adapter for backtest memory storage.</p>
|
| 11 |
-
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><span class="tsd-signature-type">TMemoryInstance</span></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.MemoryBacktestAdapter.html#clear" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>clear</span></a>
|
| 13 |
<a href="types.MemoryBacktestAdapter.html#disposesignal" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dispose<wbr/>Signal</span></a>
|
| 14 |
<a href="types.MemoryBacktestAdapter.html#listmemory" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>list<wbr/>Memory</span></a>
|
|
@@ -23,37 +23,37 @@
|
|
| 23 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructormemorybacktestadapter" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">MemoryBacktestAdapter</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="types.MemoryBacktestAdapter.html" class="tsd-signature-type tsd-kind-class">MemoryBacktestAdapter</a><a href="#constructormemorybacktestadapter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="types.MemoryBacktestAdapter.html" class="tsd-signature-type tsd-kind-class">MemoryBacktestAdapter</a></h4></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="clear" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>clear</span><a href="#clear" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">clear</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Clears the memoized instance cache.
|
| 24 |
Call this when process.cwd() changes between strategy iterations
|
| 25 |
so new instances are created with the updated base path.</p>
|
| 26 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 27 |
Called by MemoryAdapter when a signal is cancelled or closed.</p>
|
| 28 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier to dispose</p>
|
| 29 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 30 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 31 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 32 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp at which the list is happening (look-ahead guard)</p>
|
| 33 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4><p>Array of all stored entries</p>
|
| 34 |
-
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.listMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 35 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 36 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Unique entry identifier</p>
|
| 37 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 38 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp at which the read is happening (look-ahead guard)</p>
|
| 39 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">></span></h4><p>Entry value</p>
|
| 40 |
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws" class="tsd-anchor"></a>Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Error if entry not found</p>
|
| 41 |
-
</div></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.readMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 42 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.removeMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 43 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">query</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">settings</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">SearchSettings</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">score</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">query</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">settings</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">SearchSettings</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 44 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">query</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Search query string</p>
|
| 45 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">settings</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">SearchSettings</span></h5></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 46 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp at which the search is happening (look-ahead guard)</p>
|
| 47 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">score</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4><p>Matching entries sorted by relevance score</p>
|
| 48 |
-
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.searchMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 49 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 50 |
All data lives in process memory only.</p>
|
| 51 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 52 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">Ctor</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.TMemoryInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TMemoryInstanceCtor</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">Ctor</span>: <a href="../types/types.TMemoryInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TMemoryInstanceCtor</a></span><div class="tsd-comment tsd-typography"><p>Constructor for the custom memory instance</p>
|
| 53 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 54 |
Data is persisted to ./dump/memory/<signalId>/<bucketName>/.</p>
|
| 55 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 56 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.writeMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 57 |
|
| 58 |
<!-- Yandex.Metrika counter -->
|
| 59 |
<script type="text/javascript">
|
|
|
|
| 8 |
<li>Memoized instances per (signalId, bucketName) pair; cleared via disposeSignal() from MemoryAdapter</li>
|
| 9 |
</ul>
|
| 10 |
<p>Use this adapter for backtest memory storage.</p>
|
| 11 |
+
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><span class="tsd-signature-type">TMemoryInstance</span></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25076">types.d.ts:25076</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.MemoryBacktestAdapter.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.MemoryBacktestAdapter.html#clear" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>clear</span></a>
|
| 13 |
<a href="types.MemoryBacktestAdapter.html#disposesignal" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dispose<wbr/>Signal</span></a>
|
| 14 |
<a href="types.MemoryBacktestAdapter.html#listmemory" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>list<wbr/>Memory</span></a>
|
|
|
|
| 23 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructormemorybacktestadapter" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">MemoryBacktestAdapter</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="types.MemoryBacktestAdapter.html" class="tsd-signature-type tsd-kind-class">MemoryBacktestAdapter</a><a href="#constructormemorybacktestadapter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="types.MemoryBacktestAdapter.html" class="tsd-signature-type tsd-kind-class">MemoryBacktestAdapter</a></h4></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="clear" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>clear</span><a href="#clear" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">clear</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Clears the memoized instance cache.
|
| 24 |
Call this when process.cwd() changes between strategy iterations
|
| 25 |
so new instances are created with the updated base path.</p>
|
| 26 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25188">types.d.ts:25188</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="disposesignal" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>dispose<wbr/>Signal</span><a href="#disposesignal" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">disposeSignal</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Disposes all memoized instances for the given signalId.
|
| 27 |
Called by MemoryAdapter when a signal is cancelled or closed.</p>
|
| 28 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier to dispose</p>
|
| 29 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25084">types.d.ts:25084</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="listmemory" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>list<wbr/>Memory</span><a href="#listmemory" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">listMemory</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>List all entries in memory.</p>
|
| 30 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 31 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 32 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp at which the list is happening (look-ahead guard)</p>
|
| 33 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4><p>Array of all stored entries</p>
|
| 34 |
+
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.listMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25128">types.d.ts:25128</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="readmemory" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>read<wbr/>Memory</span><a href="#readmemory" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">readMemory</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>Read a single entry from memory.</p>
|
| 35 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 36 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Unique entry identifier</p>
|
| 37 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 38 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp at which the read is happening (look-ahead guard)</p>
|
| 39 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">></span></h4><p>Entry value</p>
|
| 40 |
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws" class="tsd-anchor"></a>Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Error if entry not found</p>
|
| 41 |
+
</div></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.readMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25158">types.d.ts:25158</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="removememory" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>remove<wbr/>Memory</span><a href="#removememory" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">removeMemory</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>Remove an entry from memory.</p>
|
| 42 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.removeMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25143">types.d.ts:25143</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="searchmemory" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>search<wbr/>Memory</span><a href="#searchmemory" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">searchMemory</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">query</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">settings</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">SearchSettings</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">score</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>Search memory using BM25 full-text scoring.</p>
|
| 43 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">query</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">settings</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">SearchSettings</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">score</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">query</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">settings</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">SearchSettings</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 44 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">query</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Search query string</p>
|
| 45 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">settings</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">SearchSettings</span></h5></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 46 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp at which the search is happening (look-ahead guard)</p>
|
| 47 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">score</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4><p>Matching entries sorted by relevance score</p>
|
| 48 |
+
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.searchMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25110">types.d.ts:25110</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="usedummy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>use<wbr/>Dummy</span><a href="#usedummy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">useDummy</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Switches to dummy adapter that discards all writes.</p>
|
| 49 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25177">types.d.ts:25177</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="uselocal" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>use<wbr/>Local</span><a href="#uselocal" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">useLocal</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Switches to in-memory BM25 adapter (default).
|
| 50 |
All data lives in process memory only.</p>
|
| 51 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25168">types.d.ts:25168</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="usememoryadapter" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>use<wbr/>Memory<wbr/>Adapter</span><a href="#usememoryadapter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">useMemoryAdapter</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">Ctor</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.TMemoryInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TMemoryInstanceCtor</a><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Switches to a custom memory adapter implementation.</p>
|
| 52 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">Ctor</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.TMemoryInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TMemoryInstanceCtor</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">Ctor</span>: <a href="../types/types.TMemoryInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TMemoryInstanceCtor</a></span><div class="tsd-comment tsd-typography"><p>Constructor for the custom memory instance</p>
|
| 53 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25182">types.d.ts:25182</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="usepersist" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>use<wbr/>Persist</span><a href="#usepersist" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">usePersist</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Switches to file-system backed adapter.
|
| 54 |
Data is persisted to ./dump/memory/<signalId>/<bucketName>/.</p>
|
| 55 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25173">types.d.ts:25173</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="writememory" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write<wbr/>Memory</span><a href="#writememory" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">writeMemory</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">description</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">value</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>Write a value to memory.</p>
|
| 56 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.writeMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25094">types.d.ts:25094</a></li></ul></aside></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#clear" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>clear</span></a><a href="#disposesignal" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dispose<wbr/>Signal</span></a><a href="#listmemory" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>list<wbr/>Memory</span></a><a href="#readmemory" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>read<wbr/>Memory</span></a><a href="#removememory" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>remove<wbr/>Memory</span></a><a href="#searchmemory" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>search<wbr/>Memory</span></a><a href="#usedummy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use<wbr/>Dummy</span></a><a href="#uselocal" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use<wbr/>Local</span></a><a href="#usememoryadapter" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use<wbr/>Memory<wbr/>Adapter</span></a><a href="#usepersist" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use<wbr/>Persist</span></a><a href="#writememory" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>write<wbr/>Memory</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 57 |
|
| 58 |
<!-- Yandex.Metrika counter -->
|
| 59 |
<script type="text/javascript">
|
classes/types.MemoryLiveAdapter.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
<li>Memoized instances per (signalId, bucketName) pair; cleared via disposeSignal() from MemoryAdapter</li>
|
| 9 |
</ul>
|
| 10 |
<p>Use this adapter for live trading memory storage.</p>
|
| 11 |
-
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><span class="tsd-signature-type">TMemoryInstance</span></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.MemoryLiveAdapter.html#clear" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>clear</span></a>
|
| 13 |
<a href="types.MemoryLiveAdapter.html#disposesignal" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dispose<wbr/>Signal</span></a>
|
| 14 |
<a href="types.MemoryLiveAdapter.html#listmemory" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>list<wbr/>Memory</span></a>
|
|
@@ -23,37 +23,37 @@
|
|
| 23 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructormemoryliveadapter" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">MemoryLiveAdapter</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="types.MemoryLiveAdapter.html" class="tsd-signature-type tsd-kind-class">MemoryLiveAdapter</a><a href="#constructormemoryliveadapter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="types.MemoryLiveAdapter.html" class="tsd-signature-type tsd-kind-class">MemoryLiveAdapter</a></h4></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="clear" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>clear</span><a href="#clear" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">clear</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Clears the memoized instance cache.
|
| 24 |
Call this when process.cwd() changes between strategy iterations
|
| 25 |
so new instances are created with the updated base path.</p>
|
| 26 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 27 |
Called by MemoryAdapter when a signal is cancelled or closed.</p>
|
| 28 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier to dispose</p>
|
| 29 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 30 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 31 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 32 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp at which the list is happening (look-ahead guard)</p>
|
| 33 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4><p>Array of all stored entries</p>
|
| 34 |
-
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.listMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 35 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 36 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Unique entry identifier</p>
|
| 37 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 38 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp at which the read is happening (look-ahead guard)</p>
|
| 39 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">></span></h4><p>Entry value</p>
|
| 40 |
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws" class="tsd-anchor"></a>Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Error if entry not found</p>
|
| 41 |
-
</div></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.readMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 42 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.removeMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 43 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">query</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">settings</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">SearchSettings</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">score</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">query</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">settings</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">SearchSettings</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 44 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">query</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Search query string</p>
|
| 45 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">settings</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">SearchSettings</span></h5></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 46 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp at which the search is happening (look-ahead guard)</p>
|
| 47 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">score</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4><p>Matching entries sorted by relevance score</p>
|
| 48 |
-
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.searchMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 49 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 50 |
All data lives in process memory only.</p>
|
| 51 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 52 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">Ctor</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.TMemoryInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TMemoryInstanceCtor</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">Ctor</span>: <a href="../types/types.TMemoryInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TMemoryInstanceCtor</a></span><div class="tsd-comment tsd-typography"><p>Constructor for the custom memory instance</p>
|
| 53 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 54 |
Data is persisted to ./dump/memory/<signalId>/<bucketName>/.</p>
|
| 55 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 56 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.writeMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 57 |
|
| 58 |
<!-- Yandex.Metrika counter -->
|
| 59 |
<script type="text/javascript">
|
|
|
|
| 8 |
<li>Memoized instances per (signalId, bucketName) pair; cleared via disposeSignal() from MemoryAdapter</li>
|
| 9 |
</ul>
|
| 10 |
<p>Use this adapter for live trading memory storage.</p>
|
| 11 |
+
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><span class="tsd-signature-type">TMemoryInstance</span></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25202">types.d.ts:25202</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.MemoryLiveAdapter.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.MemoryLiveAdapter.html#clear" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>clear</span></a>
|
| 13 |
<a href="types.MemoryLiveAdapter.html#disposesignal" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dispose<wbr/>Signal</span></a>
|
| 14 |
<a href="types.MemoryLiveAdapter.html#listmemory" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>list<wbr/>Memory</span></a>
|
|
|
|
| 23 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructormemoryliveadapter" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">MemoryLiveAdapter</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="types.MemoryLiveAdapter.html" class="tsd-signature-type tsd-kind-class">MemoryLiveAdapter</a><a href="#constructormemoryliveadapter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="types.MemoryLiveAdapter.html" class="tsd-signature-type tsd-kind-class">MemoryLiveAdapter</a></h4></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="clear" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>clear</span><a href="#clear" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">clear</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Clears the memoized instance cache.
|
| 24 |
Call this when process.cwd() changes between strategy iterations
|
| 25 |
so new instances are created with the updated base path.</p>
|
| 26 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25314">types.d.ts:25314</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="disposesignal" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>dispose<wbr/>Signal</span><a href="#disposesignal" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">disposeSignal</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Disposes all memoized instances for the given signalId.
|
| 27 |
Called by MemoryAdapter when a signal is cancelled or closed.</p>
|
| 28 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier to dispose</p>
|
| 29 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25210">types.d.ts:25210</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="listmemory" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>list<wbr/>Memory</span><a href="#listmemory" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">listMemory</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>List all entries in memory.</p>
|
| 30 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 31 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 32 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp at which the list is happening (look-ahead guard)</p>
|
| 33 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4><p>Array of all stored entries</p>
|
| 34 |
+
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.listMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25254">types.d.ts:25254</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="readmemory" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>read<wbr/>Memory</span><a href="#readmemory" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">readMemory</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>Read a single entry from memory.</p>
|
| 35 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 36 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Unique entry identifier</p>
|
| 37 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 38 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp at which the read is happening (look-ahead guard)</p>
|
| 39 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">></span></h4><p>Entry value</p>
|
| 40 |
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws" class="tsd-anchor"></a>Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Error if entry not found</p>
|
| 41 |
+
</div></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.readMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25284">types.d.ts:25284</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="removememory" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>remove<wbr/>Memory</span><a href="#removememory" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">removeMemory</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>Remove an entry from memory.</p>
|
| 42 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.removeMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25269">types.d.ts:25269</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="searchmemory" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>search<wbr/>Memory</span><a href="#searchmemory" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">searchMemory</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">query</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">settings</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">SearchSettings</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">score</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>Search memory using BM25 full-text scoring.</p>
|
| 43 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">query</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">settings</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">SearchSettings</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">score</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">query</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">settings</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">SearchSettings</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 44 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">query</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Search query string</p>
|
| 45 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">settings</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">SearchSettings</span></h5></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 46 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp at which the search is happening (look-ahead guard)</p>
|
| 47 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">content</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">score</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4><p>Matching entries sorted by relevance score</p>
|
| 48 |
+
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.searchMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25236">types.d.ts:25236</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="usedummy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>use<wbr/>Dummy</span><a href="#usedummy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">useDummy</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Switches to dummy adapter that discards all writes.</p>
|
| 49 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25303">types.d.ts:25303</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="uselocal" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>use<wbr/>Local</span><a href="#uselocal" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">useLocal</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Switches to in-memory BM25 adapter.
|
| 50 |
All data lives in process memory only.</p>
|
| 51 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25294">types.d.ts:25294</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="usememoryadapter" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>use<wbr/>Memory<wbr/>Adapter</span><a href="#usememoryadapter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">useMemoryAdapter</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">Ctor</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.TMemoryInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TMemoryInstanceCtor</a><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Switches to a custom memory adapter implementation.</p>
|
| 52 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">Ctor</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.TMemoryInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TMemoryInstanceCtor</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">Ctor</span>: <a href="../types/types.TMemoryInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TMemoryInstanceCtor</a></span><div class="tsd-comment tsd-typography"><p>Constructor for the custom memory instance</p>
|
| 53 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25308">types.d.ts:25308</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="usepersist" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>use<wbr/>Persist</span><a href="#usepersist" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">usePersist</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Switches to file-system backed adapter (default).
|
| 54 |
Data is persisted to ./dump/memory/<signalId>/<bucketName>/.</p>
|
| 55 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25299">types.d.ts:25299</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="writememory" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write<wbr/>Memory</span><a href="#writememory" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">writeMemory</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">description</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">value</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">T</a><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>Write a value to memory.</p>
|
| 56 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TMemoryInstance.writeMemory</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L25220">types.d.ts:25220</a></li></ul></aside></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#clear" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>clear</span></a><a href="#disposesignal" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dispose<wbr/>Signal</span></a><a href="#listmemory" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>list<wbr/>Memory</span></a><a href="#readmemory" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>read<wbr/>Memory</span></a><a href="#removememory" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>remove<wbr/>Memory</span></a><a href="#searchmemory" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>search<wbr/>Memory</span></a><a href="#usedummy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use<wbr/>Dummy</span></a><a href="#uselocal" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use<wbr/>Local</span></a><a href="#usememoryadapter" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use<wbr/>Memory<wbr/>Adapter</span></a><a href="#usepersist" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use<wbr/>Persist</span></a><a href="#writememory" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>write<wbr/>Memory</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 57 |
|
| 58 |
<!-- Yandex.Metrika counter -->
|
| 59 |
<script type="text/javascript">
|
classes/types.Performance.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-5">import</span><span class="hl-1"> { </span><span class="hl-4">Performance</span><span class="hl-1">, </span><span class="hl-4">listenPerformance</span><span class="hl-1"> } </span><span class="hl-5">from</span><span class="hl-1"> </span><span class="hl-2">"backtest-kit"</span><span class="hl-1">;</span><br/><br/><span class="hl-6">// Subscribe to performance events</span><br/><span class="hl-0">listenPerformance</span><span class="hl-1">((</span><span class="hl-4">event</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">`</span><span class="hl-3">${</span><span class="hl-4">event</span><span class="hl-9">.</span><span class="hl-4">metricType</span><span class="hl-3">}</span><span class="hl-2">: </span><span class="hl-3">${</span><span class="hl-4">event</span><span class="hl-9">.</span><span class="hl-4">duration</span><span class="hl-9">.</span><span class="hl-0">toFixed</span><span class="hl-9">(</span><span class="hl-7">2</span><span class="hl-9">)</span><span class="hl-3">}</span><span class="hl-2">ms`</span><span class="hl-1">);</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-6">// Run bt...</span><br/><br/><span class="hl-6">// Get aggregated statistics</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">stats</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">Performance</span><span class="hl-1">.</span><span class="hl-0">getData</span><span class="hl-1">(</span><span class="hl-2">"my-strategy"</span><span class="hl-1">);</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">"Total time:"</span><span class="hl-1">, </span><span class="hl-4">stats</span><span class="hl-1">.</span><span class="hl-4">totalDuration</span><span class="hl-1">);</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">"Slowest operations:"</span><span class="hl-1">, </span><span class="hl-4">Object</span><span class="hl-1">.</span><span class="hl-0">values</span><span class="hl-1">(</span><span class="hl-4">stats</span><span class="hl-1">.</span><span class="hl-4">metricStats</span><span class="hl-1">)</span><br/><span class="hl-1"> .</span><span class="hl-0">sort</span><span class="hl-1">((</span><span class="hl-4">a</span><span class="hl-1">, </span><span class="hl-4">b</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-4">b</span><span class="hl-1">.</span><span class="hl-4">avgDuration</span><span class="hl-1"> - </span><span class="hl-4">a</span><span class="hl-1">.</span><span class="hl-4">avgDuration</span><span class="hl-1">)</span><br/><span class="hl-1"> .</span><span class="hl-0">slice</span><span class="hl-1">(</span><span class="hl-7">0</span><span class="hl-1">, </span><span class="hl-7">5</span><span class="hl-1">));</span><br/><br/><span class="hl-6">// Generate and save report</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">Performance</span><span class="hl-1">.</span><span class="hl-0">dump</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">);</span>
|
| 10 |
</code><button type="button">Copy</button></pre>
|
| 11 |
|
| 12 |
-
</div></div></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 13 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.Performance.html#dump" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>dump</span></a>
|
| 14 |
<a href="types.Performance.html#getdata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Data</span></a>
|
| 15 |
<a href="types.Performance.html#getreport" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Report</span></a>
|
|
@@ -22,7 +22,7 @@ Default path: ./dump/performance/{strategyName}.md</p>
|
|
| 22 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-1" class="tsd-anchor"></a>Example<a href="#example-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-6">// Save to default path: ./dump/performance/my-strategy.md</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">Performance</span><span class="hl-1">.</span><span class="hl-0">dump</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Save to custom path: ./reports/perf/my-strategy.md</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">Performance</span><span class="hl-1">.</span><span class="hl-0">dump</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">, </span><span class="hl-2">"./reports/perf"</span><span class="hl-1">);</span>
|
| 23 |
</code><button type="button">Copy</button></pre>
|
| 24 |
|
| 25 |
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 26 |
<p>Returns detailed metrics grouped by operation type:</p>
|
| 27 |
<ul>
|
| 28 |
<li>Count, total duration, average, min, max</li>
|
|
@@ -34,7 +34,7 @@ Default path: ./dump/performance/{strategyName}.md</p>
|
|
| 34 |
<div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-2" class="tsd-anchor"></a>Example<a href="#example-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">stats</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">Performance</span><span class="hl-1">.</span><span class="hl-0">getData</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Find slowest operation type</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">slowest</span><span class="hl-1"> = </span><span class="hl-4">Object</span><span class="hl-1">.</span><span class="hl-0">values</span><span class="hl-1">(</span><span class="hl-4">stats</span><span class="hl-1">.</span><span class="hl-4">metricStats</span><span class="hl-1">)</span><br/><span class="hl-1"> .</span><span class="hl-0">sort</span><span class="hl-1">((</span><span class="hl-4">a</span><span class="hl-1">, </span><span class="hl-4">b</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-4">b</span><span class="hl-1">.</span><span class="hl-4">avgDuration</span><span class="hl-1"> - </span><span class="hl-4">a</span><span class="hl-1">.</span><span class="hl-4">avgDuration</span><span class="hl-1">)[</span><span class="hl-7">0</span><span class="hl-1">];</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">`Slowest: </span><span class="hl-3">${</span><span class="hl-4">slowest</span><span class="hl-9">.</span><span class="hl-4">metricType</span><span class="hl-3">}</span><span class="hl-2"> (</span><span class="hl-3">${</span><span class="hl-4">slowest</span><span class="hl-9">.</span><span class="hl-4">avgDuration</span><span class="hl-9">.</span><span class="hl-0">toFixed</span><span class="hl-9">(</span><span class="hl-7">2</span><span class="hl-9">)</span><span class="hl-3">}</span><span class="hl-2">ms avg)`</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Check for outliers</span><br/><span class="hl-5">for</span><span class="hl-1"> (</span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">metric</span><span class="hl-1"> </span><span class="hl-3">of</span><span class="hl-1"> </span><span class="hl-4">Object</span><span class="hl-1">.</span><span class="hl-0">values</span><span class="hl-1">(</span><span class="hl-4">stats</span><span class="hl-1">.</span><span class="hl-4">metricStats</span><span class="hl-1">)) {</span><br/><span class="hl-1"> </span><span class="hl-5">if</span><span class="hl-1"> (</span><span class="hl-4">metric</span><span class="hl-1">.</span><span class="hl-4">p99</span><span class="hl-1"> > </span><span class="hl-4">metric</span><span class="hl-1">.</span><span class="hl-4">avgDuration</span><span class="hl-1"> * </span><span class="hl-7">5</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">warn</span><span class="hl-1">(</span><span class="hl-2">`High variance in </span><span class="hl-3">${</span><span class="hl-4">metric</span><span class="hl-9">.</span><span class="hl-4">metricType</span><span class="hl-3">}</span><span class="hl-2">: P99=</span><span class="hl-3">${</span><span class="hl-4">metric</span><span class="hl-9">.</span><span class="hl-4">p99</span><span class="hl-3">}</span><span class="hl-2">ms, Avg=</span><span class="hl-3">${</span><span class="hl-4">metric</span><span class="hl-9">.</span><span class="hl-4">avgDuration</span><span class="hl-3">}</span><span class="hl-2">ms`</span><span class="hl-1">);</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span>
|
| 35 |
</code><button type="button">Copy</button></pre>
|
| 36 |
|
| 37 |
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 38 |
<p>Report includes:</p>
|
| 39 |
<ul>
|
| 40 |
<li>Time distribution across operation types</li>
|
|
@@ -47,7 +47,7 @@ Default path: ./dump/performance/{strategyName}.md</p>
|
|
| 47 |
<div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-3" class="tsd-anchor"></a>Example<a href="#example-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">markdown</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">Performance</span><span class="hl-1">.</span><span class="hl-0">getReport</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">);</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-4">markdown</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Or save to file</span><br/><span class="hl-5">import</span><span class="hl-1"> </span><span class="hl-4">fs</span><span class="hl-1"> </span><span class="hl-5">from</span><span class="hl-1"> </span><span class="hl-2">"fs/promises"</span><span class="hl-1">;</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">fs</span><span class="hl-1">.</span><span class="hl-0">writeFile</span><span class="hl-1">(</span><span class="hl-2">"performance-report.md"</span><span class="hl-1">, </span><span class="hl-4">markdown</span><span class="hl-1">);</span>
|
| 48 |
</code><button type="button">Copy</button></pre>
|
| 49 |
|
| 50 |
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 51 |
|
| 52 |
<!-- Yandex.Metrika counter -->
|
| 53 |
<script type="text/javascript">
|
|
|
|
| 9 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-5">import</span><span class="hl-1"> { </span><span class="hl-4">Performance</span><span class="hl-1">, </span><span class="hl-4">listenPerformance</span><span class="hl-1"> } </span><span class="hl-5">from</span><span class="hl-1"> </span><span class="hl-2">"backtest-kit"</span><span class="hl-1">;</span><br/><br/><span class="hl-6">// Subscribe to performance events</span><br/><span class="hl-0">listenPerformance</span><span class="hl-1">((</span><span class="hl-4">event</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">`</span><span class="hl-3">${</span><span class="hl-4">event</span><span class="hl-9">.</span><span class="hl-4">metricType</span><span class="hl-3">}</span><span class="hl-2">: </span><span class="hl-3">${</span><span class="hl-4">event</span><span class="hl-9">.</span><span class="hl-4">duration</span><span class="hl-9">.</span><span class="hl-0">toFixed</span><span class="hl-9">(</span><span class="hl-7">2</span><span class="hl-9">)</span><span class="hl-3">}</span><span class="hl-2">ms`</span><span class="hl-1">);</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-6">// Run bt...</span><br/><br/><span class="hl-6">// Get aggregated statistics</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">stats</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">Performance</span><span class="hl-1">.</span><span class="hl-0">getData</span><span class="hl-1">(</span><span class="hl-2">"my-strategy"</span><span class="hl-1">);</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">"Total time:"</span><span class="hl-1">, </span><span class="hl-4">stats</span><span class="hl-1">.</span><span class="hl-4">totalDuration</span><span class="hl-1">);</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">"Slowest operations:"</span><span class="hl-1">, </span><span class="hl-4">Object</span><span class="hl-1">.</span><span class="hl-0">values</span><span class="hl-1">(</span><span class="hl-4">stats</span><span class="hl-1">.</span><span class="hl-4">metricStats</span><span class="hl-1">)</span><br/><span class="hl-1"> .</span><span class="hl-0">sort</span><span class="hl-1">((</span><span class="hl-4">a</span><span class="hl-1">, </span><span class="hl-4">b</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-4">b</span><span class="hl-1">.</span><span class="hl-4">avgDuration</span><span class="hl-1"> - </span><span class="hl-4">a</span><span class="hl-1">.</span><span class="hl-4">avgDuration</span><span class="hl-1">)</span><br/><span class="hl-1"> .</span><span class="hl-0">slice</span><span class="hl-1">(</span><span class="hl-7">0</span><span class="hl-1">, </span><span class="hl-7">5</span><span class="hl-1">));</span><br/><br/><span class="hl-6">// Generate and save report</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">Performance</span><span class="hl-1">.</span><span class="hl-0">dump</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">);</span>
|
| 10 |
</code><button type="button">Copy</button></pre>
|
| 11 |
|
| 12 |
+
</div></div></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L20838">types.d.ts:20838</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.Performance.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 13 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.Performance.html#dump" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>dump</span></a>
|
| 14 |
<a href="types.Performance.html#getdata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Data</span></a>
|
| 15 |
<a href="types.Performance.html#getreport" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Report</span></a>
|
|
|
|
| 22 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-1" class="tsd-anchor"></a>Example<a href="#example-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-6">// Save to default path: ./dump/performance/my-strategy.md</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">Performance</span><span class="hl-1">.</span><span class="hl-0">dump</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Save to custom path: ./reports/perf/my-strategy.md</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">Performance</span><span class="hl-1">.</span><span class="hl-0">dump</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">, </span><span class="hl-2">"./reports/perf"</span><span class="hl-1">);</span>
|
| 23 |
</code><button type="button">Copy</button></pre>
|
| 24 |
|
| 25 |
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L20921">types.d.ts:20921</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="getdata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>get<wbr/>Data</span><a href="#getdata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="getdata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">getData</span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">symbol</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">context</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">exchangeName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">frameName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">strategyName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">backtest</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.PerformanceStatisticsModel.html" class="tsd-signature-type tsd-kind-interface">PerformanceStatisticsModel</a><span class="tsd-signature-symbol">></span><a href="#getdata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets aggregated performance statistics for a symbol-strategy pair.</p>
|
| 26 |
<p>Returns detailed metrics grouped by operation type:</p>
|
| 27 |
<ul>
|
| 28 |
<li>Count, total duration, average, min, max</li>
|
|
|
|
| 34 |
<div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-2" class="tsd-anchor"></a>Example<a href="#example-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">stats</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">Performance</span><span class="hl-1">.</span><span class="hl-0">getData</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Find slowest operation type</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">slowest</span><span class="hl-1"> = </span><span class="hl-4">Object</span><span class="hl-1">.</span><span class="hl-0">values</span><span class="hl-1">(</span><span class="hl-4">stats</span><span class="hl-1">.</span><span class="hl-4">metricStats</span><span class="hl-1">)</span><br/><span class="hl-1"> .</span><span class="hl-0">sort</span><span class="hl-1">((</span><span class="hl-4">a</span><span class="hl-1">, </span><span class="hl-4">b</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-4">b</span><span class="hl-1">.</span><span class="hl-4">avgDuration</span><span class="hl-1"> - </span><span class="hl-4">a</span><span class="hl-1">.</span><span class="hl-4">avgDuration</span><span class="hl-1">)[</span><span class="hl-7">0</span><span class="hl-1">];</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">`Slowest: </span><span class="hl-3">${</span><span class="hl-4">slowest</span><span class="hl-9">.</span><span class="hl-4">metricType</span><span class="hl-3">}</span><span class="hl-2"> (</span><span class="hl-3">${</span><span class="hl-4">slowest</span><span class="hl-9">.</span><span class="hl-4">avgDuration</span><span class="hl-9">.</span><span class="hl-0">toFixed</span><span class="hl-9">(</span><span class="hl-7">2</span><span class="hl-9">)</span><span class="hl-3">}</span><span class="hl-2">ms avg)`</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Check for outliers</span><br/><span class="hl-5">for</span><span class="hl-1"> (</span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">metric</span><span class="hl-1"> </span><span class="hl-3">of</span><span class="hl-1"> </span><span class="hl-4">Object</span><span class="hl-1">.</span><span class="hl-0">values</span><span class="hl-1">(</span><span class="hl-4">stats</span><span class="hl-1">.</span><span class="hl-4">metricStats</span><span class="hl-1">)) {</span><br/><span class="hl-1"> </span><span class="hl-5">if</span><span class="hl-1"> (</span><span class="hl-4">metric</span><span class="hl-1">.</span><span class="hl-4">p99</span><span class="hl-1"> > </span><span class="hl-4">metric</span><span class="hl-1">.</span><span class="hl-4">avgDuration</span><span class="hl-1"> * </span><span class="hl-7">5</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">warn</span><span class="hl-1">(</span><span class="hl-2">`High variance in </span><span class="hl-3">${</span><span class="hl-4">metric</span><span class="hl-9">.</span><span class="hl-4">metricType</span><span class="hl-3">}</span><span class="hl-2">: P99=</span><span class="hl-3">${</span><span class="hl-4">metric</span><span class="hl-9">.</span><span class="hl-4">p99</span><span class="hl-3">}</span><span class="hl-2">ms, Avg=</span><span class="hl-3">${</span><span class="hl-4">metric</span><span class="hl-9">.</span><span class="hl-4">avgDuration</span><span class="hl-3">}</span><span class="hl-2">ms`</span><span class="hl-1">);</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span>
|
| 35 |
</code><button type="button">Copy</button></pre>
|
| 36 |
|
| 37 |
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L20868">types.d.ts:20868</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="getreport" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>get<wbr/>Report</span><a href="#getreport" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="getreport-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">getReport</span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">symbol</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">context</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">exchangeName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">frameName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">strategyName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">backtest</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">columns</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">Columns$8</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span><a href="#getreport-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Generates markdown report with performance analysis.</p>
|
| 38 |
<p>Report includes:</p>
|
| 39 |
<ul>
|
| 40 |
<li>Time distribution across operation types</li>
|
|
|
|
| 47 |
<div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example-3" class="tsd-anchor"></a>Example<a href="#example-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">markdown</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">Performance</span><span class="hl-1">.</span><span class="hl-0">getReport</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">);</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-4">markdown</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Or save to file</span><br/><span class="hl-5">import</span><span class="hl-1"> </span><span class="hl-4">fs</span><span class="hl-1"> </span><span class="hl-5">from</span><span class="hl-1"> </span><span class="hl-2">"fs/promises"</span><span class="hl-1">;</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">fs</span><span class="hl-1">.</span><span class="hl-0">writeFile</span><span class="hl-1">(</span><span class="hl-2">"performance-report.md"</span><span class="hl-1">, </span><span class="hl-4">markdown</span><span class="hl-1">);</span>
|
| 48 |
</code><button type="button">Copy</button></pre>
|
| 49 |
|
| 50 |
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L20896">types.d.ts:20896</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#dump" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>dump</span></a><a href="#getdata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Data</span></a><a href="#getreport" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Report</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 51 |
|
| 52 |
<!-- Yandex.Metrika counter -->
|
| 53 |
<script type="text/javascript">
|
classes/types.PersistBase.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">persist</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistBase</span><span class="hl-1">(</span><span class="hl-2">"my-entity"</span><span class="hl-1">, </span><span class="hl-2">"./data"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">persist</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">persist</span><span class="hl-1">.</span><span class="hl-0">writeValue</span><span class="hl-1">(</span><span class="hl-2">"key1"</span><span class="hl-1">, { </span><span class="hl-4">data:</span><span class="hl-1"> </span><span class="hl-2">"value"</span><span class="hl-1"> });</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">value</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">persist</span><span class="hl-1">.</span><span class="hl-0">readValue</span><span class="hl-1">(</span><span class="hl-2">"key1"</span><span class="hl-1">);</span>
|
| 10 |
</code><button type="button">Copy</button></pre>
|
| 11 |
|
| 12 |
-
</div></div></section> <section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="entityname" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">EntityName</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">string</span> = <span class="tsd-signature-type">string</span></span></li></ul></section> <section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistBase.html" class="tsd-signature-type tsd-kind-interface">IPersistBase</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 13 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistBase.html#_directory" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_directory</span></a>
|
| 14 |
<a href="types.PersistBase.html#base_wait_for_init_symbol" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>[BASE_<wbr/>WAIT_<wbr/>FOR_<wbr/>INIT_<wbr/>SYMBOL]</span></a>
|
| 15 |
<a href="types.PersistBase.html#basedir" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>base<wbr/>Dir</span></a>
|
|
@@ -23,32 +23,32 @@
|
|
| 23 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorpersistbase" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">PersistBase</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="types.PersistBase.html#constructorpersistbaseentityname">EntityName</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">entityName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="types.PersistBase.html#constructorpersistbaseentityname">EntityName</a><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">baseDir</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.PersistBase.html" class="tsd-signature-type tsd-kind-class">PersistBase</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="types.PersistBase.html#constructorpersistbaseentityname">EntityName</a><span class="tsd-signature-symbol">></span><a href="#constructorpersistbase" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates new persistence instance.</p>
|
| 24 |
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="constructorpersistbaseentityname" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">EntityName</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">string</span> = <span class="tsd-signature-type">string</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">entityName</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="types.PersistBase.html#constructorpersistbaseentityname">EntityName</a></span><div class="tsd-comment tsd-typography"><p>Unique entity type identifier</p>
|
| 25 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">baseDir</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Base directory for all entities (default: ./dump/data)</p>
|
| 26 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistBase.html" class="tsd-signature-type tsd-kind-class">PersistBase</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="types.PersistBase.html#constructorpersistbaseentityname">EntityName</a><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 27 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 28 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">entityId</span>: <a href="../types/types.EntityId.html" class="tsd-signature-type tsd-kind-type-alias">EntityId</a></span><div class="tsd-comment tsd-typography"><p>Entity identifier</p>
|
| 29 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><p>Full file path to entity JSON file</p>
|
| 30 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 31 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">entityId</span>: <a href="../types/types.EntityId.html" class="tsd-signature-type tsd-kind-type-alias">EntityId</a></span><div class="tsd-comment tsd-typography"><p>Unique entity identifier</p>
|
| 32 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to true if exists, false otherwise</p>
|
| 33 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistBase.html">IPersistBase</a>.<a href="../interfaces/types.IPersistBase.html#hasvalue">hasValue</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 34 |
Sorted alphanumerically.
|
| 35 |
Used internally by waitForInit for validation.</p>
|
| 36 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">AsyncGenerator</span><span class="tsd-signature-symbol"><</span><a href="../types/types.EntityId.html" class="tsd-signature-type tsd-kind-type-alias">EntityId</a><span class="tsd-signature-symbol">></span></h4><p>AsyncGenerator yielding entity IDs</p>
|
| 37 |
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws" class="tsd-anchor"></a>Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Error if reading fails</p>
|
| 38 |
-
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistBase.html">IPersistBase</a>.<a href="../interfaces/types.IPersistBase.html#keys">keys</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 39 |
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="readvaluet" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">IEntity</span> = <span class="tsd-signature-type">IEntity</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">entityId</span>: <a href="../types/types.EntityId.html" class="tsd-signature-type tsd-kind-type-alias">EntityId</a></span><div class="tsd-comment tsd-typography"><p>Unique entity identifier</p>
|
| 40 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="types.PersistBase.html#readvaluet">T</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to entity data</p>
|
| 41 |
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws-1" class="tsd-anchor"></a>Throws<a href="#throws-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Error if entity not found or read fails</p>
|
| 42 |
-
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistBase.html">IPersistBase</a>.<a href="../interfaces/types.IPersistBase.html#readvalue">readValue</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 43 |
Uses singleshot to ensure one-time execution.</p>
|
| 44 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 45 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 46 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistBase.html">IPersistBase</a>.<a href="../interfaces/types.IPersistBase.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 47 |
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="writevaluet" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">IEntity</span> = <span class="tsd-signature-type">IEntity</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">entityId</span>: <a href="../types/types.EntityId.html" class="tsd-signature-type tsd-kind-type-alias">EntityId</a></span><div class="tsd-comment tsd-typography"><p>Unique entity identifier</p>
|
| 48 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">entity</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="types.PersistBase.html#writevaluet">T</a></span><div class="tsd-comment tsd-typography"><p>Entity data to persist</p>
|
| 49 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 50 |
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws-2" class="tsd-anchor"></a>Throws<a href="#throws-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Error if write fails</p>
|
| 51 |
-
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistBase.html">IPersistBase</a>.<a href="../interfaces/types.IPersistBase.html#writevalue">writeValue</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 52 |
|
| 53 |
<!-- Yandex.Metrika counter -->
|
| 54 |
<script type="text/javascript">
|
|
|
|
| 9 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">persist</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistBase</span><span class="hl-1">(</span><span class="hl-2">"my-entity"</span><span class="hl-1">, </span><span class="hl-2">"./data"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">persist</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">persist</span><span class="hl-1">.</span><span class="hl-0">writeValue</span><span class="hl-1">(</span><span class="hl-2">"key1"</span><span class="hl-1">, { </span><span class="hl-4">data:</span><span class="hl-1"> </span><span class="hl-2">"value"</span><span class="hl-1"> });</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">value</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">persist</span><span class="hl-1">.</span><span class="hl-0">readValue</span><span class="hl-1">(</span><span class="hl-2">"key1"</span><span class="hl-1">);</span>
|
| 10 |
</code><button type="button">Copy</button></pre>
|
| 11 |
|
| 12 |
+
</div></div></section> <section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="entityname" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">EntityName</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">string</span> = <span class="tsd-signature-type">string</span></span></li></ul></section> <section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistBase.html" class="tsd-signature-type tsd-kind-interface">IPersistBase</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13323">types.d.ts:13323</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.PersistBase.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 13 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistBase.html#_directory" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_directory</span></a>
|
| 14 |
<a href="types.PersistBase.html#base_wait_for_init_symbol" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>[BASE_<wbr/>WAIT_<wbr/>FOR_<wbr/>INIT_<wbr/>SYMBOL]</span></a>
|
| 15 |
<a href="types.PersistBase.html#basedir" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>base<wbr/>Dir</span></a>
|
|
|
|
| 23 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorpersistbase" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">PersistBase</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="types.PersistBase.html#constructorpersistbaseentityname">EntityName</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">entityName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="types.PersistBase.html#constructorpersistbaseentityname">EntityName</a><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">baseDir</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.PersistBase.html" class="tsd-signature-type tsd-kind-class">PersistBase</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="types.PersistBase.html#constructorpersistbaseentityname">EntityName</a><span class="tsd-signature-symbol">></span><a href="#constructorpersistbase" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates new persistence instance.</p>
|
| 24 |
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="constructorpersistbaseentityname" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">EntityName</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">string</span> = <span class="tsd-signature-type">string</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">entityName</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="types.PersistBase.html#constructorpersistbaseentityname">EntityName</a></span><div class="tsd-comment tsd-typography"><p>Unique entity type identifier</p>
|
| 25 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">baseDir</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Base directory for all entities (default: ./dump/data)</p>
|
| 26 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistBase.html" class="tsd-signature-type tsd-kind-class">PersistBase</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="types.PersistBase.html#constructorpersistbaseentityname">EntityName</a><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13334">types.d.ts:13334</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="_directory" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>_directory</span><a href="#_directory" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">_directory</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Computed directory path for entity storage</p>
|
| 27 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13327">types.d.ts:13327</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="base_wait_for_init_symbol" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>[BASE_<wbr/>WAIT_<wbr/>FOR_<wbr/>INIT_<wbr/>SYMBOL]</span><a href="#base_wait_for_init_symbol" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">"[BASE_WAIT_FOR_INIT_SYMBOL]"</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-type">ISingleshotClearable</span><span class="tsd-signature-symbol"><</span><br/>Β Β Β Β <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13342">types.d.ts:13342</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="basedir" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>base<wbr/>Dir</span><a href="#basedir" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">baseDir</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13325">types.d.ts:13325</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="entityname-1" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>entity<wbr/>Name</span><a href="#entityname-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">entityName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="types.PersistBase.html#constructorpersistbaseentityname">EntityName</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13324">types.d.ts:13324</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="_getfilepath" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>_get<wbr/>File<wbr/>Path</span><a href="#_getfilepath" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="_getfilepath-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">_getFilePath</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">entityId</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.EntityId.html" class="tsd-signature-type tsd-kind-type-alias">EntityId</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><a href="#_getfilepath-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Computes file path for entity ID.</p>
|
| 28 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">entityId</span>: <a href="../types/types.EntityId.html" class="tsd-signature-type tsd-kind-type-alias">EntityId</a></span><div class="tsd-comment tsd-typography"><p>Entity identifier</p>
|
| 29 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><p>Full file path to entity JSON file</p>
|
| 30 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13341">types.d.ts:13341</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="hasvalue" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>has<wbr/>Value</span><a href="#hasvalue" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="hasvalue-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">hasValue</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">entityId</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.EntityId.html" class="tsd-signature-type tsd-kind-type-alias">EntityId</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span><a href="#hasvalue-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Check if entity exists in storage.</p>
|
| 31 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">entityId</span>: <a href="../types/types.EntityId.html" class="tsd-signature-type tsd-kind-type-alias">EntityId</a></span><div class="tsd-comment tsd-typography"><p>Unique entity identifier</p>
|
| 32 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to true if exists, false otherwise</p>
|
| 33 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistBase.html">IPersistBase</a>.<a href="../interfaces/types.IPersistBase.html#hasvalue">hasValue</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13345">types.d.ts:13345</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="keys" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>keys</span><a href="#keys" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="keys-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">keys</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">AsyncGenerator</span><span class="tsd-signature-symbol"><</span><a href="../types/types.EntityId.html" class="tsd-signature-type tsd-kind-type-alias">EntityId</a><span class="tsd-signature-symbol">></span><a href="#keys-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Async generator yielding all entity IDs.
|
| 34 |
Sorted alphanumerically.
|
| 35 |
Used internally by waitForInit for validation.</p>
|
| 36 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">AsyncGenerator</span><span class="tsd-signature-symbol"><</span><a href="../types/types.EntityId.html" class="tsd-signature-type tsd-kind-type-alias">EntityId</a><span class="tsd-signature-symbol">></span></h4><p>AsyncGenerator yielding entity IDs</p>
|
| 37 |
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws" class="tsd-anchor"></a>Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Error if reading fails</p>
|
| 38 |
+
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistBase.html">IPersistBase</a>.<a href="../interfaces/types.IPersistBase.html#keys">keys</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13355">types.d.ts:13355</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="readvalue" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>read<wbr/>Value</span><a href="#readvalue" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="readvalue-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">readValue</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="types.PersistBase.html#readvaluet">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">IEntity</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">IEntity</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">entityId</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.EntityId.html" class="tsd-signature-type tsd-kind-type-alias">EntityId</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="types.PersistBase.html#readvaluet">T</a><span class="tsd-signature-symbol">></span><a href="#readvalue-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Read entity from persistence storage.</p>
|
| 39 |
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="readvaluet" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">IEntity</span> = <span class="tsd-signature-type">IEntity</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">entityId</span>: <a href="../types/types.EntityId.html" class="tsd-signature-type tsd-kind-type-alias">EntityId</a></span><div class="tsd-comment tsd-typography"><p>Unique entity identifier</p>
|
| 40 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="types.PersistBase.html#readvaluet">T</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to entity data</p>
|
| 41 |
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws-1" class="tsd-anchor"></a>Throws<a href="#throws-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Error if entity not found or read fails</p>
|
| 42 |
+
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistBase.html">IPersistBase</a>.<a href="../interfaces/types.IPersistBase.html#readvalue">readValue</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13344">types.d.ts:13344</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">initial</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initialize persistence directory and validate existing files.
|
| 43 |
Uses singleshot to ensure one-time execution.</p>
|
| 44 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 45 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 46 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistBase.html">IPersistBase</a>.<a href="../interfaces/types.IPersistBase.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13343">types.d.ts:13343</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="writevalue" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write<wbr/>Value</span><a href="#writevalue" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="writevalue-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">writeValue</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="types.PersistBase.html#writevaluet">T</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">IEntity</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">IEntity</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">entityId</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.EntityId.html" class="tsd-signature-type tsd-kind-type-alias">EntityId</a><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">entity</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="types.PersistBase.html#writevaluet">T</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#writevalue-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Write entity to storage with atomic file writes.</p>
|
| 47 |
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="writevaluet" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">IEntity</span> = <span class="tsd-signature-type">IEntity</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">entityId</span>: <a href="../types/types.EntityId.html" class="tsd-signature-type tsd-kind-type-alias">EntityId</a></span><div class="tsd-comment tsd-typography"><p>Unique entity identifier</p>
|
| 48 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">entity</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="types.PersistBase.html#writevaluet">T</a></span><div class="tsd-comment tsd-typography"><p>Entity data to persist</p>
|
| 49 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 50 |
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws-2" class="tsd-anchor"></a>Throws<a href="#throws-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Error if write fails</p>
|
| 51 |
+
</div></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistBase.html">IPersistBase</a>.<a href="../interfaces/types.IPersistBase.html#writevalue">writeValue</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13346">types.d.ts:13346</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#_directory" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_directory</span></a><a href="#base_wait_for_init_symbol" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>[BASE_<wbr/>WAIT_<wbr/>FOR_<wbr/>INIT_<wbr/>SYMBOL]</span></a><a href="#basedir" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>base<wbr/>Dir</span></a><a href="#entityname-1" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>entity<wbr/>Name</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#_getfilepath" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>_get<wbr/>File<wbr/>Path</span></a><a href="#hasvalue" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>has<wbr/>Value</span></a><a href="#keys" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>keys</span></a><a href="#readvalue" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Value</span></a><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a><a href="#writevalue" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Value</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 52 |
|
| 53 |
<!-- Yandex.Metrika counter -->
|
| 54 |
<script type="text/javascript">
|
classes/types.PersistBreakevenInstance.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistBreakevenInstance</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">, </span><span class="hl-2">"binance"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeBreakevenData</span><span class="hl-1">(</span><span class="hl-4">breakevenData</span><span class="hl-1">, </span><span class="hl-2">"signal-id-1"</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">restored</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readBreakevenData</span><span class="hl-1">(</span><span class="hl-2">"signal-id-1"</span><span class="hl-1">);</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
-
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistBreakevenInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistBreakevenInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistBreakevenInstance.html#exchangename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a>
|
| 13 |
<a href="types.PersistBreakevenInstance.html#strategyname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>strategy<wbr/>Name</span></a>
|
| 14 |
<a href="types.PersistBreakevenInstance.html#symbol" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>symbol</span></a>
|
|
@@ -19,17 +19,17 @@
|
|
| 19 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">symbol</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Trading pair symbol</p>
|
| 20 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">strategyName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Strategy identifier</p>
|
| 21 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">exchangeName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Exchange identifier</p>
|
| 22 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistBreakevenInstance.html" class="tsd-signature-type tsd-kind-class">PersistBreakevenInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 23 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 24 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.BreakevenData.html" class="tsd-signature-type tsd-kind-type-alias">BreakevenData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to breakeven data record (empty object if not found)</p>
|
| 25 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistBreakevenInstance.html">IPersistBreakevenInstance</a>.<a href="../interfaces/types.IPersistBreakevenInstance.html#readbreakevendata">readBreakevenData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 26 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 27 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 28 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistBreakevenInstance.html">IPersistBreakevenInstance</a>.<a href="../interfaces/types.IPersistBreakevenInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 29 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <a href="../types/types.BreakevenData.html" class="tsd-signature-type tsd-kind-type-alias">BreakevenData</a></span><div class="tsd-comment tsd-typography"><p>Breakeven data record to persist</p>
|
| 30 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 31 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 32 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistBreakevenInstance.html">IPersistBreakevenInstance</a>.<a href="../interfaces/types.IPersistBreakevenInstance.html#writebreakevendata">writeBreakevenData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 33 |
|
| 34 |
<!-- Yandex.Metrika counter -->
|
| 35 |
<script type="text/javascript">
|
|
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistBreakevenInstance</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">, </span><span class="hl-2">"binance"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeBreakevenData</span><span class="hl-1">(</span><span class="hl-4">breakevenData</span><span class="hl-1">, </span><span class="hl-2">"signal-id-1"</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">restored</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readBreakevenData</span><span class="hl-1">(</span><span class="hl-2">"signal-id-1"</span><span class="hl-1">);</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
+
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistBreakevenInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistBreakevenInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14108">types.d.ts:14108</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.PersistBreakevenInstance.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistBreakevenInstance.html#exchangename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a>
|
| 13 |
<a href="types.PersistBreakevenInstance.html#strategyname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>strategy<wbr/>Name</span></a>
|
| 14 |
<a href="types.PersistBreakevenInstance.html#symbol" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>symbol</span></a>
|
|
|
|
| 19 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">symbol</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Trading pair symbol</p>
|
| 20 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">strategyName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Strategy identifier</p>
|
| 21 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">exchangeName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Exchange identifier</p>
|
| 22 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistBreakevenInstance.html" class="tsd-signature-type tsd-kind-class">PersistBreakevenInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14121">types.d.ts:14121</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="exchangename" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>exchange<wbr/>Name</span><a href="#exchangename" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">exchangeName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14111">types.d.ts:14111</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="strategyname" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>strategy<wbr/>Name</span><a href="#strategyname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">strategyName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14110">types.d.ts:14110</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="symbol" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>symbol</span><a href="#symbol" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">symbol</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14109">types.d.ts:14109</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="readbreakevendata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>read<wbr/>Breakeven<wbr/>Data</span><a href="#readbreakevendata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="readbreakevendata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">readBreakevenData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">_when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.BreakevenData.html" class="tsd-signature-type tsd-kind-type-alias">BreakevenData</a><span class="tsd-signature-symbol">></span><a href="#readbreakevendata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Reads the breakeven data for the given signal using <code>signalId</code> as the entity key.</p>
|
| 23 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 24 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.BreakevenData.html" class="tsd-signature-type tsd-kind-type-alias">BreakevenData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to breakeven data record (empty object if not found)</p>
|
| 25 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistBreakevenInstance.html">IPersistBreakevenInstance</a>.<a href="../interfaces/types.IPersistBreakevenInstance.html#readbreakevendata">readBreakevenData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14135">types.d.ts:14135</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">initial</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the underlying PersistBase storage.</p>
|
| 26 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 27 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 28 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistBreakevenInstance.html">IPersistBreakevenInstance</a>.<a href="../interfaces/types.IPersistBreakevenInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14128">types.d.ts:14128</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="writebreakevendata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write<wbr/>Breakeven<wbr/>Data</span><a href="#writebreakevendata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="writebreakevendata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">writeBreakevenData</span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">data</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.BreakevenData.html" class="tsd-signature-type tsd-kind-type-alias">BreakevenData</a><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">_when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#writebreakevendata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Writes the breakeven data for the given signal using <code>signalId</code> as the entity key.</p>
|
| 29 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <a href="../types/types.BreakevenData.html" class="tsd-signature-type tsd-kind-type-alias">BreakevenData</a></span><div class="tsd-comment tsd-typography"><p>Breakeven data record to persist</p>
|
| 30 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 31 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 32 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistBreakevenInstance.html">IPersistBreakevenInstance</a>.<a href="../interfaces/types.IPersistBreakevenInstance.html#writebreakevendata">writeBreakevenData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14144">types.d.ts:14144</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#exchangename" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a><a href="#strategyname" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>strategy<wbr/>Name</span></a><a href="#symbol" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>symbol</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#readbreakevendata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Breakeven<wbr/>Data</span></a><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a><a href="#writebreakevendata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Breakeven<wbr/>Data</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 33 |
|
| 34 |
<!-- Yandex.Metrika counter -->
|
| 35 |
<script type="text/javascript">
|
classes/types.PersistCandleInstance.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistCandleInstance</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"1m"</span><span class="hl-1">, </span><span class="hl-2">"binance"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeCandlesData</span><span class="hl-1">(</span><span class="hl-4">candles</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">cached</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readCandlesData</span><span class="hl-1">(</span><span class="hl-7">100</span><span class="hl-1">, </span><span class="hl-4">since</span><span class="hl-1">, </span><span class="hl-4">until</span><span class="hl-1">);</span>
|
| 10 |
</code><button type="button">Copy</button></pre>
|
| 11 |
|
| 12 |
-
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistCandleInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistCandleInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 13 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistCandleInstance.html#exchangename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a>
|
| 14 |
<a href="types.PersistCandleInstance.html#interval" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>interval</span></a>
|
| 15 |
<a href="types.PersistCandleInstance.html#symbol" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>symbol</span></a>
|
|
@@ -20,7 +20,7 @@
|
|
| 20 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">symbol</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Trading pair symbol</p>
|
| 21 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">interval</span>: <a href="../types/types.CandleInterval.html" class="tsd-signature-type tsd-kind-type-alias">CandleInterval</a></span><div class="tsd-comment tsd-typography"><p>Candle interval (1m, 5m, 1h, etc.)</p>
|
| 22 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">exchangeName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Exchange identifier</p>
|
| 23 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistCandleInstance.html" class="tsd-signature-type tsd-kind-class">PersistCandleInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 24 |
Computes expected timestamps (sinceTimestamp + i * stepMs) and reads each
|
| 25 |
by timestamp key. Returns null on ANY missing timestamp (cache miss).
|
| 26 |
Invalid cached candles emit a warning via errorEmitter and are treated as miss.</p>
|
|
@@ -28,15 +28,15 @@ Invalid cached candles emit a warning via errorEmitter and are treated as miss.<
|
|
| 28 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">sinceTimestamp</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>Aligned start timestamp (openTime of first candle)</p>
|
| 29 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_untilTimestamp</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>Reserved for API compatibility, unused</p>
|
| 30 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.ICandleData.html" class="tsd-signature-type tsd-kind-interface">ICandleData</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to candles in order, or null on cache miss</p>
|
| 31 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistCandleInstance.html">IPersistCandleInstance</a>.<a href="../interfaces/types.IPersistCandleInstance.html#readcandlesdata">readCandlesData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 32 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 33 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 34 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistCandleInstance.html">IPersistCandleInstance</a>.<a href="../interfaces/types.IPersistCandleInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 35 |
Skips incomplete candles (closeTime > now) and existing keys to keep
|
| 36 |
the cache append-only for fully closed candles.</p>
|
| 37 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">candles</span>: <a href="../interfaces/types.ICandleData.html" class="tsd-signature-type tsd-kind-interface">ICandleData</a><span class="tsd-signature-symbol">[]</span></span><div class="tsd-comment tsd-typography"><p>Array of candle data to cache</p>
|
| 38 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when all writes are complete</p>
|
| 39 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistCandleInstance.html">IPersistCandleInstance</a>.<a href="../interfaces/types.IPersistCandleInstance.html#writecandlesdata">writeCandlesData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 40 |
|
| 41 |
<!-- Yandex.Metrika counter -->
|
| 42 |
<script type="text/javascript">
|
|
|
|
| 9 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistCandleInstance</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"1m"</span><span class="hl-1">, </span><span class="hl-2">"binance"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeCandlesData</span><span class="hl-1">(</span><span class="hl-4">candles</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">cached</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readCandlesData</span><span class="hl-1">(</span><span class="hl-7">100</span><span class="hl-1">, </span><span class="hl-4">since</span><span class="hl-1">, </span><span class="hl-4">until</span><span class="hl-1">);</span>
|
| 10 |
</code><button type="button">Copy</button></pre>
|
| 11 |
|
| 12 |
+
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistCandleInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistCandleInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14317">types.d.ts:14317</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.PersistCandleInstance.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 13 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistCandleInstance.html#exchangename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a>
|
| 14 |
<a href="types.PersistCandleInstance.html#interval" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>interval</span></a>
|
| 15 |
<a href="types.PersistCandleInstance.html#symbol" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>symbol</span></a>
|
|
|
|
| 20 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">symbol</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Trading pair symbol</p>
|
| 21 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">interval</span>: <a href="../types/types.CandleInterval.html" class="tsd-signature-type tsd-kind-type-alias">CandleInterval</a></span><div class="tsd-comment tsd-typography"><p>Candle interval (1m, 5m, 1h, etc.)</p>
|
| 22 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">exchangeName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Exchange identifier</p>
|
| 23 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistCandleInstance.html" class="tsd-signature-type tsd-kind-class">PersistCandleInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14330">types.d.ts:14330</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="exchangename" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>exchange<wbr/>Name</span><a href="#exchangename" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">exchangeName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14320">types.d.ts:14320</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="interval" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>interval</span><a href="#interval" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">interval</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.CandleInterval.html" class="tsd-signature-type tsd-kind-type-alias">CandleInterval</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14319">types.d.ts:14319</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="symbol" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>symbol</span><a href="#symbol" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">symbol</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14318">types.d.ts:14318</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="readcandlesdata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>read<wbr/>Candles<wbr/>Data</span><a href="#readcandlesdata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="readcandlesdata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">readCandlesData</span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">limit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">sinceTimestamp</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">_untilTimestamp</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.ICandleData.html" class="tsd-signature-type tsd-kind-interface">ICandleData</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span><a href="#readcandlesdata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Reads cached candles for the requested window.
|
| 24 |
Computes expected timestamps (sinceTimestamp + i * stepMs) and reads each
|
| 25 |
by timestamp key. Returns null on ANY missing timestamp (cache miss).
|
| 26 |
Invalid cached candles emit a warning via errorEmitter and are treated as miss.</p>
|
|
|
|
| 28 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">sinceTimestamp</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>Aligned start timestamp (openTime of first candle)</p>
|
| 29 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_untilTimestamp</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>Reserved for API compatibility, unused</p>
|
| 30 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.ICandleData.html" class="tsd-signature-type tsd-kind-interface">ICandleData</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to candles in order, or null on cache miss</p>
|
| 31 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistCandleInstance.html">IPersistCandleInstance</a>.<a href="../interfaces/types.IPersistCandleInstance.html#readcandlesdata">readCandlesData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14349">types.d.ts:14349</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">initial</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the underlying PersistBase storage.</p>
|
| 32 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 33 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 34 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistCandleInstance.html">IPersistCandleInstance</a>.<a href="../interfaces/types.IPersistCandleInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14337">types.d.ts:14337</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="writecandlesdata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write<wbr/>Candles<wbr/>Data</span><a href="#writecandlesdata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="writecandlesdata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">writeCandlesData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">candles</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/types.ICandleData.html" class="tsd-signature-type tsd-kind-interface">ICandleData</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#writecandlesdata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Writes candles to cache.
|
| 35 |
Skips incomplete candles (closeTime > now) and existing keys to keep
|
| 36 |
the cache append-only for fully closed candles.</p>
|
| 37 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">candles</span>: <a href="../interfaces/types.ICandleData.html" class="tsd-signature-type tsd-kind-interface">ICandleData</a><span class="tsd-signature-symbol">[]</span></span><div class="tsd-comment tsd-typography"><p>Array of candle data to cache</p>
|
| 38 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when all writes are complete</p>
|
| 39 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistCandleInstance.html">IPersistCandleInstance</a>.<a href="../interfaces/types.IPersistCandleInstance.html#writecandlesdata">writeCandlesData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14358">types.d.ts:14358</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#exchangename" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a><a href="#interval" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>interval</span></a><a href="#symbol" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>symbol</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#readcandlesdata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Candles<wbr/>Data</span></a><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a><a href="#writecandlesdata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Candles<wbr/>Data</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 40 |
|
| 41 |
<!-- Yandex.Metrika counter -->
|
| 42 |
<script type="text/javascript">
|
classes/types.PersistIntervalInstance.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistIntervalInstance</span><span class="hl-1">(</span><span class="hl-2">"my-interval-bucket"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeIntervalData</span><span class="hl-1">({ </span><span class="hl-4">id:</span><span class="hl-1"> </span><span class="hl-2">"x"</span><span class="hl-1">, </span><span class="hl-4">data:</span><span class="hl-1"> {}, </span><span class="hl-4">removed:</span><span class="hl-1"> </span><span class="hl-3">false</span><span class="hl-1"> }, </span><span class="hl-2">"key1"</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">marker</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readIntervalData</span><span class="hl-1">(</span><span class="hl-2">"key1"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">removeIntervalData</span><span class="hl-1">(</span><span class="hl-2">"key1"</span><span class="hl-1">);</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
-
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistIntervalInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistIntervalInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistIntervalInstance.html#bucket" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bucket</span></a>
|
| 13 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.PersistIntervalInstance.html#listintervaldata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>list<wbr/>Interval<wbr/>Data</span></a>
|
| 14 |
<a href="types.PersistIntervalInstance.html#readintervaldata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Interval<wbr/>Data</span></a>
|
|
@@ -17,23 +17,23 @@
|
|
| 17 |
<a href="types.PersistIntervalInstance.html#writeintervaldata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Interval<wbr/>Data</span></a>
|
| 18 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorpersistintervalinstance" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">PersistIntervalInstance</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">bucket</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.PersistIntervalInstance.html" class="tsd-signature-type tsd-kind-class">PersistIntervalInstance</a><a href="#constructorpersistintervalinstance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates new interval marker persistence instance.</p>
|
| 19 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">bucket</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Marker bucket identifier</p>
|
| 20 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistIntervalInstance.html" class="tsd-signature-type tsd-kind-class">PersistIntervalInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 21 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">AsyncGenerator</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></h4><p>AsyncGenerator yielding marker keys</p>
|
| 22 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistIntervalInstance.html">IPersistIntervalInstance</a>.<a href="../interfaces/types.IPersistIntervalInstance.html#listintervaldata">listIntervalData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 23 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">key</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Marker key within the bucket</p>
|
| 24 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.IntervalData.html" class="tsd-signature-type tsd-kind-type-alias">IntervalData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to stored data, or null</p>
|
| 25 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistIntervalInstance.html">IPersistIntervalInstance</a>.<a href="../interfaces/types.IPersistIntervalInstance.html#readintervaldata">readIntervalData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 26 |
Subsequent reads will return null, allowing the interval to fire again.</p>
|
| 27 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">key</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Marker key within the bucket</p>
|
| 28 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when removal is complete</p>
|
| 29 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistIntervalInstance.html">IPersistIntervalInstance</a>.<a href="../interfaces/types.IPersistIntervalInstance.html#removeintervaldata">removeIntervalData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 30 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 31 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 32 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistIntervalInstance.html">IPersistIntervalInstance</a>.<a href="../interfaces/types.IPersistIntervalInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 33 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <a href="../types/types.IntervalData.html" class="tsd-signature-type tsd-kind-type-alias">IntervalData</a></span><div class="tsd-comment tsd-typography"><p>Data to store</p>
|
| 34 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">key</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Marker key within the bucket</p>
|
| 35 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 36 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistIntervalInstance.html">IPersistIntervalInstance</a>.<a href="../interfaces/types.IPersistIntervalInstance.html#writeintervaldata">writeIntervalData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 37 |
|
| 38 |
<!-- Yandex.Metrika counter -->
|
| 39 |
<script type="text/javascript">
|
|
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistIntervalInstance</span><span class="hl-1">(</span><span class="hl-2">"my-interval-bucket"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeIntervalData</span><span class="hl-1">({ </span><span class="hl-4">id:</span><span class="hl-1"> </span><span class="hl-2">"x"</span><span class="hl-1">, </span><span class="hl-4">data:</span><span class="hl-1"> {}, </span><span class="hl-4">removed:</span><span class="hl-1"> </span><span class="hl-3">false</span><span class="hl-1"> }, </span><span class="hl-2">"key1"</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">marker</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readIntervalData</span><span class="hl-1">(</span><span class="hl-2">"key1"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">removeIntervalData</span><span class="hl-1">(</span><span class="hl-2">"key1"</span><span class="hl-1">);</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
+
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistIntervalInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistIntervalInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15186">types.d.ts:15186</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.PersistIntervalInstance.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistIntervalInstance.html#bucket" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bucket</span></a>
|
| 13 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.PersistIntervalInstance.html#listintervaldata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>list<wbr/>Interval<wbr/>Data</span></a>
|
| 14 |
<a href="types.PersistIntervalInstance.html#readintervaldata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Interval<wbr/>Data</span></a>
|
|
|
|
| 17 |
<a href="types.PersistIntervalInstance.html#writeintervaldata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Interval<wbr/>Data</span></a>
|
| 18 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorpersistintervalinstance" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">PersistIntervalInstance</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">bucket</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.PersistIntervalInstance.html" class="tsd-signature-type tsd-kind-class">PersistIntervalInstance</a><a href="#constructorpersistintervalinstance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates new interval marker persistence instance.</p>
|
| 19 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">bucket</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Marker bucket identifier</p>
|
| 20 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistIntervalInstance.html" class="tsd-signature-type tsd-kind-class">PersistIntervalInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15195">types.d.ts:15195</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="bucket" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>bucket</span><a href="#bucket" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">bucket</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15187">types.d.ts:15187</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="listintervaldata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>list<wbr/>Interval<wbr/>Data</span><a href="#listintervaldata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="listintervaldata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">listIntervalData</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">AsyncGenerator</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span><a href="#listintervaldata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Iterates all markers in the bucket, yielding keys of non-removed markers only.</p>
|
| 21 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">AsyncGenerator</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></h4><p>AsyncGenerator yielding marker keys</p>
|
| 22 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistIntervalInstance.html">IPersistIntervalInstance</a>.<a href="../interfaces/types.IPersistIntervalInstance.html#listintervaldata">listIntervalData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15231">types.d.ts:15231</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="readintervaldata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>read<wbr/>Interval<wbr/>Data</span><a href="#readintervaldata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="readintervaldata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">readIntervalData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.IntervalData.html" class="tsd-signature-type tsd-kind-type-alias">IntervalData</a><span class="tsd-signature-symbol">></span><a href="#readintervaldata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Reads an interval marker by key. Returns null if marker is missing or soft-deleted.</p>
|
| 23 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">key</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Marker key within the bucket</p>
|
| 24 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.IntervalData.html" class="tsd-signature-type tsd-kind-type-alias">IntervalData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to stored data, or null</p>
|
| 25 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistIntervalInstance.html">IPersistIntervalInstance</a>.<a href="../interfaces/types.IPersistIntervalInstance.html#readintervaldata">readIntervalData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15209">types.d.ts:15209</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="removeintervaldata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>remove<wbr/>Interval<wbr/>Data</span><a href="#removeintervaldata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="removeintervaldata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">removeIntervalData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#removeintervaldata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Soft-deletes a marker by writing <code>removed: true</code> flag while preserving the file.
|
| 26 |
Subsequent reads will return null, allowing the interval to fire again.</p>
|
| 27 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">key</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Marker key within the bucket</p>
|
| 28 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when removal is complete</p>
|
| 29 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistIntervalInstance.html">IPersistIntervalInstance</a>.<a href="../interfaces/types.IPersistIntervalInstance.html#removeintervaldata">removeIntervalData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15225">types.d.ts:15225</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">initial</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the underlying PersistBase storage.</p>
|
| 30 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 31 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 32 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistIntervalInstance.html">IPersistIntervalInstance</a>.<a href="../interfaces/types.IPersistIntervalInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15202">types.d.ts:15202</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="writeintervaldata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write<wbr/>Interval<wbr/>Data</span><a href="#writeintervaldata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="writeintervaldata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">writeIntervalData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.IntervalData.html" class="tsd-signature-type tsd-kind-type-alias">IntervalData</a><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#writeintervaldata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Writes an interval marker under the given key.</p>
|
| 33 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <a href="../types/types.IntervalData.html" class="tsd-signature-type tsd-kind-type-alias">IntervalData</a></span><div class="tsd-comment tsd-typography"><p>Data to store</p>
|
| 34 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">key</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Marker key within the bucket</p>
|
| 35 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 36 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistIntervalInstance.html">IPersistIntervalInstance</a>.<a href="../interfaces/types.IPersistIntervalInstance.html#writeintervaldata">writeIntervalData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15217">types.d.ts:15217</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#bucket" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bucket</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#listintervaldata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>list<wbr/>Interval<wbr/>Data</span></a><a href="#readintervaldata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Interval<wbr/>Data</span></a><a href="#removeintervaldata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Interval<wbr/>Data</span></a><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a><a href="#writeintervaldata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Interval<wbr/>Data</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 37 |
|
| 38 |
<!-- Yandex.Metrika counter -->
|
| 39 |
<script type="text/javascript">
|
classes/types.PersistLogInstance.html
CHANGED
|
@@ -9,22 +9,22 @@
|
|
| 9 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistLogInstance</span><span class="hl-1">();</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeLogData</span><span class="hl-1">(</span><span class="hl-4">entries</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">all</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readLogData</span><span class="hl-1">();</span>
|
| 10 |
</code><button type="button">Copy</button></pre>
|
| 11 |
|
| 12 |
-
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistLogInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistLogInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 13 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.PersistLogInstance.html#readlogdata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Log<wbr/>Data</span></a>
|
| 14 |
<a href="types.PersistLogInstance.html#waitforinit" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a>
|
| 15 |
<a href="types.PersistLogInstance.html#writelogdata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Log<wbr/>Data</span></a>
|
| 16 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorpersistloginstance" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">PersistLogInstance</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="types.PersistLogInstance.html" class="tsd-signature-type tsd-kind-class">PersistLogInstance</a><a href="#constructorpersistloginstance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates new log persistence instance.
|
| 17 |
No context parameters β there is a single global log storage.</p>
|
| 18 |
-
</div><h4 class="tsd-returns-title">Returns <a href="types.PersistLogInstance.html" class="tsd-signature-type tsd-kind-class">PersistLogInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 19 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.LogData.html" class="tsd-signature-type tsd-kind-type-alias">LogData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to array of log entries</p>
|
| 20 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistLogInstance.html">IPersistLogInstance</a>.<a href="../interfaces/types.IPersistLogInstance.html#readlogdata">readLogData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 21 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 22 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 23 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistLogInstance.html">IPersistLogInstance</a>.<a href="../interfaces/types.IPersistLogInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 24 |
so the log file is never overwritten.</p>
|
| 25 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">logData</span>: <a href="../types/types.LogData.html" class="tsd-signature-type tsd-kind-type-alias">LogData</a></span><div class="tsd-comment tsd-typography"><p>Log entries to persist</p>
|
| 26 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when all writes are complete</p>
|
| 27 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistLogInstance.html">IPersistLogInstance</a>.<a href="../interfaces/types.IPersistLogInstance.html#writelogdata">writeLogData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 28 |
|
| 29 |
<!-- Yandex.Metrika counter -->
|
| 30 |
<script type="text/javascript">
|
|
|
|
| 9 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistLogInstance</span><span class="hl-1">();</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeLogData</span><span class="hl-1">(</span><span class="hl-4">entries</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">all</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readLogData</span><span class="hl-1">();</span>
|
| 10 |
</code><button type="button">Copy</button></pre>
|
| 11 |
|
| 12 |
+
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistLogInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistLogInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14816">types.d.ts:14816</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.PersistLogInstance.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 13 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.PersistLogInstance.html#readlogdata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Log<wbr/>Data</span></a>
|
| 14 |
<a href="types.PersistLogInstance.html#waitforinit" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a>
|
| 15 |
<a href="types.PersistLogInstance.html#writelogdata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Log<wbr/>Data</span></a>
|
| 16 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorpersistloginstance" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">PersistLogInstance</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="types.PersistLogInstance.html" class="tsd-signature-type tsd-kind-class">PersistLogInstance</a><a href="#constructorpersistloginstance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates new log persistence instance.
|
| 17 |
No context parameters β there is a single global log storage.</p>
|
| 18 |
+
</div><h4 class="tsd-returns-title">Returns <a href="types.PersistLogInstance.html" class="tsd-signature-type tsd-kind-class">PersistLogInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14823">types.d.ts:14823</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="readlogdata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>read<wbr/>Log<wbr/>Data</span><a href="#readlogdata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="readlogdata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">readLogData</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.LogData.html" class="tsd-signature-type tsd-kind-type-alias">LogData</a><span class="tsd-signature-symbol">></span><a href="#readlogdata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Reads all persisted log entries by iterating storage keys.</p>
|
| 19 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.LogData.html" class="tsd-signature-type tsd-kind-type-alias">LogData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to array of log entries</p>
|
| 20 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistLogInstance.html">IPersistLogInstance</a>.<a href="../interfaces/types.IPersistLogInstance.html#readlogdata">readLogData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14836">types.d.ts:14836</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">initial</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the underlying PersistBase storage.</p>
|
| 21 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 22 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 23 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistLogInstance.html">IPersistLogInstance</a>.<a href="../interfaces/types.IPersistLogInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14830">types.d.ts:14830</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="writelogdata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write<wbr/>Log<wbr/>Data</span><a href="#writelogdata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="writelogdata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">writeLogData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">logData</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.LogData.html" class="tsd-signature-type tsd-kind-type-alias">LogData</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#writelogdata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Writes log entries append-only β skips entries whose id already exists
|
| 24 |
so the log file is never overwritten.</p>
|
| 25 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">logData</span>: <a href="../types/types.LogData.html" class="tsd-signature-type tsd-kind-type-alias">LogData</a></span><div class="tsd-comment tsd-typography"><p>Log entries to persist</p>
|
| 26 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when all writes are complete</p>
|
| 27 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistLogInstance.html">IPersistLogInstance</a>.<a href="../interfaces/types.IPersistLogInstance.html#writelogdata">writeLogData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14844">types.d.ts:14844</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#readlogdata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Log<wbr/>Data</span></a><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a><a href="#writelogdata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Log<wbr/>Data</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 28 |
|
| 29 |
<!-- Yandex.Metrika counter -->
|
| 30 |
<script type="text/javascript">
|
classes/types.PersistMeasureInstance.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistMeasureInstance</span><span class="hl-1">(</span><span class="hl-2">"my-bucket"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeMeasureData</span><span class="hl-1">({ </span><span class="hl-4">id:</span><span class="hl-1"> </span><span class="hl-2">"x"</span><span class="hl-1">, </span><span class="hl-4">data:</span><span class="hl-1"> {}, </span><span class="hl-4">removed:</span><span class="hl-1"> </span><span class="hl-3">false</span><span class="hl-1"> }, </span><span class="hl-2">"key1"</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">data</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readMeasureData</span><span class="hl-1">(</span><span class="hl-2">"key1"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">removeMeasureData</span><span class="hl-1">(</span><span class="hl-2">"key1"</span><span class="hl-1">);</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
-
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistMeasureInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistMeasureInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistMeasureInstance.html#bucket" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bucket</span></a>
|
| 13 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.PersistMeasureInstance.html#listmeasuredata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>list<wbr/>Measure<wbr/>Data</span></a>
|
| 14 |
<a href="types.PersistMeasureInstance.html#readmeasuredata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Measure<wbr/>Data</span></a>
|
|
@@ -17,22 +17,22 @@
|
|
| 17 |
<a href="types.PersistMeasureInstance.html#writemeasuredata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Measure<wbr/>Data</span></a>
|
| 18 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorpersistmeasureinstance" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">PersistMeasureInstance</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">bucket</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.PersistMeasureInstance.html" class="tsd-signature-type tsd-kind-class">PersistMeasureInstance</a><a href="#constructorpersistmeasureinstance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates new measure cache persistence instance.</p>
|
| 19 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">bucket</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Cache bucket identifier</p>
|
| 20 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistMeasureInstance.html" class="tsd-signature-type tsd-kind-class">PersistMeasureInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 21 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">AsyncGenerator</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></h4><p>AsyncGenerator yielding entry keys</p>
|
| 22 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMeasureInstance.html">IPersistMeasureInstance</a>.<a href="../interfaces/types.IPersistMeasureInstance.html#listmeasuredata">listMeasureData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 23 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">key</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Cache key within the bucket</p>
|
| 24 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.MeasureData.html" class="tsd-signature-type tsd-kind-type-alias">MeasureData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to entry data, or null</p>
|
| 25 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMeasureInstance.html">IPersistMeasureInstance</a>.<a href="../interfaces/types.IPersistMeasureInstance.html#readmeasuredata">readMeasureData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 26 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">key</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Cache key within the bucket</p>
|
| 27 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when removal is complete</p>
|
| 28 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMeasureInstance.html">IPersistMeasureInstance</a>.<a href="../interfaces/types.IPersistMeasureInstance.html#removemeasuredata">removeMeasureData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 29 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 30 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 31 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMeasureInstance.html">IPersistMeasureInstance</a>.<a href="../interfaces/types.IPersistMeasureInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 32 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <a href="../types/types.MeasureData.html" class="tsd-signature-type tsd-kind-type-alias">MeasureData</a></span><div class="tsd-comment tsd-typography"><p>Data to cache</p>
|
| 33 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">key</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Cache key within the bucket</p>
|
| 34 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 35 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMeasureInstance.html">IPersistMeasureInstance</a>.<a href="../interfaces/types.IPersistMeasureInstance.html#writemeasuredata">writeMeasureData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 36 |
|
| 37 |
<!-- Yandex.Metrika counter -->
|
| 38 |
<script type="text/javascript">
|
|
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistMeasureInstance</span><span class="hl-1">(</span><span class="hl-2">"my-bucket"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeMeasureData</span><span class="hl-1">({ </span><span class="hl-4">id:</span><span class="hl-1"> </span><span class="hl-2">"x"</span><span class="hl-1">, </span><span class="hl-4">data:</span><span class="hl-1"> {}, </span><span class="hl-4">removed:</span><span class="hl-1"> </span><span class="hl-3">false</span><span class="hl-1"> }, </span><span class="hl-2">"key1"</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">data</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readMeasureData</span><span class="hl-1">(</span><span class="hl-2">"key1"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">removeMeasureData</span><span class="hl-1">(</span><span class="hl-2">"key1"</span><span class="hl-1">);</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
+
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistMeasureInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistMeasureInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14986">types.d.ts:14986</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.PersistMeasureInstance.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistMeasureInstance.html#bucket" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bucket</span></a>
|
| 13 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.PersistMeasureInstance.html#listmeasuredata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>list<wbr/>Measure<wbr/>Data</span></a>
|
| 14 |
<a href="types.PersistMeasureInstance.html#readmeasuredata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Measure<wbr/>Data</span></a>
|
|
|
|
| 17 |
<a href="types.PersistMeasureInstance.html#writemeasuredata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Measure<wbr/>Data</span></a>
|
| 18 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorpersistmeasureinstance" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">PersistMeasureInstance</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">bucket</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.PersistMeasureInstance.html" class="tsd-signature-type tsd-kind-class">PersistMeasureInstance</a><a href="#constructorpersistmeasureinstance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates new measure cache persistence instance.</p>
|
| 19 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">bucket</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Cache bucket identifier</p>
|
| 20 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistMeasureInstance.html" class="tsd-signature-type tsd-kind-class">PersistMeasureInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14995">types.d.ts:14995</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="bucket" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>bucket</span><a href="#bucket" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">bucket</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14987">types.d.ts:14987</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="listmeasuredata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>list<wbr/>Measure<wbr/>Data</span><a href="#listmeasuredata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="listmeasuredata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">listMeasureData</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">AsyncGenerator</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span><a href="#listmeasuredata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Iterates all entries in the bucket, yielding keys of non-removed entries only.</p>
|
| 21 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">AsyncGenerator</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></h4><p>AsyncGenerator yielding entry keys</p>
|
| 22 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMeasureInstance.html">IPersistMeasureInstance</a>.<a href="../interfaces/types.IPersistMeasureInstance.html#listmeasuredata">listMeasureData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15030">types.d.ts:15030</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="readmeasuredata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>read<wbr/>Measure<wbr/>Data</span><a href="#readmeasuredata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="readmeasuredata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">readMeasureData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.MeasureData.html" class="tsd-signature-type tsd-kind-type-alias">MeasureData</a><span class="tsd-signature-symbol">></span><a href="#readmeasuredata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Reads a measure entry by key. Returns null if entry is missing or soft-deleted.</p>
|
| 23 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">key</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Cache key within the bucket</p>
|
| 24 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.MeasureData.html" class="tsd-signature-type tsd-kind-type-alias">MeasureData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to entry data, or null</p>
|
| 25 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMeasureInstance.html">IPersistMeasureInstance</a>.<a href="../interfaces/types.IPersistMeasureInstance.html#readmeasuredata">readMeasureData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15009">types.d.ts:15009</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="removemeasuredata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>remove<wbr/>Measure<wbr/>Data</span><a href="#removemeasuredata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="removemeasuredata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">removeMeasureData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#removemeasuredata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Soft-deletes an entry by writing <code>removed: true</code> flag while preserving the file.</p>
|
| 26 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">key</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Cache key within the bucket</p>
|
| 27 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when removal is complete</p>
|
| 28 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMeasureInstance.html">IPersistMeasureInstance</a>.<a href="../interfaces/types.IPersistMeasureInstance.html#removemeasuredata">removeMeasureData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15024">types.d.ts:15024</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">initial</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the underlying PersistBase storage.</p>
|
| 29 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 30 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 31 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMeasureInstance.html">IPersistMeasureInstance</a>.<a href="../interfaces/types.IPersistMeasureInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15002">types.d.ts:15002</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="writemeasuredata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write<wbr/>Measure<wbr/>Data</span><a href="#writemeasuredata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="writemeasuredata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">writeMeasureData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.MeasureData.html" class="tsd-signature-type tsd-kind-type-alias">MeasureData</a><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#writemeasuredata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Writes a measure entry under the given key.</p>
|
| 32 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <a href="../types/types.MeasureData.html" class="tsd-signature-type tsd-kind-type-alias">MeasureData</a></span><div class="tsd-comment tsd-typography"><p>Data to cache</p>
|
| 33 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">key</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Cache key within the bucket</p>
|
| 34 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 35 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMeasureInstance.html">IPersistMeasureInstance</a>.<a href="../interfaces/types.IPersistMeasureInstance.html#writemeasuredata">writeMeasureData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15017">types.d.ts:15017</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#bucket" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bucket</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#listmeasuredata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>list<wbr/>Measure<wbr/>Data</span></a><a href="#readmeasuredata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Measure<wbr/>Data</span></a><a href="#removemeasuredata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Measure<wbr/>Data</span></a><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a><a href="#writemeasuredata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Measure<wbr/>Data</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 36 |
|
| 37 |
<!-- Yandex.Metrika counter -->
|
| 38 |
<script type="text/javascript">
|
classes/types.PersistMemoryInstance.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistMemoryInstance</span><span class="hl-1">(</span><span class="hl-2">"signal-1"</span><span class="hl-1">, </span><span class="hl-2">"context-bucket"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeMemoryData</span><span class="hl-1">(</span><span class="hl-4">entryData</span><span class="hl-1">, </span><span class="hl-2">"memory-id-1"</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">data</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readMemoryData</span><span class="hl-1">(</span><span class="hl-2">"memory-id-1"</span><span class="hl-1">);</span>
|
| 10 |
</code><button type="button">Copy</button></pre>
|
| 11 |
|
| 12 |
-
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistMemoryInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistMemoryInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 13 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistMemoryInstance.html#bucketname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bucket<wbr/>Name</span></a>
|
| 14 |
<a href="types.PersistMemoryInstance.html#signalid" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>signal<wbr/>Id</span></a>
|
| 15 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.PersistMemoryInstance.html#dispose" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>dispose</span></a>
|
|
@@ -22,28 +22,28 @@
|
|
| 22 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorpersistmemoryinstance" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">PersistMemoryInstance</span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.PersistMemoryInstance.html" class="tsd-signature-type tsd-kind-class">PersistMemoryInstance</a><a href="#constructorpersistmemoryinstance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates new memory persistence instance.</p>
|
| 23 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier (entity folder name)</p>
|
| 24 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">bucketName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Bucket name (subfolder under memory/)</p>
|
| 25 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistMemoryInstance.html" class="tsd-signature-type tsd-kind-class">PersistMemoryInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 26 |
Resource cleanup (memo cache invalidation) is handled by PersistMemoryUtils.dispose().</p>
|
| 27 |
-
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMemoryInstance.html">IPersistMemoryInstance</a>.<a href="../interfaces/types.IPersistMemoryInstance.html#dispose">dispose</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 28 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">memoryId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Memory entry identifier</p>
|
| 29 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to true if entry file exists</p>
|
| 30 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMemoryInstance.html">IPersistMemoryInstance</a>.<a href="../interfaces/types.IPersistMemoryInstance.html#hasmemorydata">hasMemoryData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 31 |
for non-removed entries only.</p>
|
| 32 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">AsyncGenerator</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">data</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.MemoryData.html" class="tsd-signature-type tsd-kind-type-alias">MemoryData</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">></span></h4><p>AsyncGenerator yielding <code>{ memoryId, data }</code> tuples</p>
|
| 33 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMemoryInstance.html">IPersistMemoryInstance</a>.<a href="../interfaces/types.IPersistMemoryInstance.html#listmemorydata">listMemoryData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 34 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">memoryId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Memory entry identifier</p>
|
| 35 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.MemoryData.html" class="tsd-signature-type tsd-kind-type-alias">MemoryData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to entry data, or null</p>
|
| 36 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMemoryInstance.html">IPersistMemoryInstance</a>.<a href="../interfaces/types.IPersistMemoryInstance.html#readmemorydata">readMemoryData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 37 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">memoryId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Memory entry identifier</p>
|
| 38 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when removal is complete</p>
|
| 39 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMemoryInstance.html">IPersistMemoryInstance</a>.<a href="../interfaces/types.IPersistMemoryInstance.html#removememorydata">removeMemoryData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 40 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 41 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 42 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMemoryInstance.html">IPersistMemoryInstance</a>.<a href="../interfaces/types.IPersistMemoryInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 43 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <a href="../types/types.MemoryData.html" class="tsd-signature-type tsd-kind-type-alias">MemoryData</a></span><div class="tsd-comment tsd-typography"><p>Entry data to persist</p>
|
| 44 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">memoryId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Memory entry identifier</p>
|
| 45 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 46 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMemoryInstance.html">IPersistMemoryInstance</a>.<a href="../interfaces/types.IPersistMemoryInstance.html#writememorydata">writeMemoryData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 47 |
|
| 48 |
<!-- Yandex.Metrika counter -->
|
| 49 |
<script type="text/javascript">
|
|
|
|
| 9 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistMemoryInstance</span><span class="hl-1">(</span><span class="hl-2">"signal-1"</span><span class="hl-1">, </span><span class="hl-2">"context-bucket"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeMemoryData</span><span class="hl-1">(</span><span class="hl-4">entryData</span><span class="hl-1">, </span><span class="hl-2">"memory-id-1"</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">data</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readMemoryData</span><span class="hl-1">(</span><span class="hl-2">"memory-id-1"</span><span class="hl-1">);</span>
|
| 10 |
</code><button type="button">Copy</button></pre>
|
| 11 |
|
| 12 |
+
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistMemoryInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistMemoryInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15410">types.d.ts:15410</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.PersistMemoryInstance.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 13 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistMemoryInstance.html#bucketname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bucket<wbr/>Name</span></a>
|
| 14 |
<a href="types.PersistMemoryInstance.html#signalid" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>signal<wbr/>Id</span></a>
|
| 15 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.PersistMemoryInstance.html#dispose" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>dispose</span></a>
|
|
|
|
| 22 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorpersistmemoryinstance" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">PersistMemoryInstance</span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.PersistMemoryInstance.html" class="tsd-signature-type tsd-kind-class">PersistMemoryInstance</a><a href="#constructorpersistmemoryinstance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates new memory persistence instance.</p>
|
| 23 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier (entity folder name)</p>
|
| 24 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">bucketName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Bucket name (subfolder under memory/)</p>
|
| 25 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistMemoryInstance.html" class="tsd-signature-type tsd-kind-class">PersistMemoryInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15421">types.d.ts:15421</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="bucketname" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>bucket<wbr/>Name</span><a href="#bucketname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15412">types.d.ts:15412</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="signalid" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>signal<wbr/>Id</span><a href="#signalid" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15411">types.d.ts:15411</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="dispose" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>dispose</span><a href="#dispose" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="dispose-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">dispose</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#dispose-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>No-op for the default file-based implementation.
|
| 26 |
Resource cleanup (memo cache invalidation) is handled by PersistMemoryUtils.dispose().</p>
|
| 27 |
+
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMemoryInstance.html">IPersistMemoryInstance</a>.<a href="../interfaces/types.IPersistMemoryInstance.html#dispose">dispose</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15472">types.d.ts:15472</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="hasmemorydata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>has<wbr/>Memory<wbr/>Data</span><a href="#hasmemorydata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="hasmemorydata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">hasMemoryData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span><a href="#hasmemorydata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Checks whether a memory entry exists on disk (regardless of removed flag).</p>
|
| 28 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">memoryId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Memory entry identifier</p>
|
| 29 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to true if entry file exists</p>
|
| 30 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMemoryInstance.html">IPersistMemoryInstance</a>.<a href="../interfaces/types.IPersistMemoryInstance.html#hasmemorydata">hasMemoryData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15442">types.d.ts:15442</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="listmemorydata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>list<wbr/>Memory<wbr/>Data</span><a href="#listmemorydata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="listmemorydata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">listMemoryData</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">AsyncGenerator</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">data</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.MemoryData.html" class="tsd-signature-type tsd-kind-type-alias">MemoryData</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">></span><a href="#listmemorydata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Iterates all memory entries in the bucket, yielding id + data tuples
|
| 31 |
for non-removed entries only.</p>
|
| 32 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">AsyncGenerator</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">data</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.MemoryData.html" class="tsd-signature-type tsd-kind-type-alias">MemoryData</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">></span></h4><p>AsyncGenerator yielding <code>{ memoryId, data }</code> tuples</p>
|
| 33 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMemoryInstance.html">IPersistMemoryInstance</a>.<a href="../interfaces/types.IPersistMemoryInstance.html#listmemorydata">listMemoryData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15464">types.d.ts:15464</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="readmemorydata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>read<wbr/>Memory<wbr/>Data</span><a href="#readmemorydata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="readmemorydata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">readMemoryData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.MemoryData.html" class="tsd-signature-type tsd-kind-type-alias">MemoryData</a><span class="tsd-signature-symbol">></span><a href="#readmemorydata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Reads a memory entry by id. Returns null if entry is missing or soft-deleted.</p>
|
| 34 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">memoryId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Memory entry identifier</p>
|
| 35 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.MemoryData.html" class="tsd-signature-type tsd-kind-type-alias">MemoryData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to entry data, or null</p>
|
| 36 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMemoryInstance.html">IPersistMemoryInstance</a>.<a href="../interfaces/types.IPersistMemoryInstance.html#readmemorydata">readMemoryData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15435">types.d.ts:15435</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="removememorydata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>remove<wbr/>Memory<wbr/>Data</span><a href="#removememorydata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="removememorydata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">removeMemoryData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#removememorydata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Soft-deletes a memory entry by writing <code>removed: true</code> flag.</p>
|
| 37 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">memoryId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Memory entry identifier</p>
|
| 38 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when removal is complete</p>
|
| 39 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMemoryInstance.html">IPersistMemoryInstance</a>.<a href="../interfaces/types.IPersistMemoryInstance.html#removememorydata">removeMemoryData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15457">types.d.ts:15457</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">initial</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the underlying PersistBase storage.</p>
|
| 40 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 41 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 42 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMemoryInstance.html">IPersistMemoryInstance</a>.<a href="../interfaces/types.IPersistMemoryInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15428">types.d.ts:15428</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="writememorydata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write<wbr/>Memory<wbr/>Data</span><a href="#writememorydata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="writememorydata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">writeMemoryData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.MemoryData.html" class="tsd-signature-type tsd-kind-type-alias">MemoryData</a><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">memoryId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">_when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#writememorydata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Writes a memory entry under the given id.</p>
|
| 43 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <a href="../types/types.MemoryData.html" class="tsd-signature-type tsd-kind-type-alias">MemoryData</a></span><div class="tsd-comment tsd-typography"><p>Entry data to persist</p>
|
| 44 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">memoryId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Memory entry identifier</p>
|
| 45 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 46 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistMemoryInstance.html">IPersistMemoryInstance</a>.<a href="../interfaces/types.IPersistMemoryInstance.html#writememorydata">writeMemoryData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15450">types.d.ts:15450</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#bucketname" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bucket<wbr/>Name</span></a><a href="#signalid" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>signal<wbr/>Id</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#dispose" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>dispose</span></a><a href="#hasmemorydata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>has<wbr/>Memory<wbr/>Data</span></a><a href="#listmemorydata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>list<wbr/>Memory<wbr/>Data</span></a><a href="#readmemorydata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Memory<wbr/>Data</span></a><a href="#removememorydata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Memory<wbr/>Data</span></a><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a><a href="#writememorydata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Memory<wbr/>Data</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 47 |
|
| 48 |
<!-- Yandex.Metrika counter -->
|
| 49 |
<script type="text/javascript">
|
classes/types.PersistNotificationInstance.html
CHANGED
|
@@ -8,22 +8,22 @@
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistNotificationInstance</span><span class="hl-1">(</span><span class="hl-3">false</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeNotificationData</span><span class="hl-1">(</span><span class="hl-4">notifications</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">all</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readNotificationData</span><span class="hl-1">();</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
-
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistNotificationInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistNotificationInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistNotificationInstance.html#backtest" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>backtest</span></a>
|
| 13 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.PersistNotificationInstance.html#readnotificationdata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Notification<wbr/>Data</span></a>
|
| 14 |
<a href="types.PersistNotificationInstance.html#waitforinit" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a>
|
| 15 |
<a href="types.PersistNotificationInstance.html#writenotificationdata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Notification<wbr/>Data</span></a>
|
| 16 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorpersistnotificationinstance" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">PersistNotificationInstance</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">backtest</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.PersistNotificationInstance.html" class="tsd-signature-type tsd-kind-class">PersistNotificationInstance</a><a href="#constructorpersistnotificationinstance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates new notification persistence instance.</p>
|
| 17 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">backtest</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>True for backtest mode storage, false for live mode</p>
|
| 18 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistNotificationInstance.html" class="tsd-signature-type tsd-kind-class">PersistNotificationInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 19 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.NotificationData.html" class="tsd-signature-type tsd-kind-type-alias">NotificationData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to array of notification entries</p>
|
| 20 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistNotificationInstance.html">IPersistNotificationInstance</a>.<a href="../interfaces/types.IPersistNotificationInstance.html#readnotificationdata">readNotificationData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 21 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 22 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 23 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistNotificationInstance.html">IPersistNotificationInstance</a>.<a href="../interfaces/types.IPersistNotificationInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 24 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">notifications</span>: <a href="../types/types.NotificationData.html" class="tsd-signature-type tsd-kind-type-alias">NotificationData</a></span><div class="tsd-comment tsd-typography"><p>Notification entries to persist</p>
|
| 25 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when all writes are complete</p>
|
| 26 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistNotificationInstance.html">IPersistNotificationInstance</a>.<a href="../interfaces/types.IPersistNotificationInstance.html#writenotificationdata">writeNotificationData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 27 |
|
| 28 |
<!-- Yandex.Metrika counter -->
|
| 29 |
<script type="text/javascript">
|
|
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistNotificationInstance</span><span class="hl-1">(</span><span class="hl-3">false</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeNotificationData</span><span class="hl-1">(</span><span class="hl-4">notifications</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">all</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readNotificationData</span><span class="hl-1">();</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
+
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistNotificationInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistNotificationInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14655">types.d.ts:14655</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.PersistNotificationInstance.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistNotificationInstance.html#backtest" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>backtest</span></a>
|
| 13 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.PersistNotificationInstance.html#readnotificationdata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Notification<wbr/>Data</span></a>
|
| 14 |
<a href="types.PersistNotificationInstance.html#waitforinit" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a>
|
| 15 |
<a href="types.PersistNotificationInstance.html#writenotificationdata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Notification<wbr/>Data</span></a>
|
| 16 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorpersistnotificationinstance" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">PersistNotificationInstance</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">backtest</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.PersistNotificationInstance.html" class="tsd-signature-type tsd-kind-class">PersistNotificationInstance</a><a href="#constructorpersistnotificationinstance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates new notification persistence instance.</p>
|
| 17 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">backtest</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>True for backtest mode storage, false for live mode</p>
|
| 18 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistNotificationInstance.html" class="tsd-signature-type tsd-kind-class">PersistNotificationInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14664">types.d.ts:14664</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="backtest" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>backtest</span><a href="#backtest" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">backtest</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14656">types.d.ts:14656</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="readnotificationdata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>read<wbr/>Notification<wbr/>Data</span><a href="#readnotificationdata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="readnotificationdata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">readNotificationData</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.NotificationData.html" class="tsd-signature-type tsd-kind-type-alias">NotificationData</a><span class="tsd-signature-symbol">></span><a href="#readnotificationdata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Reads all persisted notifications by iterating storage keys.</p>
|
| 19 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.NotificationData.html" class="tsd-signature-type tsd-kind-type-alias">NotificationData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to array of notification entries</p>
|
| 20 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistNotificationInstance.html">IPersistNotificationInstance</a>.<a href="../interfaces/types.IPersistNotificationInstance.html#readnotificationdata">readNotificationData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14677">types.d.ts:14677</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">initial</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the underlying PersistBase storage.</p>
|
| 21 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 22 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 23 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistNotificationInstance.html">IPersistNotificationInstance</a>.<a href="../interfaces/types.IPersistNotificationInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14671">types.d.ts:14671</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="writenotificationdata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write<wbr/>Notification<wbr/>Data</span><a href="#writenotificationdata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="writenotificationdata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">writeNotificationData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">notifications</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.NotificationData.html" class="tsd-signature-type tsd-kind-type-alias">NotificationData</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#writenotificationdata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Writes each notification as a separate entity keyed by <code>notification.id</code>.</p>
|
| 24 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">notifications</span>: <a href="../types/types.NotificationData.html" class="tsd-signature-type tsd-kind-type-alias">NotificationData</a></span><div class="tsd-comment tsd-typography"><p>Notification entries to persist</p>
|
| 25 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when all writes are complete</p>
|
| 26 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistNotificationInstance.html">IPersistNotificationInstance</a>.<a href="../interfaces/types.IPersistNotificationInstance.html#writenotificationdata">writeNotificationData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14684">types.d.ts:14684</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#backtest" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>backtest</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#readnotificationdata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Notification<wbr/>Data</span></a><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a><a href="#writenotificationdata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Notification<wbr/>Data</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 27 |
|
| 28 |
<!-- Yandex.Metrika counter -->
|
| 29 |
<script type="text/javascript">
|
classes/types.PersistPartialInstance.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistPartialInstance</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">, </span><span class="hl-2">"binance"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writePartialData</span><span class="hl-1">(</span><span class="hl-4">partialData</span><span class="hl-1">, </span><span class="hl-2">"signal-id-1"</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">restored</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readPartialData</span><span class="hl-1">(</span><span class="hl-2">"signal-id-1"</span><span class="hl-1">);</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
-
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistPartialInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistPartialInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistPartialInstance.html#exchangename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a>
|
| 13 |
<a href="types.PersistPartialInstance.html#strategyname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>strategy<wbr/>Name</span></a>
|
| 14 |
<a href="types.PersistPartialInstance.html#symbol" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>symbol</span></a>
|
|
@@ -19,17 +19,17 @@
|
|
| 19 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">symbol</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Trading pair symbol</p>
|
| 20 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">strategyName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Strategy identifier</p>
|
| 21 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">exchangeName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Exchange identifier</p>
|
| 22 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistPartialInstance.html" class="tsd-signature-type tsd-kind-class">PersistPartialInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 23 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 24 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.PartialData.html" class="tsd-signature-type tsd-kind-type-alias">PartialData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to partial data record (empty object if not found)</p>
|
| 25 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistPartialInstance.html">IPersistPartialInstance</a>.<a href="../interfaces/types.IPersistPartialInstance.html#readpartialdata">readPartialData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 26 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 27 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 28 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistPartialInstance.html">IPersistPartialInstance</a>.<a href="../interfaces/types.IPersistPartialInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 29 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <a href="../types/types.PartialData.html" class="tsd-signature-type tsd-kind-type-alias">PartialData</a></span><div class="tsd-comment tsd-typography"><p>Partial data record to persist</p>
|
| 30 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 31 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 32 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistPartialInstance.html">IPersistPartialInstance</a>.<a href="../interfaces/types.IPersistPartialInstance.html#writepartialdata">writePartialData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 33 |
|
| 34 |
<!-- Yandex.Metrika counter -->
|
| 35 |
<script type="text/javascript">
|
|
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistPartialInstance</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">, </span><span class="hl-2">"binance"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writePartialData</span><span class="hl-1">(</span><span class="hl-4">partialData</span><span class="hl-1">, </span><span class="hl-2">"signal-id-1"</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">restored</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readPartialData</span><span class="hl-1">(</span><span class="hl-2">"signal-id-1"</span><span class="hl-1">);</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
+
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistPartialInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistPartialInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13923">types.d.ts:13923</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.PersistPartialInstance.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistPartialInstance.html#exchangename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a>
|
| 13 |
<a href="types.PersistPartialInstance.html#strategyname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>strategy<wbr/>Name</span></a>
|
| 14 |
<a href="types.PersistPartialInstance.html#symbol" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>symbol</span></a>
|
|
|
|
| 19 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">symbol</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Trading pair symbol</p>
|
| 20 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">strategyName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Strategy identifier</p>
|
| 21 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">exchangeName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Exchange identifier</p>
|
| 22 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistPartialInstance.html" class="tsd-signature-type tsd-kind-class">PersistPartialInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13936">types.d.ts:13936</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="exchangename" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>exchange<wbr/>Name</span><a href="#exchangename" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">exchangeName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13926">types.d.ts:13926</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="strategyname" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>strategy<wbr/>Name</span><a href="#strategyname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">strategyName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13925">types.d.ts:13925</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="symbol" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>symbol</span><a href="#symbol" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">symbol</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13924">types.d.ts:13924</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="readpartialdata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>read<wbr/>Partial<wbr/>Data</span><a href="#readpartialdata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="readpartialdata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">readPartialData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">_when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.PartialData.html" class="tsd-signature-type tsd-kind-type-alias">PartialData</a><span class="tsd-signature-symbol">></span><a href="#readpartialdata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Reads the partial data for the given signal using <code>signalId</code> as the entity key.</p>
|
| 23 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 24 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.PartialData.html" class="tsd-signature-type tsd-kind-type-alias">PartialData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to partial data record (empty object if not found)</p>
|
| 25 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistPartialInstance.html">IPersistPartialInstance</a>.<a href="../interfaces/types.IPersistPartialInstance.html#readpartialdata">readPartialData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13950">types.d.ts:13950</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">initial</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the underlying PersistBase storage.</p>
|
| 26 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 27 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 28 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistPartialInstance.html">IPersistPartialInstance</a>.<a href="../interfaces/types.IPersistPartialInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13943">types.d.ts:13943</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="writepartialdata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write<wbr/>Partial<wbr/>Data</span><a href="#writepartialdata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="writepartialdata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">writePartialData</span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">data</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.PartialData.html" class="tsd-signature-type tsd-kind-type-alias">PartialData</a><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">_when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#writepartialdata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Writes the partial data for the given signal using <code>signalId</code> as the entity key.</p>
|
| 29 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <a href="../types/types.PartialData.html" class="tsd-signature-type tsd-kind-type-alias">PartialData</a></span><div class="tsd-comment tsd-typography"><p>Partial data record to persist</p>
|
| 30 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 31 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 32 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistPartialInstance.html">IPersistPartialInstance</a>.<a href="../interfaces/types.IPersistPartialInstance.html#writepartialdata">writePartialData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13959">types.d.ts:13959</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#exchangename" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a><a href="#strategyname" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>strategy<wbr/>Name</span></a><a href="#symbol" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>symbol</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#readpartialdata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Partial<wbr/>Data</span></a><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a><a href="#writepartialdata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Partial<wbr/>Data</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 33 |
|
| 34 |
<!-- Yandex.Metrika counter -->
|
| 35 |
<script type="text/javascript">
|
classes/types.PersistRecentInstance.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistRecentInstance</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">, </span><span class="hl-2">"binance"</span><span class="hl-1">, </span><span class="hl-2">"frame-1"</span><span class="hl-1">, </span><span class="hl-3">false</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeRecentData</span><span class="hl-1">(</span><span class="hl-4">publicSignalRow</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">recent</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readRecentData</span><span class="hl-1">();</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
-
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistRecentInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistRecentInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistRecentInstance.html#backtest" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>backtest</span></a>
|
| 13 |
<a href="types.PersistRecentInstance.html#exchangename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a>
|
| 14 |
<a href="types.PersistRecentInstance.html#framename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>frame<wbr/>Name</span></a>
|
|
@@ -23,15 +23,15 @@
|
|
| 23 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">exchangeName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Exchange identifier</p>
|
| 24 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">frameName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Frame identifier (may be empty for live mode)</p>
|
| 25 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">backtest</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>True for backtest mode, false for live mode</p>
|
| 26 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistRecentInstance.html" class="tsd-signature-type tsd-kind-class">PersistRecentInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 27 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.IPublicSignalRow.html" class="tsd-signature-type tsd-kind-interface">IPublicSignalRow</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to recent signal or null if not found</p>
|
| 28 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistRecentInstance.html">IPersistRecentInstance</a>.<a href="../interfaces/types.IPersistRecentInstance.html#readrecentdata">readRecentData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 29 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 30 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 31 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistRecentInstance.html">IPersistRecentInstance</a>.<a href="../interfaces/types.IPersistRecentInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 32 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalRow</span>: <a href="../interfaces/types.IPublicSignalRow.html" class="tsd-signature-type tsd-kind-interface">IPublicSignalRow</a></span><div class="tsd-comment tsd-typography"><p>Recent signal data to persist</p>
|
| 33 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 34 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistRecentInstance.html">IPersistRecentInstance</a>.<a href="../interfaces/types.IPersistRecentInstance.html#writerecentdata">writeRecentData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 35 |
|
| 36 |
<!-- Yandex.Metrika counter -->
|
| 37 |
<script type="text/javascript">
|
|
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistRecentInstance</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">, </span><span class="hl-2">"binance"</span><span class="hl-1">, </span><span class="hl-2">"frame-1"</span><span class="hl-1">, </span><span class="hl-3">false</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeRecentData</span><span class="hl-1">(</span><span class="hl-4">publicSignalRow</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">recent</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readRecentData</span><span class="hl-1">();</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
+
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistRecentInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistRecentInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15665">types.d.ts:15665</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.PersistRecentInstance.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistRecentInstance.html#backtest" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>backtest</span></a>
|
| 13 |
<a href="types.PersistRecentInstance.html#exchangename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a>
|
| 14 |
<a href="types.PersistRecentInstance.html#framename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>frame<wbr/>Name</span></a>
|
|
|
|
| 23 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">exchangeName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Exchange identifier</p>
|
| 24 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">frameName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Frame identifier (may be empty for live mode)</p>
|
| 25 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">backtest</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>True for backtest mode, false for live mode</p>
|
| 26 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistRecentInstance.html" class="tsd-signature-type tsd-kind-class">PersistRecentInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15682">types.d.ts:15682</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="backtest" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>backtest</span><a href="#backtest" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">backtest</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15670">types.d.ts:15670</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="exchangename" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>exchange<wbr/>Name</span><a href="#exchangename" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">exchangeName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15668">types.d.ts:15668</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="framename" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>frame<wbr/>Name</span><a href="#framename" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">frameName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15669">types.d.ts:15669</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="strategyname" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>strategy<wbr/>Name</span><a href="#strategyname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">strategyName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15667">types.d.ts:15667</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="symbol" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>symbol</span><a href="#symbol" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">symbol</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15666">types.d.ts:15666</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="readrecentdata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>read<wbr/>Recent<wbr/>Data</span><a href="#readrecentdata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="readrecentdata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">readRecentData</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.IPublicSignalRow.html" class="tsd-signature-type tsd-kind-interface">IPublicSignalRow</a><span class="tsd-signature-symbol">></span><a href="#readrecentdata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Reads the persisted recent signal using <code>symbol</code> as the entity key.</p>
|
| 27 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.IPublicSignalRow.html" class="tsd-signature-type tsd-kind-interface">IPublicSignalRow</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to recent signal or null if not found</p>
|
| 28 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistRecentInstance.html">IPersistRecentInstance</a>.<a href="../interfaces/types.IPersistRecentInstance.html#readrecentdata">readRecentData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15695">types.d.ts:15695</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">initial</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the underlying PersistBase storage.</p>
|
| 29 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 30 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 31 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistRecentInstance.html">IPersistRecentInstance</a>.<a href="../interfaces/types.IPersistRecentInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15689">types.d.ts:15689</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="writerecentdata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write<wbr/>Recent<wbr/>Data</span><a href="#writerecentdata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="writerecentdata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">writeRecentData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">signalRow</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/types.IPublicSignalRow.html" class="tsd-signature-type tsd-kind-interface">IPublicSignalRow</a><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">_when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#writerecentdata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Writes the recent signal using <code>symbol</code> as the entity key.</p>
|
| 32 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalRow</span>: <a href="../interfaces/types.IPublicSignalRow.html" class="tsd-signature-type tsd-kind-interface">IPublicSignalRow</a></span><div class="tsd-comment tsd-typography"><p>Recent signal data to persist</p>
|
| 33 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 34 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistRecentInstance.html">IPersistRecentInstance</a>.<a href="../interfaces/types.IPersistRecentInstance.html#writerecentdata">writeRecentData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15702">types.d.ts:15702</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#backtest" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>backtest</span></a><a href="#exchangename" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a><a href="#framename" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>frame<wbr/>Name</span></a><a href="#strategyname" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>strategy<wbr/>Name</span></a><a href="#symbol" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>symbol</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#readrecentdata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Recent<wbr/>Data</span></a><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a><a href="#writerecentdata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Recent<wbr/>Data</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 35 |
|
| 36 |
<!-- Yandex.Metrika counter -->
|
| 37 |
<script type="text/javascript">
|
classes/types.PersistRiskInstance.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistRiskInstance</span><span class="hl-1">(</span><span class="hl-2">"my-risk"</span><span class="hl-1">, </span><span class="hl-2">"binance"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writePositionData</span><span class="hl-1">([[</span><span class="hl-2">"strategy:BTCUSDT"</span><span class="hl-1">, </span><span class="hl-4">positionData</span><span class="hl-1">]]);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">positions</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readPositionData</span><span class="hl-1">();</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
-
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistRiskInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistRiskInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistRiskInstance.html#exchangename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a>
|
| 13 |
<a href="types.PersistRiskInstance.html#riskname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>risk<wbr/>Name</span></a>
|
| 14 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.PersistRiskInstance.html#readpositiondata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Position<wbr/>Data</span></a>
|
|
@@ -17,15 +17,15 @@
|
|
| 17 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorpersistriskinstance" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">PersistRiskInstance</span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">riskName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">exchangeName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.PersistRiskInstance.html" class="tsd-signature-type tsd-kind-class">PersistRiskInstance</a><a href="#constructorpersistriskinstance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates new risk positions persistence instance.</p>
|
| 18 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">riskName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Risk profile identifier</p>
|
| 19 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">exchangeName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Exchange identifier</p>
|
| 20 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistRiskInstance.html" class="tsd-signature-type tsd-kind-class">PersistRiskInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 21 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.RiskData.html" class="tsd-signature-type tsd-kind-type-alias">RiskData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to positions (empty array if none persisted)</p>
|
| 22 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistRiskInstance.html">IPersistRiskInstance</a>.<a href="../interfaces/types.IPersistRiskInstance.html#readpositiondata">readPositionData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 23 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 24 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 25 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistRiskInstance.html">IPersistRiskInstance</a>.<a href="../interfaces/types.IPersistRiskInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 26 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">riskRow</span>: <a href="../types/types.RiskData.html" class="tsd-signature-type tsd-kind-type-alias">RiskData</a></span><div class="tsd-comment tsd-typography"><p>Position entries to persist</p>
|
| 27 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 28 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistRiskInstance.html">IPersistRiskInstance</a>.<a href="../interfaces/types.IPersistRiskInstance.html#writepositiondata">writePositionData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 29 |
|
| 30 |
<!-- Yandex.Metrika counter -->
|
| 31 |
<script type="text/javascript">
|
|
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistRiskInstance</span><span class="hl-1">(</span><span class="hl-2">"my-risk"</span><span class="hl-1">, </span><span class="hl-2">"binance"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writePositionData</span><span class="hl-1">([[</span><span class="hl-2">"strategy:BTCUSDT"</span><span class="hl-1">, </span><span class="hl-4">positionData</span><span class="hl-1">]]);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">positions</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readPositionData</span><span class="hl-1">();</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
+
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistRiskInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistRiskInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13575">types.d.ts:13575</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.PersistRiskInstance.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistRiskInstance.html#exchangename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a>
|
| 13 |
<a href="types.PersistRiskInstance.html#riskname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>risk<wbr/>Name</span></a>
|
| 14 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.PersistRiskInstance.html#readpositiondata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Position<wbr/>Data</span></a>
|
|
|
|
| 17 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorpersistriskinstance" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">PersistRiskInstance</span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">riskName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">exchangeName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.PersistRiskInstance.html" class="tsd-signature-type tsd-kind-class">PersistRiskInstance</a><a href="#constructorpersistriskinstance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates new risk positions persistence instance.</p>
|
| 18 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">riskName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Risk profile identifier</p>
|
| 19 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">exchangeName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Exchange identifier</p>
|
| 20 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistRiskInstance.html" class="tsd-signature-type tsd-kind-class">PersistRiskInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13588">types.d.ts:13588</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="exchangename" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>exchange<wbr/>Name</span><a href="#exchangename" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">exchangeName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13577">types.d.ts:13577</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="riskname" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>risk<wbr/>Name</span><a href="#riskname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">riskName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13576">types.d.ts:13576</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="readpositiondata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>read<wbr/>Position<wbr/>Data</span><a href="#readpositiondata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="readpositiondata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">readPositionData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">_when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.RiskData.html" class="tsd-signature-type tsd-kind-type-alias">RiskData</a><span class="tsd-signature-symbol">></span><a href="#readpositiondata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Reads the persisted positions array using the fixed STORAGE_KEY.</p>
|
| 21 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.RiskData.html" class="tsd-signature-type tsd-kind-type-alias">RiskData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to positions (empty array if none persisted)</p>
|
| 22 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistRiskInstance.html">IPersistRiskInstance</a>.<a href="../interfaces/types.IPersistRiskInstance.html#readpositiondata">readPositionData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13601">types.d.ts:13601</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">initial</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the underlying PersistBase storage.</p>
|
| 23 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 24 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 25 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistRiskInstance.html">IPersistRiskInstance</a>.<a href="../interfaces/types.IPersistRiskInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13595">types.d.ts:13595</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="writepositiondata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write<wbr/>Position<wbr/>Data</span><a href="#writepositiondata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="writepositiondata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">writePositionData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">riskRow</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.RiskData.html" class="tsd-signature-type tsd-kind-type-alias">RiskData</a><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">_when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#writepositiondata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Writes the positions array using the fixed STORAGE_KEY.</p>
|
| 26 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">riskRow</span>: <a href="../types/types.RiskData.html" class="tsd-signature-type tsd-kind-type-alias">RiskData</a></span><div class="tsd-comment tsd-typography"><p>Position entries to persist</p>
|
| 27 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 28 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistRiskInstance.html">IPersistRiskInstance</a>.<a href="../interfaces/types.IPersistRiskInstance.html#writepositiondata">writePositionData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13609">types.d.ts:13609</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#exchangename" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a><a href="#riskname" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>risk<wbr/>Name</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#readpositiondata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Position<wbr/>Data</span></a><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a><a href="#writepositiondata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Position<wbr/>Data</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 29 |
|
| 30 |
<!-- Yandex.Metrika counter -->
|
| 31 |
<script type="text/javascript">
|
classes/types.PersistScheduleInstance.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistScheduleInstance</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">, </span><span class="hl-2">"binance"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeScheduleData</span><span class="hl-1">(</span><span class="hl-4">scheduledRow</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">restored</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readScheduleData</span><span class="hl-1">();</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
-
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistScheduleInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistScheduleInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistScheduleInstance.html#exchangename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a>
|
| 13 |
<a href="types.PersistScheduleInstance.html#strategyname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>strategy<wbr/>Name</span></a>
|
| 14 |
<a href="types.PersistScheduleInstance.html#symbol" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>symbol</span></a>
|
|
@@ -19,15 +19,15 @@
|
|
| 19 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">symbol</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Trading pair symbol</p>
|
| 20 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">strategyName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Strategy identifier</p>
|
| 21 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">exchangeName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Exchange identifier</p>
|
| 22 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistScheduleInstance.html" class="tsd-signature-type tsd-kind-class">PersistScheduleInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 23 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.IScheduledSignalRow.html" class="tsd-signature-type tsd-kind-interface">IScheduledSignalRow</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to scheduled signal or null if not found</p>
|
| 24 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistScheduleInstance.html">IPersistScheduleInstance</a>.<a href="../interfaces/types.IPersistScheduleInstance.html#readscheduledata">readScheduleData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 25 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 26 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 27 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistScheduleInstance.html">IPersistScheduleInstance</a>.<a href="../interfaces/types.IPersistScheduleInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 28 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">row</span>: <a href="../interfaces/types.IScheduledSignalRow.html" class="tsd-signature-type tsd-kind-interface">IScheduledSignalRow</a></span><div class="tsd-comment tsd-typography"><p>Scheduled signal data to persist, or null to clear</p>
|
| 29 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 30 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistScheduleInstance.html">IPersistScheduleInstance</a>.<a href="../interfaces/types.IPersistScheduleInstance.html#writescheduledata">writeScheduleData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 31 |
|
| 32 |
<!-- Yandex.Metrika counter -->
|
| 33 |
<script type="text/javascript">
|
|
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistScheduleInstance</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">, </span><span class="hl-2">"binance"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeScheduleData</span><span class="hl-1">(</span><span class="hl-4">scheduledRow</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">restored</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readScheduleData</span><span class="hl-1">();</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
+
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistScheduleInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistScheduleInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13746">types.d.ts:13746</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.PersistScheduleInstance.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistScheduleInstance.html#exchangename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a>
|
| 13 |
<a href="types.PersistScheduleInstance.html#strategyname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>strategy<wbr/>Name</span></a>
|
| 14 |
<a href="types.PersistScheduleInstance.html#symbol" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>symbol</span></a>
|
|
|
|
| 19 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">symbol</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Trading pair symbol</p>
|
| 20 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">strategyName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Strategy identifier</p>
|
| 21 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">exchangeName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Exchange identifier</p>
|
| 22 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistScheduleInstance.html" class="tsd-signature-type tsd-kind-class">PersistScheduleInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13759">types.d.ts:13759</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="exchangename" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>exchange<wbr/>Name</span><a href="#exchangename" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">exchangeName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13749">types.d.ts:13749</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="strategyname" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>strategy<wbr/>Name</span><a href="#strategyname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">strategyName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13748">types.d.ts:13748</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="symbol" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>symbol</span><a href="#symbol" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">symbol</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13747">types.d.ts:13747</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="readscheduledata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>read<wbr/>Schedule<wbr/>Data</span><a href="#readscheduledata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="readscheduledata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">readScheduleData</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.IScheduledSignalRow.html" class="tsd-signature-type tsd-kind-interface">IScheduledSignalRow</a><span class="tsd-signature-symbol">></span><a href="#readscheduledata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Reads the persisted scheduled signal using <code>symbol</code> as the entity key.</p>
|
| 23 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.IScheduledSignalRow.html" class="tsd-signature-type tsd-kind-interface">IScheduledSignalRow</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to scheduled signal or null if not found</p>
|
| 24 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistScheduleInstance.html">IPersistScheduleInstance</a>.<a href="../interfaces/types.IPersistScheduleInstance.html#readscheduledata">readScheduleData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13772">types.d.ts:13772</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">initial</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the underlying PersistBase storage.</p>
|
| 25 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 26 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 27 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistScheduleInstance.html">IPersistScheduleInstance</a>.<a href="../interfaces/types.IPersistScheduleInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13766">types.d.ts:13766</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="writescheduledata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write<wbr/>Schedule<wbr/>Data</span><a href="#writescheduledata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="writescheduledata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">writeScheduleData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">row</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/types.IScheduledSignalRow.html" class="tsd-signature-type tsd-kind-interface">IScheduledSignalRow</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#writescheduledata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Writes the scheduled signal (or null to clear) using <code>symbol</code> as the entity key.</p>
|
| 28 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">row</span>: <a href="../interfaces/types.IScheduledSignalRow.html" class="tsd-signature-type tsd-kind-interface">IScheduledSignalRow</a></span><div class="tsd-comment tsd-typography"><p>Scheduled signal data to persist, or null to clear</p>
|
| 29 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 30 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistScheduleInstance.html">IPersistScheduleInstance</a>.<a href="../interfaces/types.IPersistScheduleInstance.html#writescheduledata">writeScheduleData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13779">types.d.ts:13779</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#exchangename" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a><a href="#strategyname" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>strategy<wbr/>Name</span></a><a href="#symbol" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>symbol</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#readscheduledata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Schedule<wbr/>Data</span></a><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a><a href="#writescheduledata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Schedule<wbr/>Data</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 31 |
|
| 32 |
<!-- Yandex.Metrika counter -->
|
| 33 |
<script type="text/javascript">
|
classes/types.PersistSessionInstance.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistSessionInstance</span><span class="hl-1">(</span><span class="hl-2">"my-strategy"</span><span class="hl-1">, </span><span class="hl-2">"binance"</span><span class="hl-1">, </span><span class="hl-2">"frame-1"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeSessionData</span><span class="hl-1">({ </span><span class="hl-4">id:</span><span class="hl-1"> </span><span class="hl-2">"frame-1"</span><span class="hl-1">, </span><span class="hl-4">data:</span><span class="hl-1"> { </span><span class="hl-4">session:</span><span class="hl-1"> </span><span class="hl-2">"state"</span><span class="hl-1"> } });</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">session</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readSessionData</span><span class="hl-1">();</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
-
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistSessionInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistSessionInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistSessionInstance.html#exchangename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a>
|
| 13 |
<a href="types.PersistSessionInstance.html#framename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>frame<wbr/>Name</span></a>
|
| 14 |
<a href="types.PersistSessionInstance.html#strategyname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>strategy<wbr/>Name</span></a>
|
|
@@ -20,17 +20,17 @@
|
|
| 20 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">strategyName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Strategy identifier</p>
|
| 21 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">exchangeName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Exchange identifier</p>
|
| 22 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">frameName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Frame identifier (also used as entity ID)</p>
|
| 23 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistSessionInstance.html" class="tsd-signature-type tsd-kind-class">PersistSessionInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 24 |
Resource cleanup (memo cache invalidation) is handled by PersistSessionUtils.dispose().</p>
|
| 25 |
-
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistSessionInstance.html">IPersistSessionInstance</a>.<a href="../interfaces/types.IPersistSessionInstance.html#dispose">dispose</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 26 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.SessionData.html" class="tsd-signature-type tsd-kind-type-alias">SessionData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to session data or null if not found</p>
|
| 27 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistSessionInstance.html">IPersistSessionInstance</a>.<a href="../interfaces/types.IPersistSessionInstance.html#readsessiondata">readSessionData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 28 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 29 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 30 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistSessionInstance.html">IPersistSessionInstance</a>.<a href="../interfaces/types.IPersistSessionInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 31 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <a href="../types/types.SessionData.html" class="tsd-signature-type tsd-kind-type-alias">SessionData</a></span><div class="tsd-comment tsd-typography"><p>Session data to persist</p>
|
| 32 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 33 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistSessionInstance.html">IPersistSessionInstance</a>.<a href="../interfaces/types.IPersistSessionInstance.html#writesessiondata">writeSessionData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 34 |
|
| 35 |
<!-- Yandex.Metrika counter -->
|
| 36 |
<script type="text/javascript">
|
|
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistSessionInstance</span><span class="hl-1">(</span><span class="hl-2">"my-strategy"</span><span class="hl-1">, </span><span class="hl-2">"binance"</span><span class="hl-1">, </span><span class="hl-2">"frame-1"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeSessionData</span><span class="hl-1">({ </span><span class="hl-4">id:</span><span class="hl-1"> </span><span class="hl-2">"frame-1"</span><span class="hl-1">, </span><span class="hl-4">data:</span><span class="hl-1"> { </span><span class="hl-4">session:</span><span class="hl-1"> </span><span class="hl-2">"state"</span><span class="hl-1"> } });</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">session</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readSessionData</span><span class="hl-1">();</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
+
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistSessionInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistSessionInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16045">types.d.ts:16045</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.PersistSessionInstance.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistSessionInstance.html#exchangename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a>
|
| 13 |
<a href="types.PersistSessionInstance.html#framename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>frame<wbr/>Name</span></a>
|
| 14 |
<a href="types.PersistSessionInstance.html#strategyname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>strategy<wbr/>Name</span></a>
|
|
|
|
| 20 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">strategyName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Strategy identifier</p>
|
| 21 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">exchangeName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Exchange identifier</p>
|
| 22 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">frameName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Frame identifier (also used as entity ID)</p>
|
| 23 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistSessionInstance.html" class="tsd-signature-type tsd-kind-class">PersistSessionInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16058">types.d.ts:16058</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="exchangename" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>exchange<wbr/>Name</span><a href="#exchangename" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">exchangeName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16047">types.d.ts:16047</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="framename" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>frame<wbr/>Name</span><a href="#framename" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">frameName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16048">types.d.ts:16048</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="strategyname" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>strategy<wbr/>Name</span><a href="#strategyname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">strategyName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16046">types.d.ts:16046</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="dispose" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>dispose</span><a href="#dispose" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="dispose-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">dispose</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#dispose-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>No-op for the default file-based implementation.
|
| 24 |
Resource cleanup (memo cache invalidation) is handled by PersistSessionUtils.dispose().</p>
|
| 25 |
+
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistSessionInstance.html">IPersistSessionInstance</a>.<a href="../interfaces/types.IPersistSessionInstance.html#dispose">dispose</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16083">types.d.ts:16083</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="readsessiondata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>read<wbr/>Session<wbr/>Data</span><a href="#readsessiondata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="readsessiondata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">readSessionData</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.SessionData.html" class="tsd-signature-type tsd-kind-type-alias">SessionData</a><span class="tsd-signature-symbol">></span><a href="#readsessiondata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Reads the persisted session data using <code>frameName</code> as the entity key.</p>
|
| 26 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.SessionData.html" class="tsd-signature-type tsd-kind-type-alias">SessionData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to session data or null if not found</p>
|
| 27 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistSessionInstance.html">IPersistSessionInstance</a>.<a href="../interfaces/types.IPersistSessionInstance.html#readsessiondata">readSessionData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16071">types.d.ts:16071</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">initial</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the underlying PersistBase storage.</p>
|
| 28 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 29 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 30 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistSessionInstance.html">IPersistSessionInstance</a>.<a href="../interfaces/types.IPersistSessionInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16065">types.d.ts:16065</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="writesessiondata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write<wbr/>Session<wbr/>Data</span><a href="#writesessiondata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="writesessiondata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">writeSessionData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.SessionData.html" class="tsd-signature-type tsd-kind-type-alias">SessionData</a><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">_when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#writesessiondata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Writes the session data using <code>frameName</code> as the entity key.</p>
|
| 31 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <a href="../types/types.SessionData.html" class="tsd-signature-type tsd-kind-type-alias">SessionData</a></span><div class="tsd-comment tsd-typography"><p>Session data to persist</p>
|
| 32 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 33 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistSessionInstance.html">IPersistSessionInstance</a>.<a href="../interfaces/types.IPersistSessionInstance.html#writesessiondata">writeSessionData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16078">types.d.ts:16078</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#exchangename" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a><a href="#framename" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>frame<wbr/>Name</span></a><a href="#strategyname" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>strategy<wbr/>Name</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#dispose" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>dispose</span></a><a href="#readsessiondata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Session<wbr/>Data</span></a><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a><a href="#writesessiondata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Session<wbr/>Data</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 34 |
|
| 35 |
<!-- Yandex.Metrika counter -->
|
| 36 |
<script type="text/javascript">
|
classes/types.PersistSignalInstance.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistSignalInstance</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">, </span><span class="hl-2">"binance"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeSignalData</span><span class="hl-1">(</span><span class="hl-4">signalRow</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">restored</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readSignalData</span><span class="hl-1">();</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
-
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistSignalInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistSignalInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistSignalInstance.html#exchangename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a>
|
| 13 |
<a href="types.PersistSignalInstance.html#strategyname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>strategy<wbr/>Name</span></a>
|
| 14 |
<a href="types.PersistSignalInstance.html#symbol" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>symbol</span></a>
|
|
@@ -19,16 +19,16 @@
|
|
| 19 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">symbol</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Trading pair symbol</p>
|
| 20 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">strategyName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Strategy identifier</p>
|
| 21 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">exchangeName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Exchange identifier</p>
|
| 22 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistSignalInstance.html" class="tsd-signature-type tsd-kind-class">PersistSignalInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 23 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.ISignalRow.html" class="tsd-signature-type tsd-kind-interface">ISignalRow</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to the signal or null if not found</p>
|
| 24 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistSignalInstance.html">IPersistSignalInstance</a>.<a href="../interfaces/types.IPersistSignalInstance.html#readsignaldata">readSignalData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 25 |
Delegates to PersistBase.waitForInit which uses singleshot.</p>
|
| 26 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 27 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 28 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistSignalInstance.html">IPersistSignalInstance</a>.<a href="../interfaces/types.IPersistSignalInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 29 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalRow</span>: <a href="../interfaces/types.ISignalRow.html" class="tsd-signature-type tsd-kind-interface">ISignalRow</a></span><div class="tsd-comment tsd-typography"><p>Signal data to persist, or null to clear</p>
|
| 30 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 31 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistSignalInstance.html">IPersistSignalInstance</a>.<a href="../interfaces/types.IPersistSignalInstance.html#writesignaldata">writeSignalData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 32 |
|
| 33 |
<!-- Yandex.Metrika counter -->
|
| 34 |
<script type="text/javascript">
|
|
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistSignalInstance</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, </span><span class="hl-2">"my-strategy"</span><span class="hl-1">, </span><span class="hl-2">"binance"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeSignalData</span><span class="hl-1">(</span><span class="hl-4">signalRow</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">restored</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readSignalData</span><span class="hl-1">();</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
+
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistSignalInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistSignalInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13402">types.d.ts:13402</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.PersistSignalInstance.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistSignalInstance.html#exchangename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a>
|
| 13 |
<a href="types.PersistSignalInstance.html#strategyname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>strategy<wbr/>Name</span></a>
|
| 14 |
<a href="types.PersistSignalInstance.html#symbol" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>symbol</span></a>
|
|
|
|
| 19 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">symbol</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Trading pair symbol</p>
|
| 20 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">strategyName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Strategy identifier</p>
|
| 21 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">exchangeName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Exchange identifier</p>
|
| 22 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistSignalInstance.html" class="tsd-signature-type tsd-kind-class">PersistSignalInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13415">types.d.ts:13415</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="exchangename" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>exchange<wbr/>Name</span><a href="#exchangename" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">exchangeName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13405">types.d.ts:13405</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="strategyname" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>strategy<wbr/>Name</span><a href="#strategyname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">strategyName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13404">types.d.ts:13404</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="symbol" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>symbol</span><a href="#symbol" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">symbol</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13403">types.d.ts:13403</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="readsignaldata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>read<wbr/>Signal<wbr/>Data</span><a href="#readsignaldata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="readsignaldata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">readSignalData</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.ISignalRow.html" class="tsd-signature-type tsd-kind-interface">ISignalRow</a><span class="tsd-signature-symbol">></span><a href="#readsignaldata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Reads the persisted signal using <code>symbol</code> as the entity key.</p>
|
| 23 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.ISignalRow.html" class="tsd-signature-type tsd-kind-interface">ISignalRow</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to the signal or null if not found</p>
|
| 24 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistSignalInstance.html">IPersistSignalInstance</a>.<a href="../interfaces/types.IPersistSignalInstance.html#readsignaldata">readSignalData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13429">types.d.ts:13429</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">initial</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the underlying PersistBase storage.
|
| 25 |
Delegates to PersistBase.waitForInit which uses singleshot.</p>
|
| 26 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 27 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 28 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistSignalInstance.html">IPersistSignalInstance</a>.<a href="../interfaces/types.IPersistSignalInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13423">types.d.ts:13423</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="writesignaldata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write<wbr/>Signal<wbr/>Data</span><a href="#writesignaldata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="writesignaldata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">writeSignalData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">signalRow</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/types.ISignalRow.html" class="tsd-signature-type tsd-kind-interface">ISignalRow</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#writesignaldata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Writes the signal (or null to clear) using <code>symbol</code> as the entity key.</p>
|
| 29 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalRow</span>: <a href="../interfaces/types.ISignalRow.html" class="tsd-signature-type tsd-kind-interface">ISignalRow</a></span><div class="tsd-comment tsd-typography"><p>Signal data to persist, or null to clear</p>
|
| 30 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 31 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistSignalInstance.html">IPersistSignalInstance</a>.<a href="../interfaces/types.IPersistSignalInstance.html#writesignaldata">writeSignalData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L13436">types.d.ts:13436</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#exchangename" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>exchange<wbr/>Name</span></a><a href="#strategyname" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>strategy<wbr/>Name</span></a><a href="#symbol" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>symbol</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#readsignaldata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Signal<wbr/>Data</span></a><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a><a href="#writesignaldata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Signal<wbr/>Data</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 32 |
|
| 33 |
<!-- Yandex.Metrika counter -->
|
| 34 |
<script type="text/javascript">
|
classes/types.PersistStateInstance.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistStateInstance</span><span class="hl-1">(</span><span class="hl-2">"signal-1"</span><span class="hl-1">, </span><span class="hl-2">"counter"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeStateData</span><span class="hl-1">({ </span><span class="hl-4">id:</span><span class="hl-1"> </span><span class="hl-2">"counter"</span><span class="hl-1">, </span><span class="hl-4">data:</span><span class="hl-1"> { </span><span class="hl-4">count:</span><span class="hl-1"> </span><span class="hl-7">1</span><span class="hl-1"> } });</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">state</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readStateData</span><span class="hl-1">();</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
-
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistStateInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistStateInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistStateInstance.html#bucketname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bucket<wbr/>Name</span></a>
|
| 13 |
<a href="types.PersistStateInstance.html#signalid" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>signal<wbr/>Id</span></a>
|
| 14 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.PersistStateInstance.html#dispose" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>dispose</span></a>
|
|
@@ -18,17 +18,17 @@
|
|
| 18 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorpersiststateinstance" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">PersistStateInstance</span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.PersistStateInstance.html" class="tsd-signature-type tsd-kind-class">PersistStateInstance</a><a href="#constructorpersiststateinstance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates new state persistence instance.</p>
|
| 19 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier (folder name under state/)</p>
|
| 20 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">bucketName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Bucket name (file name)</p>
|
| 21 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistStateInstance.html" class="tsd-signature-type tsd-kind-class">PersistStateInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 22 |
Resource cleanup (memo cache invalidation) is handled by PersistStateUtils.dispose().</p>
|
| 23 |
-
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistStateInstance.html">IPersistStateInstance</a>.<a href="../interfaces/types.IPersistStateInstance.html#dispose">dispose</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 24 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.StateData.html" class="tsd-signature-type tsd-kind-type-alias">StateData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to state data or null if not found</p>
|
| 25 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistStateInstance.html">IPersistStateInstance</a>.<a href="../interfaces/types.IPersistStateInstance.html#readstatedata">readStateData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 26 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 27 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 28 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistStateInstance.html">IPersistStateInstance</a>.<a href="../interfaces/types.IPersistStateInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 29 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <a href="../types/types.StateData.html" class="tsd-signature-type tsd-kind-type-alias">StateData</a></span><div class="tsd-comment tsd-typography"><p>State data to persist</p>
|
| 30 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 31 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistStateInstance.html">IPersistStateInstance</a>.<a href="../interfaces/types.IPersistStateInstance.html#writestatedata">writeStateData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 32 |
|
| 33 |
<!-- Yandex.Metrika counter -->
|
| 34 |
<script type="text/javascript">
|
|
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistStateInstance</span><span class="hl-1">(</span><span class="hl-2">"signal-1"</span><span class="hl-1">, </span><span class="hl-2">"counter"</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeStateData</span><span class="hl-1">({ </span><span class="hl-4">id:</span><span class="hl-1"> </span><span class="hl-2">"counter"</span><span class="hl-1">, </span><span class="hl-4">data:</span><span class="hl-1"> { </span><span class="hl-4">count:</span><span class="hl-1"> </span><span class="hl-7">1</span><span class="hl-1"> } });</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">state</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readStateData</span><span class="hl-1">();</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
+
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistStateInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistStateInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15855">types.d.ts:15855</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.PersistStateInstance.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistStateInstance.html#bucketname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bucket<wbr/>Name</span></a>
|
| 13 |
<a href="types.PersistStateInstance.html#signalid" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>signal<wbr/>Id</span></a>
|
| 14 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.PersistStateInstance.html#dispose" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>dispose</span></a>
|
|
|
|
| 18 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorpersiststateinstance" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">PersistStateInstance</span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.PersistStateInstance.html" class="tsd-signature-type tsd-kind-class">PersistStateInstance</a><a href="#constructorpersiststateinstance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates new state persistence instance.</p>
|
| 19 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier (folder name under state/)</p>
|
| 20 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">bucketName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Bucket name (file name)</p>
|
| 21 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistStateInstance.html" class="tsd-signature-type tsd-kind-class">PersistStateInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15866">types.d.ts:15866</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="bucketname" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>bucket<wbr/>Name</span><a href="#bucketname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15857">types.d.ts:15857</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="signalid" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>signal<wbr/>Id</span><a href="#signalid" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15856">types.d.ts:15856</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="dispose" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>dispose</span><a href="#dispose" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="dispose-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">dispose</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#dispose-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>No-op for the default file-based implementation.
|
| 22 |
Resource cleanup (memo cache invalidation) is handled by PersistStateUtils.dispose().</p>
|
| 23 |
+
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistStateInstance.html">IPersistStateInstance</a>.<a href="../interfaces/types.IPersistStateInstance.html#dispose">dispose</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15891">types.d.ts:15891</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="readstatedata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>read<wbr/>State<wbr/>Data</span><a href="#readstatedata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="readstatedata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">readStateData</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.StateData.html" class="tsd-signature-type tsd-kind-type-alias">StateData</a><span class="tsd-signature-symbol">></span><a href="#readstatedata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Reads the persisted state using <code>bucketName</code> as the entity key.</p>
|
| 24 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.StateData.html" class="tsd-signature-type tsd-kind-type-alias">StateData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to state data or null if not found</p>
|
| 25 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistStateInstance.html">IPersistStateInstance</a>.<a href="../interfaces/types.IPersistStateInstance.html#readstatedata">readStateData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15879">types.d.ts:15879</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">initial</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the underlying PersistBase storage.</p>
|
| 26 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 27 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 28 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistStateInstance.html">IPersistStateInstance</a>.<a href="../interfaces/types.IPersistStateInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15873">types.d.ts:15873</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="writestatedata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write<wbr/>State<wbr/>Data</span><a href="#writestatedata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="writestatedata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">writeStateData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.StateData.html" class="tsd-signature-type tsd-kind-type-alias">StateData</a><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">_when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#writestatedata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Writes the state using <code>bucketName</code> as the entity key.</p>
|
| 29 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <a href="../types/types.StateData.html" class="tsd-signature-type tsd-kind-type-alias">StateData</a></span><div class="tsd-comment tsd-typography"><p>State data to persist</p>
|
| 30 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">_when</span>: <span class="tsd-signature-type">Date</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when write is complete</p>
|
| 31 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistStateInstance.html">IPersistStateInstance</a>.<a href="../interfaces/types.IPersistStateInstance.html#writestatedata">writeStateData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L15886">types.d.ts:15886</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#bucketname" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bucket<wbr/>Name</span></a><a href="#signalid" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>signal<wbr/>Id</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#dispose" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>dispose</span></a><a href="#readstatedata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>State<wbr/>Data</span></a><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a><a href="#writestatedata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>State<wbr/>Data</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 32 |
|
| 33 |
<!-- Yandex.Metrika counter -->
|
| 34 |
<script type="text/javascript">
|
classes/types.PersistStorageInstance.html
CHANGED
|
@@ -8,22 +8,22 @@
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistStorageInstance</span><span class="hl-1">(</span><span class="hl-3">false</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeStorageData</span><span class="hl-1">(</span><span class="hl-4">signals</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">all</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readStorageData</span><span class="hl-1">();</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
-
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistStorageInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistStorageInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistStorageInstance.html#backtest" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>backtest</span></a>
|
| 13 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.PersistStorageInstance.html#readstoragedata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Storage<wbr/>Data</span></a>
|
| 14 |
<a href="types.PersistStorageInstance.html#waitforinit" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a>
|
| 15 |
<a href="types.PersistStorageInstance.html#writestoragedata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Storage<wbr/>Data</span></a>
|
| 16 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorpersiststorageinstance" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">PersistStorageInstance</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">backtest</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.PersistStorageInstance.html" class="tsd-signature-type tsd-kind-class">PersistStorageInstance</a><a href="#constructorpersiststorageinstance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates new signal storage persistence instance.</p>
|
| 17 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">backtest</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>True for backtest mode storage, false for live mode</p>
|
| 18 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistStorageInstance.html" class="tsd-signature-type tsd-kind-class">PersistStorageInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 19 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.StorageData.html" class="tsd-signature-type tsd-kind-type-alias">StorageData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to array of signal entries</p>
|
| 20 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistStorageInstance.html">IPersistStorageInstance</a>.<a href="../interfaces/types.IPersistStorageInstance.html#readstoragedata">readStorageData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 21 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 22 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 23 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistStorageInstance.html">IPersistStorageInstance</a>.<a href="../interfaces/types.IPersistStorageInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 24 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signals</span>: <a href="../types/types.StorageData.html" class="tsd-signature-type tsd-kind-type-alias">StorageData</a></span><div class="tsd-comment tsd-typography"><p>Signal entries to persist</p>
|
| 25 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when all writes are complete</p>
|
| 26 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistStorageInstance.html">IPersistStorageInstance</a>.<a href="../interfaces/types.IPersistStorageInstance.html#writestoragedata">writeStorageData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 27 |
|
| 28 |
<!-- Yandex.Metrika counter -->
|
| 29 |
<script type="text/javascript">
|
|
|
|
| 8 |
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">instance</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">PersistStorageInstance</span><span class="hl-1">(</span><span class="hl-3">false</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">waitForInit</span><span class="hl-1">(</span><span class="hl-3">true</span><span class="hl-1">);</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">writeStorageData</span><span class="hl-1">(</span><span class="hl-4">signals</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">all</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">instance</span><span class="hl-1">.</span><span class="hl-0">readStorageData</span><span class="hl-1">();</span>
|
| 9 |
</code><button type="button">Copy</button></pre>
|
| 10 |
|
| 11 |
+
</div></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/types.IPersistStorageInstance.html" class="tsd-signature-type tsd-kind-interface">IPersistStorageInstance</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14500">types.d.ts:14500</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.PersistStorageInstance.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 12 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.PersistStorageInstance.html#backtest" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>backtest</span></a>
|
| 13 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="types.PersistStorageInstance.html#readstoragedata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Storage<wbr/>Data</span></a>
|
| 14 |
<a href="types.PersistStorageInstance.html#waitforinit" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a>
|
| 15 |
<a href="types.PersistStorageInstance.html#writestoragedata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Storage<wbr/>Data</span></a>
|
| 16 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorpersiststorageinstance" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">PersistStorageInstance</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">backtest</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.PersistStorageInstance.html" class="tsd-signature-type tsd-kind-class">PersistStorageInstance</a><a href="#constructorpersiststorageinstance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates new signal storage persistence instance.</p>
|
| 17 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">backtest</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>True for backtest mode storage, false for live mode</p>
|
| 18 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.PersistStorageInstance.html" class="tsd-signature-type tsd-kind-class">PersistStorageInstance</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14509">types.d.ts:14509</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="backtest" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>backtest</span><a href="#backtest" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">backtest</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14501">types.d.ts:14501</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="readstoragedata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>read<wbr/>Storage<wbr/>Data</span><a href="#readstoragedata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="readstoragedata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">readStorageData</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.StorageData.html" class="tsd-signature-type tsd-kind-type-alias">StorageData</a><span class="tsd-signature-symbol">></span><a href="#readstoragedata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Reads all persisted signals by iterating storage keys.</p>
|
| 19 |
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/types.StorageData.html" class="tsd-signature-type tsd-kind-type-alias">StorageData</a><span class="tsd-signature-symbol">></span></h4><p>Promise resolving to array of signal entries</p>
|
| 20 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistStorageInstance.html">IPersistStorageInstance</a>.<a href="../interfaces/types.IPersistStorageInstance.html#readstoragedata">readStorageData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14522">types.d.ts:14522</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">initial</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the underlying PersistBase storage.</p>
|
| 21 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization</p>
|
| 22 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 23 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistStorageInstance.html">IPersistStorageInstance</a>.<a href="../interfaces/types.IPersistStorageInstance.html#waitforinit">waitForInit</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14516">types.d.ts:14516</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="writestoragedata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write<wbr/>Storage<wbr/>Data</span><a href="#writestoragedata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="writestoragedata-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">writeStorageData</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">signals</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.StorageData.html" class="tsd-signature-type tsd-kind-type-alias">StorageData</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#writestoragedata-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Writes each signal as a separate entity keyed by <code>signal.id</code>.</p>
|
| 24 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signals</span>: <a href="../types/types.StorageData.html" class="tsd-signature-type tsd-kind-type-alias">StorageData</a></span><div class="tsd-comment tsd-typography"><p>Signal entries to persist</p>
|
| 25 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when all writes are complete</p>
|
| 26 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of <a href="../interfaces/types.IPersistStorageInstance.html">IPersistStorageInstance</a>.<a href="../interfaces/types.IPersistStorageInstance.html#writestoragedata">writeStorageData</a></p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L14529">types.d.ts:14529</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#backtest" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>backtest</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#readstoragedata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>read<wbr/>Storage<wbr/>Data</span></a><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a><a href="#writestoragedata" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write<wbr/>Storage<wbr/>Data</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 27 |
|
| 28 |
<!-- Yandex.Metrika counter -->
|
| 29 |
<script type="text/javascript">
|
classes/types.Position.html
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Position | backtest-kit</title><meta name="description" content="Documentation for backtest-kit"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">backtest-kit</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">backtest-kit</a></li><li><a href="../modules/types.html">types</a></li><li><a href="types.Position.html">Position</a></li></ul><h1>Class Position</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Utilities for calculating take profit and stop loss price levels.
|
| 2 |
Automatically inverts direction based on position type (long/short).</p>
|
| 3 |
-
</div><div class="tsd-comment tsd-typography"></div></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 4 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.Position.html#bracket" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bracket</span></a>
|
| 5 |
<a href="types.Position.html#moonbag" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>moonbag</span></a>
|
| 6 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorposition" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">Position</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="types.Position.html" class="tsd-signature-type tsd-kind-class">Position</a><a href="#constructorposition" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="types.Position.html" class="tsd-signature-type tsd-kind-class">Position</a></h4></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="bracket" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>bracket</span><a href="#bracket" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">bracket</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">currentPrice</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">percentStopLoss</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">percentTakeProfit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"long"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β <span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"long"</span><br/>Β Β Β Β <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">priceStopLoss</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">priceTakeProfit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>Calculates levels for a bracket order with custom TP and SL.</p>
|
|
@@ -9,12 +9,12 @@ Automatically inverts direction based on position type (long/short).</p>
|
|
| 9 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">percentTakeProfit</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><p>take profit percentage from 0 to 100</p>
|
| 10 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"long"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span></h5><div class="tsd-comment tsd-typography"><p>position type: "long" or "short"</p>
|
| 11 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"long"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">priceStopLoss</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">priceTakeProfit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span></h4><p>priceTakeProfit and priceStopLoss in fiat</p>
|
| 12 |
-
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 13 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">currentPrice</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">percentStopLoss</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"long"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β <span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"long"</span><br/>Β Β Β Β <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">priceStopLoss</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">priceTakeProfit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">currentPrice</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">percentStopLoss</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"long"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span> <span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">currentPrice</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><p>current asset price</p>
|
| 14 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">percentStopLoss</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><p>stop loss percentage from 0 to 100</p>
|
| 15 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"long"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span></h5><div class="tsd-comment tsd-typography"><p>position type: "long" or "short"</p>
|
| 16 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"long"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">priceStopLoss</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">priceTakeProfit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span></h4><p>priceTakeProfit and priceStopLoss in fiat</p>
|
| 17 |
-
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 18 |
|
| 19 |
<!-- Yandex.Metrika counter -->
|
| 20 |
<script type="text/javascript">
|
|
|
|
| 1 |
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Position | backtest-kit</title><meta name="description" content="Documentation for backtest-kit"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">backtest-kit</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">backtest-kit</a></li><li><a href="../modules/types.html">types</a></li><li><a href="types.Position.html">Position</a></li></ul><h1>Class Position</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Utilities for calculating take profit and stop loss price levels.
|
| 2 |
Automatically inverts direction based on position type (long/short).</p>
|
| 3 |
+
</div><div class="tsd-comment tsd-typography"></div></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L21815">types.d.ts:21815</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.Position.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 4 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.Position.html#bracket" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bracket</span></a>
|
| 5 |
<a href="types.Position.html#moonbag" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>moonbag</span></a>
|
| 6 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorposition" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">Position</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="types.Position.html" class="tsd-signature-type tsd-kind-class">Position</a><a href="#constructorposition" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="types.Position.html" class="tsd-signature-type tsd-kind-class">Position</a></h4></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="bracket" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>bracket</span><a href="#bracket" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">bracket</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">currentPrice</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">percentStopLoss</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">percentTakeProfit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"long"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β <span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"long"</span><br/>Β Β Β Β <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">priceStopLoss</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">priceTakeProfit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>Calculates levels for a bracket order with custom TP and SL.</p>
|
|
|
|
| 9 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">percentTakeProfit</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><p>take profit percentage from 0 to 100</p>
|
| 10 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"long"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span></h5><div class="tsd-comment tsd-typography"><p>position type: "long" or "short"</p>
|
| 11 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"long"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">priceStopLoss</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">priceTakeProfit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span></h4><p>priceTakeProfit and priceStopLoss in fiat</p>
|
| 12 |
+
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L21840">types.d.ts:21840</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="moonbag" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>moonbag</span><a href="#moonbag" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">moonbag</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">currentPrice</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">percentStopLoss</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"long"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β <span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"long"</span><br/>Β Β Β Β <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">priceStopLoss</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">priceTakeProfit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>Calculates levels for the "moonbag" strategy β fixed TP at 50% from the current price.</p>
|
| 13 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">currentPrice</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">percentStopLoss</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"long"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β <span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"long"</span><br/>Β Β Β Β <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">priceStopLoss</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-kind-property">priceTakeProfit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">currentPrice</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">percentStopLoss</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"long"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span> <span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">currentPrice</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><p>current asset price</p>
|
| 14 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">percentStopLoss</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><p>stop loss percentage from 0 to 100</p>
|
| 15 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"long"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span></h5><div class="tsd-comment tsd-typography"><p>position type: "long" or "short"</p>
|
| 16 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">position</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"long"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"short"</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">priceStopLoss</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">priceTakeProfit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span></h4><p>priceTakeProfit and priceStopLoss in fiat</p>
|
| 17 |
+
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L21823">types.d.ts:21823</a></li></ul></aside></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#bracket" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>bracket</span></a><a href="#moonbag" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>moonbag</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 18 |
|
| 19 |
<!-- Yandex.Metrika counter -->
|
| 20 |
<script type="text/javascript">
|
classes/types.ReportBase.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
| 11 |
<p>File format: ./dump/report/{reportName}.jsonl
|
| 12 |
Each line contains: reportName, data, metadata, timestamp</p>
|
| 13 |
<p>Use this adapter for event logging and post-processing analytics.</p>
|
| 14 |
-
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../types/types.TReportBase.html" class="tsd-signature-type tsd-kind-type-alias">TReportBase</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 15 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.ReportBase.html#_filepath" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_file<wbr/>Path</span></a>
|
| 16 |
<a href="types.ReportBase.html#_stream" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_stream</span></a>
|
| 17 |
<a href="types.ReportBase.html#wait_for_init_symbol" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>[WAIT_<wbr/>FOR_<wbr/>INIT_<wbr/>SYMBOL]</span></a>
|
|
@@ -23,19 +23,19 @@ Each line contains: reportName, data, metadata, timestamp</p>
|
|
| 23 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorreportbase" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">ReportBase</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">reportName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">keyof</span> <span class="tsd-signature-type">IReportTarget</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">baseDir</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.ReportBase.html" class="tsd-signature-type tsd-kind-class">ReportBase</a><a href="#constructorreportbase" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates a new JSONL report adapter instance.</p>
|
| 24 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">reportName</span>: <span class="tsd-signature-keyword">keyof</span> <span class="tsd-signature-type">IReportTarget</span></span><div class="tsd-comment tsd-typography"><p>Type of report (backtest, live, walker, etc.)</p>
|
| 25 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">baseDir</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Base directory for report files, defaults to ./dump/report</p>
|
| 26 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.ReportBase.html" class="tsd-signature-type tsd-kind-class">ReportBase</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 27 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 28 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 29 |
Protected by singleshot to ensure one-time execution.
|
| 30 |
Sets up error handler that emits to exitEmitter.</p>
|
| 31 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 32 |
Waits for drain event if write buffer is full.
|
| 33 |
Times out after 15 seconds and returns TIMEOUT_SYMBOL.</p>
|
| 34 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 35 |
Safe to call multiple times - singleshot ensures one-time execution.</p>
|
| 36 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization (informational only)</p>
|
| 37 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 38 |
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TReportBase.waitForInit</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 39 |
Appends a single line with JSON object containing:</p>
|
| 40 |
<ul>
|
| 41 |
<li>reportName: Type of report</li>
|
|
@@ -46,7 +46,7 @@ Appends a single line with JSON object containing:</p>
|
|
| 46 |
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="writet" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span> = <span class="tsd-signature-type">any</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="types.ReportBase.html#writet">T</a></span><div class="tsd-comment tsd-typography"><p>Event data object to write</p>
|
| 47 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/types.IReportDumpOptions.html" class="tsd-signature-type tsd-kind-interface">IReportDumpOptions</a></span><div class="tsd-comment tsd-typography"><p>Metadata options for filtering and search</p>
|
| 48 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws" class="tsd-anchor"></a>Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Error if stream not initialized or write timeout exceeded</p>
|
| 49 |
-
</div></div><aside class="tsd-sources"><p>Implementation of TReportBase.write</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 50 |
|
| 51 |
<!-- Yandex.Metrika counter -->
|
| 52 |
<script type="text/javascript">
|
|
|
|
| 11 |
<p>File format: ./dump/report/{reportName}.jsonl
|
| 12 |
Each line contains: reportName, data, metadata, timestamp</p>
|
| 13 |
<p>Use this adapter for event logging and post-processing analytics.</p>
|
| 14 |
+
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../types/types.TReportBase.html" class="tsd-signature-type tsd-kind-type-alias">TReportBase</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16541">types.d.ts:16541</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.ReportBase.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 15 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.ReportBase.html#_filepath" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_file<wbr/>Path</span></a>
|
| 16 |
<a href="types.ReportBase.html#_stream" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_stream</span></a>
|
| 17 |
<a href="types.ReportBase.html#wait_for_init_symbol" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>[WAIT_<wbr/>FOR_<wbr/>INIT_<wbr/>SYMBOL]</span></a>
|
|
|
|
| 23 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorreportbase" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">ReportBase</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">reportName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">keyof</span> <span class="tsd-signature-type">IReportTarget</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">baseDir</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="types.ReportBase.html" class="tsd-signature-type tsd-kind-class">ReportBase</a><a href="#constructorreportbase" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates a new JSONL report adapter instance.</p>
|
| 24 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">reportName</span>: <span class="tsd-signature-keyword">keyof</span> <span class="tsd-signature-type">IReportTarget</span></span><div class="tsd-comment tsd-typography"><p>Type of report (backtest, live, walker, etc.)</p>
|
| 25 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">baseDir</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Base directory for report files, defaults to ./dump/report</p>
|
| 26 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="types.ReportBase.html" class="tsd-signature-type tsd-kind-class">ReportBase</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16554">types.d.ts:16554</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="_filepath" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>_file<wbr/>Path</span><a href="#_filepath" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">_filePath</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Absolute path to the JSONL file for this report type</p>
|
| 27 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16545">types.d.ts:16545</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="_stream" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>_stream</span><a href="#_stream" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">_stream</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">WriteStream</span></div><div class="tsd-comment tsd-typography"><p>WriteStream instance for append-only writes, null until initialized</p>
|
| 28 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16547">types.d.ts:16547</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="wait_for_init_symbol" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>[WAIT_<wbr/>FOR_<wbr/>INIT_<wbr/>SYMBOL]</span><a href="#wait_for_init_symbol" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">"[WAIT_FOR_INIT_SYMBOL]"</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-type">ISingleshotClearable</span><span class="tsd-signature-symbol"><</span><br/>Β Β Β Β <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>Singleshot initialization function that creates directory and stream.
|
| 29 |
Protected by singleshot to ensure one-time execution.
|
| 30 |
Sets up error handler that emits to exitEmitter.</p>
|
| 31 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16560">types.d.ts:16560</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="write_safe_symbol" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>[WRITE_<wbr/>SAFE_<wbr/>SYMBOL]</span><a href="#write_safe_symbol" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">"[WRITE_SAFE_SYMBOL]"</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">IWrappedQueuedFn</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">symbol</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-symbol">[</span>line<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>Timeout-protected write function with backpressure handling.
|
| 32 |
Waits for drain event if write buffer is full.
|
| 33 |
Times out after 15 seconds and returns TIMEOUT_SYMBOL.</p>
|
| 34 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16566">types.d.ts:16566</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="basedir" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>base<wbr/>Dir</span><a href="#basedir" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">baseDir</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16543">types.d.ts:16543</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="reportname" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>report<wbr/>Name</span><a href="#reportname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">reportName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">keyof</span> <span class="tsd-signature-type">IReportTarget</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16542">types.d.ts:16542</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="waitforinit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>wait<wbr/>For<wbr/>Init</span><a href="#waitforinit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="waitforinit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">waitForInit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">initial</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#waitforinit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes the JSONL file and write stream.
|
| 35 |
Safe to call multiple times - singleshot ensures one-time execution.</p>
|
| 36 |
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">initial</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether this is the first initialization (informational only)</p>
|
| 37 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves when initialization is complete</p>
|
| 38 |
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TReportBase.waitForInit</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16574">types.d.ts:16574</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><a id="write" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>write</span><a href="#write" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="write-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">write</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="types.ReportBase.html#writet">T</a> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="types.ReportBase.html#writet">T</a><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/types.IReportDumpOptions.html" class="tsd-signature-type tsd-kind-interface">IReportDumpOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#write-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Writes event data to JSONL file with metadata.
|
| 39 |
Appends a single line with JSON object containing:</p>
|
| 40 |
<ul>
|
| 41 |
<li>reportName: Type of report</li>
|
|
|
|
| 46 |
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="writet" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span> = <span class="tsd-signature-type">any</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="types.ReportBase.html#writet">T</a></span><div class="tsd-comment tsd-typography"><p>Event data object to write</p>
|
| 47 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/types.IReportDumpOptions.html" class="tsd-signature-type tsd-kind-interface">IReportDumpOptions</a></span><div class="tsd-comment tsd-typography"><p>Metadata options for filtering and search</p>
|
| 48 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws" class="tsd-anchor"></a>Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Error if stream not initialized or write timeout exceeded</p>
|
| 49 |
+
</div></div><aside class="tsd-sources"><p>Implementation of TReportBase.write</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L16587">types.d.ts:16587</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#_filepath" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_file<wbr/>Path</span></a><a href="#_stream" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_stream</span></a><a href="#wait_for_init_symbol" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>[WAIT_<wbr/>FOR_<wbr/>INIT_<wbr/>SYMBOL]</span></a><a href="#write_safe_symbol" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>[WRITE_<wbr/>SAFE_<wbr/>SYMBOL]</span></a><a href="#basedir" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>base<wbr/>Dir</span></a><a href="#reportname" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>report<wbr/>Name</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#waitforinit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Init</span></a><a href="#write" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>write</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 50 |
|
| 51 |
<!-- Yandex.Metrika counter -->
|
| 52 |
<script type="text/javascript">
|
classes/types.StateBacktestAdapter.html
CHANGED
|
@@ -13,7 +13,7 @@ SL trades never go positive (Feb25) or show peak < 0.15% (Feb08, Feb13).
|
|
| 13 |
Rule: if position open >= N minutes and peakPercent < threshold (e.g. 0.3%),
|
| 14 |
the LLM thesis was not confirmed by market β exit immediately.
|
| 15 |
State tracks <code>{ peakPercent, minutesOpen }</code> per signal across onActivePing ticks.</p>
|
| 16 |
-
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><span class="tsd-signature-type">TStateAdapter</span></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 17 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.StateBacktestAdapter.html#clear" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>clear</span></a>
|
| 18 |
<a href="types.StateBacktestAdapter.html#disposesignal" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dispose<wbr/>Signal</span></a>
|
| 19 |
<a href="types.StateBacktestAdapter.html#getstate" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>get<wbr/>State</span></a>
|
|
@@ -25,30 +25,30 @@ State tracks <code>{ peakPercent, minutesOpen }</code> per signal across onActiv
|
|
| 25 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorstatebacktestadapter" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">StateBacktestAdapter</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="types.StateBacktestAdapter.html" class="tsd-signature-type tsd-kind-class">StateBacktestAdapter</a><a href="#constructorstatebacktestadapter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="types.StateBacktestAdapter.html" class="tsd-signature-type tsd-kind-class">StateBacktestAdapter</a></h4></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="clear" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>clear</span><a href="#clear" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">clear</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Clears the memoized instance cache.
|
| 26 |
Call this when process.cwd() changes between strategy iterations
|
| 27 |
so new instances are created with the updated base path.</p>
|
| 28 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 29 |
Called by StateAdapter when a signal is cancelled or closed.</p>
|
| 30 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier to dispose</p>
|
| 31 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 32 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Value</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 33 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">object</span></h5><div class="tsd-comment tsd-typography"><p>Default value when no persisted state exists</p>
|
| 34 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 35 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp at which the read is happening (look-ahead guard)</p>
|
| 36 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></h4><p>Current state value</p>
|
| 37 |
-
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TStateAdapter.getState</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 38 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dispatch</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Dispatch</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Value</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dispatch</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Dispatch</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>New value or updater function receiving current value</p>
|
| 39 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 40 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">object</span></h5><div class="tsd-comment tsd-typography"><p>Default value when no persisted state exists</p>
|
| 41 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 42 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp this value belongs to</p>
|
| 43 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></h4><p>Updated state value</p>
|
| 44 |
-
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TStateAdapter.setState</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 45 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 46 |
All data lives in process memory only.</p>
|
| 47 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 48 |
Data is persisted to disk via PersistStateAdapter.</p>
|
| 49 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 50 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">Ctor</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.TStateInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TStateInstanceCtor</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">Ctor</span>: <a href="../types/types.TStateInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TStateInstanceCtor</a></span><div class="tsd-comment tsd-typography"><p>Constructor for the custom state instance</p>
|
| 51 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 52 |
|
| 53 |
<!-- Yandex.Metrika counter -->
|
| 54 |
<script type="text/javascript">
|
|
|
|
| 13 |
Rule: if position open >= N minutes and peakPercent < threshold (e.g. 0.3%),
|
| 14 |
the LLM thesis was not confirmed by market β exit immediately.
|
| 15 |
State tracks <code>{ peakPercent, minutesOpen }</code> per signal across onActivePing ticks.</p>
|
| 16 |
+
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><span class="tsd-signature-type">TStateAdapter</span></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L10029">types.d.ts:10029</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.StateBacktestAdapter.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 17 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.StateBacktestAdapter.html#clear" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>clear</span></a>
|
| 18 |
<a href="types.StateBacktestAdapter.html#disposesignal" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dispose<wbr/>Signal</span></a>
|
| 19 |
<a href="types.StateBacktestAdapter.html#getstate" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>get<wbr/>State</span></a>
|
|
|
|
| 25 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorstatebacktestadapter" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">StateBacktestAdapter</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="types.StateBacktestAdapter.html" class="tsd-signature-type tsd-kind-class">StateBacktestAdapter</a><a href="#constructorstatebacktestadapter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="types.StateBacktestAdapter.html" class="tsd-signature-type tsd-kind-class">StateBacktestAdapter</a></h4></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="clear" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>clear</span><a href="#clear" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">clear</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Clears the memoized instance cache.
|
| 26 |
Call this when process.cwd() changes between strategy iterations
|
| 27 |
so new instances are created with the updated base path.</p>
|
| 28 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L10091">types.d.ts:10091</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="disposesignal" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>dispose<wbr/>Signal</span><a href="#disposesignal" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">disposeSignal</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Disposes all memoized instances for the given signalId.
|
| 29 |
Called by StateAdapter when a signal is cancelled or closed.</p>
|
| 30 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier to dispose</p>
|
| 31 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L10037">types.d.ts:10037</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="getstate" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>State</span><a href="#getstate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">getState</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>Read the current state value for a signal.</p>
|
| 32 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Value</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 33 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">object</span></h5><div class="tsd-comment tsd-typography"><p>Default value when no persisted state exists</p>
|
| 34 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 35 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp at which the read is happening (look-ahead guard)</p>
|
| 36 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></h4><p>Current state value</p>
|
| 37 |
+
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TStateAdapter.getState</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L10046">types.d.ts:10046</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="setstate" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>set<wbr/>State</span><a href="#setstate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">setState</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dispatch</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Dispatch</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>Update the state value for a signal.</p>
|
| 38 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dispatch</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Dispatch</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Value</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dispatch</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Dispatch</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>New value or updater function receiving current value</p>
|
| 39 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 40 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">object</span></h5><div class="tsd-comment tsd-typography"><p>Default value when no persisted state exists</p>
|
| 41 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 42 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp this value belongs to</p>
|
| 43 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></h4><p>Updated state value</p>
|
| 44 |
+
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TStateAdapter.setState</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L10061">types.d.ts:10061</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="usedummy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>use<wbr/>Dummy</span><a href="#usedummy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">useDummy</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Switches to dummy adapter that discards all writes.</p>
|
| 45 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L10080">types.d.ts:10080</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="uselocal" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>use<wbr/>Local</span><a href="#uselocal" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">useLocal</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Switches to in-memory adapter (default).
|
| 46 |
All data lives in process memory only.</p>
|
| 47 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L10071">types.d.ts:10071</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="usepersist" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>use<wbr/>Persist</span><a href="#usepersist" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">usePersist</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Switches to file-system backed adapter.
|
| 48 |
Data is persisted to disk via PersistStateAdapter.</p>
|
| 49 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L10076">types.d.ts:10076</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="usestateadapter" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>use<wbr/>State<wbr/>Adapter</span><a href="#usestateadapter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">useStateAdapter</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">Ctor</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.TStateInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TStateInstanceCtor</a><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Switches to a custom state adapter implementation.</p>
|
| 50 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">Ctor</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.TStateInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TStateInstanceCtor</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">Ctor</span>: <a href="../types/types.TStateInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TStateInstanceCtor</a></span><div class="tsd-comment tsd-typography"><p>Constructor for the custom state instance</p>
|
| 51 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L10085">types.d.ts:10085</a></li></ul></aside></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#clear" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>clear</span></a><a href="#disposesignal" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dispose<wbr/>Signal</span></a><a href="#getstate" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>get<wbr/>State</span></a><a href="#setstate" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>set<wbr/>State</span></a><a href="#usedummy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use<wbr/>Dummy</span></a><a href="#uselocal" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use<wbr/>Local</span></a><a href="#usepersist" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use<wbr/>Persist</span></a><a href="#usestateadapter" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use<wbr/>State<wbr/>Adapter</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 52 |
|
| 53 |
<!-- Yandex.Metrika counter -->
|
| 54 |
<script type="text/javascript">
|
classes/types.StateLiveAdapter.html
CHANGED
|
@@ -13,7 +13,7 @@ SL trades never go positive (Feb25) or show peak < 0.15% (Feb08, Feb13).
|
|
| 13 |
Rule: if position open >= N minutes and peakPercent < threshold (e.g. 0.3%),
|
| 14 |
the LLM thesis was not confirmed by market β exit immediately.
|
| 15 |
State persists <code>{ peakPercent, minutesOpen }</code> per signal across process restarts.</p>
|
| 16 |
-
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><span class="tsd-signature-type">TStateAdapter</span></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 17 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.StateLiveAdapter.html#clear" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>clear</span></a>
|
| 18 |
<a href="types.StateLiveAdapter.html#disposesignal" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dispose<wbr/>Signal</span></a>
|
| 19 |
<a href="types.StateLiveAdapter.html#getstate" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>get<wbr/>State</span></a>
|
|
@@ -25,30 +25,30 @@ State persists <code>{ peakPercent, minutesOpen }</code> per signal across proce
|
|
| 25 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorstateliveadapter" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">StateLiveAdapter</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="types.StateLiveAdapter.html" class="tsd-signature-type tsd-kind-class">StateLiveAdapter</a><a href="#constructorstateliveadapter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="types.StateLiveAdapter.html" class="tsd-signature-type tsd-kind-class">StateLiveAdapter</a></h4></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="clear" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>clear</span><a href="#clear" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">clear</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Clears the memoized instance cache.
|
| 26 |
Call this when process.cwd() changes between strategy iterations
|
| 27 |
so new instances are created with the updated base path.</p>
|
| 28 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 29 |
Called by StateAdapter when a signal is cancelled or closed.</p>
|
| 30 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier to dispose</p>
|
| 31 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 32 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Value</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 33 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">object</span></h5><div class="tsd-comment tsd-typography"><p>Default value when no persisted state exists</p>
|
| 34 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 35 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp at which the read is happening (look-ahead guard)</p>
|
| 36 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></h4><p>Current state value</p>
|
| 37 |
-
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TStateAdapter.getState</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 38 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dispatch</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Dispatch</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Value</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dispatch</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Dispatch</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>New value or updater function receiving current value</p>
|
| 39 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 40 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">object</span></h5><div class="tsd-comment tsd-typography"><p>Default value when no persisted state exists</p>
|
| 41 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 42 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp this value belongs to</p>
|
| 43 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></h4><p>Updated state value</p>
|
| 44 |
-
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TStateAdapter.setState</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 45 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 46 |
All data lives in process memory only.</p>
|
| 47 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 48 |
Data is persisted to disk via PersistStateAdapter.</p>
|
| 49 |
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 50 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">Ctor</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.TStateInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TStateInstanceCtor</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">Ctor</span>: <a href="../types/types.TStateInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TStateInstanceCtor</a></span><div class="tsd-comment tsd-typography"><p>Constructor for the custom state instance</p>
|
| 51 |
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/
|
| 52 |
|
| 53 |
<!-- Yandex.Metrika counter -->
|
| 54 |
<script type="text/javascript">
|
|
|
|
| 13 |
Rule: if position open >= N minutes and peakPercent < threshold (e.g. 0.3%),
|
| 14 |
the LLM thesis was not confirmed by market β exit immediately.
|
| 15 |
State persists <code>{ peakPercent, minutesOpen }</code> per signal across process restarts.</p>
|
| 16 |
+
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><span class="tsd-signature-type">TStateAdapter</span></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L10110">types.d.ts:10110</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="types.StateLiveAdapter.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
| 17 |
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="types.StateLiveAdapter.html#clear" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>clear</span></a>
|
| 18 |
<a href="types.StateLiveAdapter.html#disposesignal" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dispose<wbr/>Signal</span></a>
|
| 19 |
<a href="types.StateLiveAdapter.html#getstate" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>get<wbr/>State</span></a>
|
|
|
|
| 25 |
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="constructorstateliveadapter" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">StateLiveAdapter</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="types.StateLiveAdapter.html" class="tsd-signature-type tsd-kind-class">StateLiveAdapter</a><a href="#constructorstateliveadapter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="types.StateLiveAdapter.html" class="tsd-signature-type tsd-kind-class">StateLiveAdapter</a></h4></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="clear" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>clear</span><a href="#clear" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">clear</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Clears the memoized instance cache.
|
| 26 |
Call this when process.cwd() changes between strategy iterations
|
| 27 |
so new instances are created with the updated base path.</p>
|
| 28 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L10172">types.d.ts:10172</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="disposesignal" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>dispose<wbr/>Signal</span><a href="#disposesignal" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">disposeSignal</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Disposes all memoized instances for the given signalId.
|
| 29 |
Called by StateAdapter when a signal is cancelled or closed.</p>
|
| 30 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">signalId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Signal identifier to dispose</p>
|
| 31 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L10118">types.d.ts:10118</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="getstate" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>State</span><a href="#getstate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">getState</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>Read the current state value for a signal.</p>
|
| 32 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Value</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 33 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">object</span></h5><div class="tsd-comment tsd-typography"><p>Default value when no persisted state exists</p>
|
| 34 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 35 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp at which the read is happening (look-ahead guard)</p>
|
| 36 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></h4><p>Current state value</p>
|
| 37 |
+
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TStateAdapter.getState</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L10127">types.d.ts:10127</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="setstate" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>set<wbr/>State</span><a href="#setstate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">setState</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dispatch</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Dispatch</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>Update the state value for a signal.</p>
|
| 38 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dispatch</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Dispatch</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/>Β Β Β Β <span class="tsd-kind-parameter">dto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β Β Β Β Β <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">;</span><br/>Β Β Β Β <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Value</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">object</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dispatch</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Dispatch</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>New value or updater function receiving current value</p>
|
| 39 |
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">dto</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span> <span class="tsd-signature-symbol">}</span></span><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">bucketName</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Bucket name</p>
|
| 40 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">initialValue</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">object</span></h5><div class="tsd-comment tsd-typography"><p>Default value when no persisted state exists</p>
|
| 41 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">signalId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Signal identifier</p>
|
| 42 |
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">when</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></h5><div class="tsd-comment tsd-typography"><p>Logical timestamp this value belongs to</p>
|
| 43 |
</div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="">Value</a><span class="tsd-signature-symbol">></span></h4><p>Updated state value</p>
|
| 44 |
+
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Implementation of TStateAdapter.setState</p><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L10142">types.d.ts:10142</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="usedummy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>use<wbr/>Dummy</span><a href="#usedummy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">useDummy</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Switches to dummy adapter that discards all writes.</p>
|
| 45 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L10161">types.d.ts:10161</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="uselocal" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>use<wbr/>Local</span><a href="#uselocal" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">useLocal</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Switches to in-memory adapter.
|
| 46 |
All data lives in process memory only.</p>
|
| 47 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L10152">types.d.ts:10152</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="usepersist" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>use<wbr/>Persist</span><a href="#usepersist" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">usePersist</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Switches to file-system backed adapter (default).
|
| 48 |
Data is persisted to disk via PersistStateAdapter.</p>
|
| 49 |
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L10157">types.d.ts:10157</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="usestateadapter" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>use<wbr/>State<wbr/>Adapter</span><a href="#usestateadapter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">useStateAdapter</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">Ctor</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.TStateInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TStateInstanceCtor</a><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>Switches to a custom state adapter implementation.</p>
|
| 50 |
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">Ctor</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.TStateInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TStateInstanceCtor</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">Ctor</span>: <a href="../types/types.TStateInstanceCtor.html" class="tsd-signature-type tsd-kind-type-alias">TStateInstanceCtor</a></span><div class="tsd-comment tsd-typography"><p>Constructor for the custom state instance</p>
|
| 51 |
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/tripolskypetr/backtest-kit/blob/9b442f7f9c8af48f4d670a2bf3bf9864a6006a0c/types.d.ts#L10166">types.d.ts:10166</a></li></ul></aside></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#clear" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>clear</span></a><a href="#disposesignal" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dispose<wbr/>Signal</span></a><a href="#getstate" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>get<wbr/>State</span></a><a href="#setstate" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>set<wbr/>State</span></a><a href="#usedummy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use<wbr/>Dummy</span></a><a href="#uselocal" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use<wbr/>Local</span></a><a href="#usepersist" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use<wbr/>Persist</span></a><a href="#usestateadapter" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>use<wbr/>State<wbr/>Adapter</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 52 |
|
| 53 |
<!-- Yandex.Metrika counter -->
|
| 54 |
<script type="text/javascript">
|
documents/concept_02_zero_expectation_escape.html
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>concept/02_zero_expectation_escape | backtest-kit</title><meta name="description" content="Documentation for backtest-kit"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">backtest-kit</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">backtest-kit</a></li><li><a href="concept_02_zero_expectation_escape.html">concept/02_zero_expectation_escape</a></li></ul></div><div class="tsd-panel tsd-typography"><a id="πΈ-escaping-zero-expectation-from-a-fixed-sum-game-to-a-growing-sum-game" class="tsd-anchor"></a><h1 class="tsd-anchor-link">πΈ Escaping zero expectation: from a fixed-sum game to a growing-sum game<a href="#πΈ-escaping-zero-expectation-from-a-fixed-sum-game-to-a-growing-sum-game" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h1><blockquote>
|
| 2 |
+
<p>The source code discussed in the article is published <a href="https://github.com/backtest-kit/backtest-ollama-crontab">in this repository</a>.</p>
|
| 3 |
+
</blockquote>
|
| 4 |
+
<p><img src="../media/cover_zero_expectation_escape.jpg" alt="cover_zero_expectation_escape"></p>
|
| 5 |
+
<p>Any trading strategy, on an infinite time horizon, tends toward zero expected value per trade: you earned nothing, you paid the exchange a commission. One might assume this is due to information leakage, that the strategy is being used by other market participants and they take the liquidity. But the reason is different: it is the fundamental law of large numbers. Market volume is forecastable, which means it is a finite sum. In a game with a finite sum the capital on the market is constant and only migrates between participants: your earnings are someone's losses.</p>
|
| 6 |
+
<p><img src="../media/luxalgo_plateau.png" alt="luxalgo_plateau"></p>
|
| 7 |
+
<p>Look at the chart: portfolio return growth first increases, then runs into a plateau without any pronounced upward or downward movement. The nearest analogy: an object thrown upward, when acceleration and gravity balance out, stops at a point and then falls back down.</p>
|
| 8 |
+
<a id="a-game-with-a-finite-sum" class="tsd-anchor"></a><h2 class="tsd-anchor-link">A game with a finite sum<a href="#a-game-with-a-finite-sum" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Any effective quant strategy is an exploit of a market inefficiency. As soon as everyone uses the exploit β the inefficiency disappears, because what created it in the first place was precisely the fact that <strong>nobody was arbitraging it</strong>. The market comes into equilibrium. And equilibrium for a participant means a simple thing: the mathematical expectation of a trade becomes <strong>zero minus exchange commission</strong>. Not "a small profit", but a strictly negative number.</p>
|
| 9 |
+
<a id="escape-into-a-game-with-a-growing-sum" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Escape into a game with a growing sum<a href="#escape-into-a-game-with-a-growing-sum" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><p>There is only one way out of this trap: look at what brings money into the system from the outside, rather than redistributing what is already there. One might think this is the accounting reports of companies or funds, but no: the publication of accounting data does not guarantee deterministic behavior of market participants. Mathematically, the guarantee of a growing-sum game is a direct recommendation to the public, if its size tends to infinity.</p>
|
| 10 |
+
<a id="piggybacking-to-paradise" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Piggybacking to paradise<a href="#piggybacking-to-paradise" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Earlier I covered <a href="article_08_ai_liquidity_harvesting.html">the stop hunting pattern for liquidity harvesting</a>: market participants get a post with panic sentiment published to them to trigger mass selling, and as a consequence the asset can be bought up all at once for cheaper. But you can also make money on euphoria.</p>
|
| 11 |
+
<table>
|
| 12 |
+
<thead>
|
| 13 |
+
<tr>
|
| 14 |
+
<th>Metric</th>
|
| 15 |
+
<th>Value</th>
|
| 16 |
+
</tr>
|
| 17 |
+
</thead>
|
| 18 |
+
<tbody>
|
| 19 |
+
<tr>
|
| 20 |
+
<td>Total trades</td>
|
| 21 |
+
<td>22</td>
|
| 22 |
+
</tr>
|
| 23 |
+
<tr>
|
| 24 |
+
<td>Wins / Losses</td>
|
| 25 |
+
<td>15 / 7</td>
|
| 26 |
+
</tr>
|
| 27 |
+
<tr>
|
| 28 |
+
<td>Winrate</td>
|
| 29 |
+
<td><strong>68%</strong></td>
|
| 30 |
+
</tr>
|
| 31 |
+
<tr>
|
| 32 |
+
<td>Mean trade PNL</td>
|
| 33 |
+
<td><strong>+2.374%</strong></td>
|
| 34 |
+
</tr>
|
| 35 |
+
<tr>
|
| 36 |
+
<td>Std dev per trade</td>
|
| 37 |
+
<td>7.676%</td>
|
| 38 |
+
</tr>
|
| 39 |
+
<tr>
|
| 40 |
+
<td>Sharpe Ratio (per-trade)</td>
|
| 41 |
+
<td><strong>+0.302</strong></td>
|
| 42 |
+
</tr>
|
| 43 |
+
</tbody>
|
| 44 |
+
</table>
|
| 45 |
+
<p>A Telegram channel publishes signals, they are successful in 68% of cases. The average retail investor will not look any further. And this is a trap: risk management does not insure against the black swan scenario at all.</p>
|
| 46 |
+
<p>Risks:</p>
|
| 47 |
+
<ol>
|
| 48 |
+
<li>
|
| 49 |
+
<p><strong>High volatility relative to average profit</strong></p>
|
| 50 |
+
<p>The average trade is +2.37%, but the standard deviation is <strong>Β±7.86%</strong>. One or two strong losses easily eat up the profit of ten small wins, while the winrate still looks "pretty".</p>
|
| 51 |
+
</li>
|
| 52 |
+
<li>
|
| 53 |
+
<p><strong>Low Sharpe = weak risk compensation</strong></p>
|
| 54 |
+
<p>Sharpe 0.3 indicates that the profit is not large enough compared to the risk being taken. Good trading aims for Sharpe > 1.0.</p>
|
| 55 |
+
</li>
|
| 56 |
+
</ol>
|
| 57 |
+
<p>This is a different pattern of crowd liquidity usage: <code>pump and dump</code>. Let us verify the hypothesis by picking only those signals where the asset's price had already been rising over the previous N hours.</p>
|
| 58 |
+
<table>
|
| 59 |
+
<thead>
|
| 60 |
+
<tr>
|
| 61 |
+
<th>Metric</th>
|
| 62 |
+
<th>Value</th>
|
| 63 |
+
</tr>
|
| 64 |
+
</thead>
|
| 65 |
+
<tbody>
|
| 66 |
+
<tr>
|
| 67 |
+
<td>Total trades</td>
|
| 68 |
+
<td>11</td>
|
| 69 |
+
</tr>
|
| 70 |
+
<tr>
|
| 71 |
+
<td>Wins / Losses</td>
|
| 72 |
+
<td>11 / 0</td>
|
| 73 |
+
</tr>
|
| 74 |
+
<tr>
|
| 75 |
+
<td>Winrate</td>
|
| 76 |
+
<td>100%</td>
|
| 77 |
+
</tr>
|
| 78 |
+
<tr>
|
| 79 |
+
<td>Mean trade PNL</td>
|
| 80 |
+
<td>+6.972%</td>
|
| 81 |
+
</tr>
|
| 82 |
+
<tr>
|
| 83 |
+
<td>Std dev per trade</td>
|
| 84 |
+
<td>8.642%</td>
|
| 85 |
+
</tr>
|
| 86 |
+
<tr>
|
| 87 |
+
<td>Sharpe Ratio (per-trade)</td>
|
| 88 |
+
<td>+0.807</td>
|
| 89 |
+
</tr>
|
| 90 |
+
</tbody>
|
| 91 |
+
</table>
|
| 92 |
+
<p>What improved:</p>
|
| 93 |
+
<ol>
|
| 94 |
+
<li>
|
| 95 |
+
<p><strong>Sharpe Ratio grew 2.67x</strong> (0.302 β 0.807)</p>
|
| 96 |
+
<p>Profit now compensates the assumed risk much better.</p>
|
| 97 |
+
</li>
|
| 98 |
+
<li>
|
| 99 |
+
<p><strong>The average trade became almost 3x more profitable</strong> (+2.37% β +6.97%)</p>
|
| 100 |
+
<p>Portfolio drawdowns went away: fewer losing trades.</p>
|
| 101 |
+
</li>
|
| 102 |
+
</ol>
|
| 103 |
+
<p>The price growth over the last N hours is an empirical criterion. I knew where to look in advance, but I did not perform an analysis of the matrix of recommendation posts. <strong>If you take the top 100 channels, using publication time and recommendation direction you can identify a single author</strong> behind several anonymous accounts. Further, with the link to a single author, you can find out how many more channels he is potentially capable of using to continue the pump.</p>
|
| 104 |
+
<a id="how-to-make-money-on-this" class="tsd-anchor"></a><h2 class="tsd-anchor-link">How to make money on this<a href="#how-to-make-money-on-this" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Using a <a href="article_05_ai_strategy_workflow.html">self enforcement runtime</a>, a parser and a <a href="concept_01_monorepo_parallel_execution.html">high-performance backtest</a> one can update the empirical entry criteria automatically. The channel parser extracts the direction, entry zone, targets and stop from the text with simple regex rules:</p>
|
| 105 |
+
<pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">SIGNAL_FORMAT</span><span class="hl-1">: </span><span class="hl-11">ParseFormat</span><span class="hl-1"><</span><span class="hl-11">SignalFields</span><span class="hl-1">> = {</span><br/><span class="hl-1"> </span><span class="hl-4">symbol:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">pattern:</span><span class="hl-17"> /#</span><span class="hl-18">([</span><span class="hl-17">A-Z0-9</span><span class="hl-18">]</span><span class="hl-19">+</span><span class="hl-18">)</span><span class="hl-13">\/</span><span class="hl-17">USDT/</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">group:</span><span class="hl-1"> </span><span class="hl-7">1</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">direction:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">pattern:</span><span class="hl-17"> /</span><span class="hl-18">(</span><span class="hl-17">Π¨ΠΠ Π’</span><span class="hl-20">|</span><span class="hl-17">ΠΠΠΠ</span><span class="hl-18">)</span><span class="hl-17">/</span><span class="hl-3">i</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-0">transform</span><span class="hl-4">:</span><span class="hl-1"> (</span><span class="hl-4">raw</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> (</span><span class="hl-4">raw</span><span class="hl-1">.</span><span class="hl-0">toUpperCase</span><span class="hl-1">() === </span><span class="hl-2">"Π¨ΠΠ Π’"</span><span class="hl-1"> ? </span><span class="hl-2">"short"</span><span class="hl-1"> : </span><span class="hl-2">"long"</span><span class="hl-1">),</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">entry:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">pattern:</span><span class="hl-17"> /Π·ΠΎΠ½Π΅\s</span><span class="hl-19">+</span><span class="hl-13">\$</span><span class="hl-19">?</span><span class="hl-18">([</span><span class="hl-17">\d.,</span><span class="hl-18">]</span><span class="hl-19">+</span><span class="hl-18">)</span><span class="hl-17">\s</span><span class="hl-19">*</span><span class="hl-18">[</span><span class="hl-17">-ββ</span><span class="hl-18">]</span><span class="hl-17">\s</span><span class="hl-19">*</span><span class="hl-18">(?:</span><span class="hl-13">\$</span><span class="hl-19">?</span><span class="hl-18">[</span><span class="hl-17">\d.,</span><span class="hl-18">]</span><span class="hl-19">+</span><span class="hl-17">\s</span><span class="hl-19">*</span><span class="hl-18">[</span><span class="hl-17">-ββ</span><span class="hl-18">]</span><span class="hl-17">\s</span><span class="hl-19">*</span><span class="hl-18">)</span><span class="hl-19">?</span><span class="hl-13">\$</span><span class="hl-19">?</span><span class="hl-18">([</span><span class="hl-17">\d.,</span><span class="hl-18">]</span><span class="hl-19">+</span><span class="hl-18">)(?=</span><span class="hl-17">\s</span><span class="hl-18">)</span><span class="hl-17">/</span><span class="hl-3">i</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-0">transform</span><span class="hl-4">:</span><span class="hl-1"> (</span><span class="hl-4">_</span><span class="hl-1">, </span><span class="hl-4">m</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> ({ </span><span class="hl-4">from:</span><span class="hl-1"> </span><span class="hl-0">num</span><span class="hl-1">(</span><span class="hl-4">m</span><span class="hl-1">[</span><span class="hl-7">1</span><span class="hl-1">]), </span><span class="hl-4">to:</span><span class="hl-1"> </span><span class="hl-0">num</span><span class="hl-1">(</span><span class="hl-4">m</span><span class="hl-1">[</span><span class="hl-7">2</span><span class="hl-1">]) }),</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">targets:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">pattern:</span><span class="hl-17"> /ΠΠ°ΠΊΡΡΡΡ</span><span class="hl-18">(?:</span><span class="hl-17">\s</span><span class="hl-19">+</span><span class="hl-17">ΠΎΡΠ΄Π΅Ρ</span><span class="hl-18">)</span><span class="hl-19">?</span><span class="hl-17">\s</span><span class="hl-19">+</span><span class="hl-17">ΠΏΠΎ</span><span class="hl-18">(?:</span><span class="hl-17">\s</span><span class="hl-19">+</span><span class="hl-17">ΡΠ΅Π½Π΅</span><span class="hl-18">)</span><span class="hl-19">?</span><span class="hl-17">\s</span><span class="hl-19">+</span><span class="hl-13">\$</span><span class="hl-19">?</span><span class="hl-18">([</span><span class="hl-17">\d.,</span><span class="hl-18">]</span><span class="hl-19">+</span><span class="hl-18">)</span><span class="hl-17">/</span><span class="hl-3">gi</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-0">transform</span><span class="hl-4">:</span><span class="hl-1"> (</span><span class="hl-4">_</span><span class="hl-1">, </span><span class="hl-4">m</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-0">num</span><span class="hl-1">(</span><span class="hl-4">m</span><span class="hl-1">[</span><span class="hl-7">1</span><span class="hl-1">]),</span><br/><span class="hl-1"> </span><span class="hl-4">multi:</span><span class="hl-1"> </span><span class="hl-3">true</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">stoploss:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">pattern:</span><span class="hl-17"> /Π‘Π’ΠΠ-</span><span class="hl-19">?</span><span class="hl-17">ΠΠΠ‘Π‘:\s</span><span class="hl-19">*</span><span class="hl-13">\$</span><span class="hl-19">?</span><span class="hl-18">([</span><span class="hl-17">\d.,</span><span class="hl-18">]</span><span class="hl-19">+</span><span class="hl-18">)</span><span class="hl-17">/</span><span class="hl-3">i</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-0">transform</span><span class="hl-4">:</span><span class="hl-1"> (</span><span class="hl-4">_</span><span class="hl-1">, </span><span class="hl-4">m</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-0">num</span><span class="hl-1">(</span><span class="hl-4">m</span><span class="hl-1">[</span><span class="hl-7">1</span><span class="hl-1">]),</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">};</span>
|
| 106 |
+
</code><button type="button">Copy</button></pre>
|
| 107 |
+
|
| 108 |
+
<p>A high-performance backtest computes metrics on pre-publication data:</p>
|
| 109 |
+
<pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">PRE_CANDLES_LIMIT</span><span class="hl-1"> = </span><span class="hl-7">1440</span><span class="hl-1">; </span><span class="hl-6">// 24h of 1m candles for baseline</span><br/><br/><span class="hl-6">// the getCandles(.., 1440) window covers exactly the 24h BEFORE the signal publication</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">preCandles</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-0">getCandles</span><span class="hl-1">(</span><span class="hl-4">symbol</span><span class="hl-1">, </span><span class="hl-2">"1m"</span><span class="hl-1">, </span><span class="hl-8">PRE_CANDLES_LIMIT</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// momentum24h β total price change over the 24h before publication.</span><br/><span class="hl-6">// Positive = a pump is already in progress; negative = the market is falling.</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">momentum24hPct</span><span class="hl-1"> =</span><br/><span class="hl-1"> ((</span><span class="hl-4">preCandles</span><span class="hl-1">[</span><span class="hl-4">preCandles</span><span class="hl-1">.</span><span class="hl-4">length</span><span class="hl-1"> - </span><span class="hl-7">1</span><span class="hl-1">].</span><span class="hl-4">close</span><span class="hl-1"> - </span><span class="hl-4">preCandles</span><span class="hl-1">[</span><span class="hl-7">0</span><span class="hl-1">].</span><span class="hl-4">open</span><span class="hl-1">) /</span><br/><span class="hl-1"> </span><span class="hl-4">preCandles</span><span class="hl-1">[</span><span class="hl-7">0</span><span class="hl-1">].</span><span class="hl-4">open</span><span class="hl-1">) * </span><span class="hl-7">100</span><span class="hl-1">;</span><br/><br/><span class="hl-4">Logger</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">"pre-publication data"</span><span class="hl-1">, { </span><span class="hl-4">momentum24hPct</span><span class="hl-1"> })</span>
|
| 110 |
+
</code><button type="button">Copy</button></pre>
|
| 111 |
+
|
| 112 |
+
<p>The AI agent programs the filters, changing them as code on each update:</p>
|
| 113 |
+
<pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">SHORT_MIN_AVG_RANGE_PCT</span><span class="hl-1"> = </span><span class="hl-7">0.07</span><span class="hl-1">;</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">LONG_MIN_MOMENTUM_24H_PCT</span><span class="hl-1"> = -</span><span class="hl-7">1</span><span class="hl-1">;</span><br/><br/><span class="hl-6">// Filter 1: SHORT on a "sleeping" asset (avgRange < 0.07% over the day, like TRX) β</span><br/><span class="hl-6">// thin liquidity, an ideal target for a stop-hunt. This is the case of liquidity</span><br/><span class="hl-6">// harvesting: the signal must not be followed.</span><br/><span class="hl-5">if</span><span class="hl-1"> (</span><span class="hl-4">signal</span><span class="hl-1">.</span><span class="hl-4">direction</span><span class="hl-1"> === </span><span class="hl-2">"short"</span><span class="hl-1"> && </span><span class="hl-4">avgRangePct</span><span class="hl-1"> < </span><span class="hl-8">SHORT_MIN_AVG_RANGE_PCT</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-5">return</span><span class="hl-1"> </span><span class="hl-3">null</span><span class="hl-1">;</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-6">// Filter 2: LONG when the price has fallen more than 1% over the day β "catching knives".</span><br/><span class="hl-6">// There is no capital inflow, there is a decline; subscribers are being led against the trend.</span><br/><span class="hl-5">if</span><span class="hl-1"> (</span><span class="hl-4">signal</span><span class="hl-1">.</span><span class="hl-4">direction</span><span class="hl-1"> === </span><span class="hl-2">"long"</span><span class="hl-1"> && </span><span class="hl-4">momentum24hPct</span><span class="hl-1"> < </span><span class="hl-8">LONG_MIN_MOMENTUM_24H_PCT</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-5">return</span><span class="hl-1"> </span><span class="hl-3">null</span><span class="hl-1">;</span><br/><span class="hl-1">}</span>
|
| 114 |
+
</code><button type="button">Copy</button></pre>
|
| 115 |
+
|
| 116 |
+
<p>Filter 1 catches the scam mode of liquidity harvesting (zero inflow, stop manipulation) and says "do not enter". Filter 2 catches the absence of fundamental inflow (the market is falling, there is no pump) and also says "do not enter". What remains is exactly what the whole thing was started for: signals under which there is <strong>real capital inflow</strong>.</p>
|
| 117 |
+
<a id="conclusion" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Conclusion<a href="#conclusion" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><p>A Telegram pump is not a market bug that will be arbitraged away and disappear. It is crowd behavior that reproduces every time the author has an audience. As long as there are subscribers β there is inflow. And that means there is a fundamental factor to which the arithmetic of equilibrium does not apply: it is a game with a growing sum.</p>
|
| 118 |
+
<hr>
|
| 119 |
+
<p><em>Thank you for your attention</em></p>
|
| 120 |
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#πΈ-escaping-zero-expectation-from-a-fixed-sum-game-to-a-growing-sum-game"><span>πΈ <wbr/>Escaping zero expectation: from a fixed-<wbr/>sum game to a growing-<wbr/>sum game</span></a><ul><li><a href="#a-game-with-a-finite-sum"><span>A game with a finite sum</span></a></li><li><a href="#escape-into-a-game-with-a-growing-sum"><span>Escape into a game with a growing sum</span></a></li><li><a href="#piggybacking-to-paradise"><span>Piggybacking to paradise</span></a></li><li><a href="#how-to-make-money-on-this"><span>How to make money on this</span></a></li><li><a href="#conclusion"><span>Conclusion</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 121 |
+
|
| 122 |
+
<!-- Yandex.Metrika counter -->
|
| 123 |
+
<script type="text/javascript">
|
| 124 |
+
(function(m,e,t,r,i,k,a){
|
| 125 |
+
m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
| 126 |
+
m[i].l=1*new Date();
|
| 127 |
+
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
|
| 128 |
+
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)
|
| 129 |
+
})(window, document,'script','https://mc.yandex.ru/metrika/tag.js?id=105455585', 'ym');
|
| 130 |
+
|
| 131 |
+
ym(105455585, 'init', {ssr:true, webvisor:true, clickmap:true, ecommerce:"dataLayer", accurateTrackBounce:true, trackLinks:true});
|
| 132 |
+
</script>
|
| 133 |
+
<noscript><div><img src="https://mc.yandex.ru/watch/105455585" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
| 134 |
+
<!-- /Yandex.Metrika counter -->
|
| 135 |
+
|
| 136 |
+
<!-- Google tag (gtag.js) -->
|
| 137 |
+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3MQZEBBDDR"></script>
|
| 138 |
+
<script>
|
| 139 |
+
window.dataLayer = window.dataLayer || [];
|
| 140 |
+
function gtag(){dataLayer.push(arguments);}
|
| 141 |
+
gtag('js', new Date());
|
| 142 |
+
|
| 143 |
+
gtag('config', 'G-3MQZEBBDDR');
|
| 144 |
+
</script>
|
documents/data_test-guidelines.html
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>data/test-guidelines | backtest-kit</title><meta name="description" content="Documentation for backtest-kit"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">backtest-kit</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">backtest-kit</a></li><li><a href="data_test-guidelines.html">data/test-guidelines</a></li></ul></div><div class="tsd-panel tsd-typography"><a id="test-guidelines" class="tsd-anchor"></a><h1 class="tsd-anchor-link">Test Guidelines<a href="#test-guidelines" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h1><a id="key-files" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Key files<a href="#key-files" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><ul>
|
| 2 |
+
<li><code>src/helpers/getEffectivePriceOpen.ts</code> β cost-basis replay algorithm (DO NOT MODIFY)</li>
|
| 3 |
+
<li><code>src/helpers/toProfitLossDto.ts</code> β weighted PNL with partial close replay (DO NOT MODIFY)</li>
|
| 4 |
+
<li><code>test/spec/dca.test.mjs</code> β 35 unit tests for DCA+partial logic</li>
|
| 5 |
+
<li><code>test/e2e/dca.test.mjs</code> β 9 e2e tests: partial profit/loss interleaved with DCA</li>
|
| 6 |
+
<li><code>test/migration/migrate7.test.mjs</code> β 2 migration tests: trailing stop breakeven, partialLoss</li>
|
| 7 |
+
<li><code>test/e2e/average.test.mjs</code> β reference pattern for e2e backtest tests</li>
|
| 8 |
+
<li><code>test/README.md</code> β comprehensive test writing guide (read before writing e2e tests)</li>
|
| 9 |
+
</ul>
|
| 10 |
+
<a id="algorithm-cost-basis-replay" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Algorithm: cost-basis replay<a href="#algorithm-cost-basis-replay" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Running <code>costBasis</code> through all partials sequentially:</p>
|
| 11 |
+
<pre><code><span class="hl-4">costBasis</span><span class="hl-1"> = </span><span class="hl-7">0</span><br/><span class="hl-4">for</span><span class="hl-1"> </span><span class="hl-4">each</span><span class="hl-1"> </span><span class="hl-4">partial</span><span class="hl-1">[</span><span class="hl-4">i</span><span class="hl-1">]:</span><br/><span class="hl-1"> </span><span class="hl-4">newEntries</span><span class="hl-1"> = </span><span class="hl-4">entryCountAtClose</span><span class="hl-1">[</span><span class="hl-4">i</span><span class="hl-1">] - </span><span class="hl-4">entryCountAtClose</span><span class="hl-1">[</span><span class="hl-4">i</span><span class="hl-1">-</span><span class="hl-7">1</span><span class="hl-1">] (</span><span class="hl-7">0</span><span class="hl-1"> </span><span class="hl-4">for</span><span class="hl-1"> </span><span class="hl-4">i</span><span class="hl-1">=</span><span class="hl-7">0</span><span class="hl-1">)</span><br/><span class="hl-1"> </span><span class="hl-4">costBasis</span><span class="hl-1"> += </span><span class="hl-4">newEntries</span><span class="hl-1"> * </span><span class="hl-7">100</span><br/><span class="hl-1"> </span><span class="hl-4">dollarValue</span><span class="hl-1"> = (</span><span class="hl-4">percent</span><span class="hl-1">[</span><span class="hl-4">i</span><span class="hl-1">] / </span><span class="hl-7">100</span><span class="hl-1">) * </span><span class="hl-4">costBasis</span><span class="hl-1"> β </span><span class="hl-4">correct</span><span class="hl-1"> </span><span class="hl-4">running</span><span class="hl-1"> </span><span class="hl-4">basis</span><br/><span class="hl-1"> </span><span class="hl-4">costBasis</span><span class="hl-1"> *= (</span><span class="hl-7">1</span><span class="hl-1"> - </span><span class="hl-4">percent</span><span class="hl-1">[</span><span class="hl-4">i</span><span class="hl-1">] / </span><span class="hl-7">100</span><span class="hl-1">) β </span><span class="hl-4">reduce</span><span class="hl-1"> </span><span class="hl-4">after</span><span class="hl-1"> </span><span class="hl-4">each</span><span class="hl-1"> </span><span class="hl-4">close</span><br/><span class="hl-4">weight</span><span class="hl-1">[</span><span class="hl-4">i</span><span class="hl-1">] = </span><span class="hl-4">dollarValue</span><span class="hl-1">[</span><span class="hl-4">i</span><span class="hl-1">] / </span><span class="hl-4">totalInvested</span>
|
| 12 |
+
</code><button>Copy</button></pre>
|
| 13 |
+
|
| 14 |
+
<a id="snap-computation-rule-for-test-expected-values" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Snap computation rule (for test expected values)<a href="#snap-computation-rule-for-test-expected-values" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><ul>
|
| 15 |
+
<li><code>snap[0]</code> = <code>hm(entries[0..cnt[0]])</code> when no prior partials</li>
|
| 16 |
+
<li><code>snap[iβ₯1]</code> = must use <code>getEff(entries[0..cnt[i]], partials[0..i-1])</code> β NOT plain harmonic mean
|
| 17 |
+
<ul>
|
| 18 |
+
<li>Formula: <code>(remainingCostBasis + newDCA*100) / (remainingCostBasis/snap[i-1] + Ξ£100/newPrice)</code></li>
|
| 19 |
+
</ul>
|
| 20 |
+
</li>
|
| 21 |
+
</ul>
|
| 22 |
+
<a id="e2e-test-pattern" class="tsd-anchor"></a><h2 class="tsd-anchor-link">e2e test pattern<a href="#e2e-test-pattern" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><pre><code class="js"><span class="hl-0">addExchangeSchema</span><span class="hl-1">({ </span><span class="hl-4">exchangeName:</span><span class="hl-1"> </span><span class="hl-2">"binance-X"</span><span class="hl-1">, </span><span class="hl-4">getCandles</span><span class="hl-1">, </span><span class="hl-4">formatPrice</span><span class="hl-1">, </span><span class="hl-4">formatQuantity</span><span class="hl-1"> })</span><br/><span class="hl-0">addStrategySchema</span><span class="hl-1">({ </span><span class="hl-4">strategyName:</span><span class="hl-1"> </span><span class="hl-2">"test-X"</span><span class="hl-1">, </span><span class="hl-4">interval:</span><span class="hl-1"> </span><span class="hl-2">"1m"</span><span class="hl-1">, </span><span class="hl-4">getSignal</span><span class="hl-1">, </span><span class="hl-4">callbacks:</span><span class="hl-1"> { </span><span class="hl-4">onActivePing</span><span class="hl-1">, </span><span class="hl-4">onClose</span><span class="hl-1">, ... } })</span><br/><span class="hl-0">addFrameSchema</span><span class="hl-1">({ </span><span class="hl-4">frameName:</span><span class="hl-1"> </span><span class="hl-2">"Nm-X"</span><span class="hl-1">, </span><span class="hl-4">interval:</span><span class="hl-1"> </span><span class="hl-2">"1m"</span><span class="hl-1">, </span><span class="hl-4">startDate</span><span class="hl-1">, </span><span class="hl-4">endDate</span><span class="hl-1"> })</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">awaitSubject</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">Subject</span><span class="hl-1">();</span><br/><span class="hl-0">listenDoneBacktest</span><span class="hl-1">(() </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-4">awaitSubject</span><span class="hl-1">.</span><span class="hl-0">next</span><span class="hl-1">());</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-8">unsubscribeError</span><span class="hl-1"> = </span><span class="hl-0">listenError</span><span class="hl-1">((</span><span class="hl-4">error</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> { </span><span class="hl-4">errorCaught</span><span class="hl-1"> = </span><span class="hl-4">error</span><span class="hl-1">; </span><span class="hl-4">awaitSubject</span><span class="hl-1">.</span><span class="hl-0">next</span><span class="hl-1">(); });</span><br/><span class="hl-4">Backtest</span><span class="hl-1">.</span><span class="hl-0">background</span><span class="hl-1">(</span><span class="hl-2">"BTCUSDT"</span><span class="hl-1">, { </span><span class="hl-4">strategyName</span><span class="hl-1">, </span><span class="hl-4">exchangeName</span><span class="hl-1">, </span><span class="hl-4">frameName</span><span class="hl-1"> });</span><br/><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">awaitSubject</span><span class="hl-1">.</span><span class="hl-0">toPromise</span><span class="hl-1">();</span><br/><span class="hl-0">unsubscribeError</span><span class="hl-1">();</span>
|
| 23 |
+
</code><button type="button">Copy</button></pre>
|
| 24 |
+
|
| 25 |
+
<a id="key-e2e-rules-from-readme" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Key e2e rules (from README)<a href="#key-e2e-rules-from-readme" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><ul>
|
| 26 |
+
<li>Buffer candles ABOVE priceOpen for LONG (below for SHORT) before startTime β prevent early scheduled activation</li>
|
| 27 |
+
<li>All candles rebuilt inside first <code>getSignal</code> call (signalGenerated flag); getCandles returns from allCandles array</li>
|
| 28 |
+
<li>LONG activates when <code>candle.low <= priceOpen</code>; SHORT when <code>candle.high >= priceOpen</code></li>
|
| 29 |
+
<li>SL checked BEFORE activation β activation candle low must not hit SL simultaneously</li>
|
| 30 |
+
<li><code>getAveragePrice(symbol)</code> needs min 5 candles</li>
|
| 31 |
+
<li>Frame endDate must match candle count exactly (N candles = N minutes with 1m interval)</li>
|
| 32 |
+
<li><code>CC_MAX_STOPLOSS_DISTANCE_PERCENT: 20</code> β SL can be at most 20% from entry; violations silently break tests</li>
|
| 33 |
+
<li><code>CC_AVG_PRICE_CANDLES_COUNT: 5</code> β VWAP window; first 4 candles skipped as buffer in pending processing</li>
|
| 34 |
+
<li><code>minuteEstimatedTime</code> must fit within frame; if candles run out before time expires β error thrown</li>
|
| 35 |
+
<li><code>onPartialProfit</code> / <code>onPartialLoss</code> fire based on VWAP (averagePrice), not candle.close</li>
|
| 36 |
+
<li><code>revenuePercent</code> in <code>onPartialProfit</code> = % progress toward TP (0β100), NOT P&L %</li>
|
| 37 |
+
<li><code>revenuePercent</code> in <code>onPartialLoss</code> = % progress toward SL (0β100)</li>
|
| 38 |
+
</ul>
|
| 39 |
+
<a id="partial-close-api" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Partial close API<a href="#partial-close-api" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><ul>
|
| 40 |
+
<li><code>commitPartialProfit(symbol, percentToClose)</code> β close X% at profit; requires currentPrice > effectivePriceOpen for LONG</li>
|
| 41 |
+
<li><code>commitPartialLoss(symbol, percentToClose)</code> β close X% at loss; requires currentPrice < effectivePriceOpen for LONG</li>
|
| 42 |
+
<li><code>commitAverageBuy(symbol)</code> β DCA entry (rejected if price unfavorable direction)</li>
|
| 43 |
+
<li><code>commitTrailingStop(symbol, percentShift, currentPrice)</code> β shift SL by percent from original distance</li>
|
| 44 |
+
<li>All called from callbacks (<code>onActivePing</code>, <code>onPartialProfit</code>, <code>onPartialLoss</code>) with <code>await</code></li>
|
| 45 |
+
<li><code>Backtest.getPendingSignal(symbol, context)</code> β returns current signal state including priceOpen, priceStopLoss</li>
|
| 46 |
+
</ul>
|
| 47 |
+
<a id="geteffectivepriceopen-plain-signal-behavior" class="tsd-anchor"></a><h2 class="tsd-anchor-link">getEffectivePriceOpen plain-signal behavior<a href="#geteffectivepriceopen-plain-signal-behavior" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><ul>
|
| 48 |
+
<li>No <code>_entry</code> β returns <code>signal.priceOpen</code> immediately (line 23)</li>
|
| 49 |
+
<li>No change in math for plain entries; refactor only affects DCA+partial cases</li>
|
| 50 |
+
</ul>
|
| 51 |
+
<a id="test-index" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Test index<a href="#test-index" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><p><code>test/index.mjs</code> β import list controls which test files run</p>
|
| 52 |
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#test-guidelines"><span>Test <wbr/>Guidelines</span></a><ul><li><a href="#key-files"><span>Key files</span></a></li><li><a href="#algorithm-cost-basis-replay"><span>Algorithm: cost-<wbr/>basis replay</span></a></li><li><a href="#snap-computation-rule-for-test-expected-values"><span>Snap computation rule (for test expected values)</span></a></li><li><a href="#e2e-test-pattern"><span>e2e test pattern</span></a></li><li><a href="#key-e2e-rules-from-readme"><span>Key e2e rules (from README)</span></a></li><li><a href="#partial-close-api"><span>Partial close API</span></a></li><li><a href="#geteffectivepriceopen-plain-signal-behavior"><span>get<wbr/>Effective<wbr/>Price<wbr/>Open plain-<wbr/>signal behavior</span></a></li><li><a href="#test-index"><span>Test index</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 53 |
+
|
| 54 |
+
<!-- Yandex.Metrika counter -->
|
| 55 |
+
<script type="text/javascript">
|
| 56 |
+
(function(m,e,t,r,i,k,a){
|
| 57 |
+
m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
| 58 |
+
m[i].l=1*new Date();
|
| 59 |
+
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
|
| 60 |
+
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)
|
| 61 |
+
})(window, document,'script','https://mc.yandex.ru/metrika/tag.js?id=105455585', 'ym');
|
| 62 |
+
|
| 63 |
+
ym(105455585, 'init', {ssr:true, webvisor:true, clickmap:true, ecommerce:"dataLayer", accurateTrackBounce:true, trackLinks:true});
|
| 64 |
+
</script>
|
| 65 |
+
<noscript><div><img src="https://mc.yandex.ru/watch/105455585" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
| 66 |
+
<!-- /Yandex.Metrika counter -->
|
| 67 |
+
|
| 68 |
+
<!-- Google tag (gtag.js) -->
|
| 69 |
+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3MQZEBBDDR"></script>
|
| 70 |
+
<script>
|
| 71 |
+
window.dataLayer = window.dataLayer || [];
|
| 72 |
+
function gtag(){dataLayer.push(arguments);}
|
| 73 |
+
gtag('js', new Date());
|
| 74 |
+
|
| 75 |
+
gtag('config', 'G-3MQZEBBDDR');
|
| 76 |
+
</script>
|
documents/docs.html
CHANGED
|
@@ -92,6 +92,7 @@
|
|
| 92 |
<li><a href="docs_class_ExchangeUtils.html">ExchangeUtils</a></li>
|
| 93 |
<li><a href="docs_class_CacheUtils.html">CacheUtils</a></li>
|
| 94 |
<li><a href="docs_class_IntervalUtils.html">IntervalUtils</a></li>
|
|
|
|
| 95 |
<li><a href="docs_class_BreakevenMarkdownService.html">BreakevenMarkdownService</a></li>
|
| 96 |
<li><a href="docs_class_BreakevenUtils.html">BreakevenUtils</a></li>
|
| 97 |
<li><a href="docs_class_StrategyMarkdownService.html">StrategyMarkdownService</a></li>
|
|
@@ -123,13 +124,13 @@
|
|
| 123 |
<li><a href="docs_class_SizingGlobalService.html">SizingGlobalService</a></li>
|
| 124 |
<li><a href="docs_class_RiskGlobalService.html">RiskGlobalService</a></li>
|
| 125 |
<li><a href="docs_class_BacktestLogicPrivateService.html">BacktestLogicPrivateService</a></li>
|
|
|
|
| 126 |
<li><a href="docs_class_BacktestLogicPublicService.html">BacktestLogicPublicService</a></li>
|
| 127 |
<li><a href="docs_class_WalkerSchemaService.html">WalkerSchemaService</a></li>
|
| 128 |
<li><a href="docs_class_WalkerLogicPrivateService.html">WalkerLogicPrivateService</a></li>
|
| 129 |
<li><a href="docs_class_WalkerLogicPublicService.html">WalkerLogicPublicService</a></li>
|
| 130 |
<li><a href="docs_class_WalkerCommandService.html">WalkerCommandService</a></li>
|
| 131 |
<li><a href="docs_class_ExchangeSchemaService.html">ExchangeSchemaService</a></li>
|
| 132 |
-
<li><a href="docs_class_FrameSchemaService.html">FrameSchemaService</a></li>
|
| 133 |
<li><a href="docs_class_SizingSchemaService.html">SizingSchemaService</a></li>
|
| 134 |
<li><a href="docs_class_ActionSchemaService.html">ActionSchemaService</a></li>
|
| 135 |
<li><a href="docs_class_LiveLogicPrivateService.html">LiveLogicPrivateService</a></li>
|
|
@@ -302,21 +303,25 @@
|
|
| 302 |
<li><a href="docs_function_listenMaxDrawdownOnce.html">listenMaxDrawdownOnce</a></li>
|
| 303 |
<li><a href="docs_function_listenSignalNotify.html">listenSignalNotify</a></li>
|
| 304 |
<li><a href="docs_function_listenSignalNotifyOnce.html">listenSignalNotifyOnce</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 305 |
<li><a href="docs_function_hasTradeContext.html">hasTradeContext</a></li>
|
| 306 |
<li><a href="docs_function_getCandles.html">getCandles</a></li>
|
| 307 |
<li><a href="docs_function_getAveragePrice.html">getAveragePrice</a></li>
|
| 308 |
<li><a href="docs_function_getClosePrice.html">getClosePrice</a></li>
|
| 309 |
<li><a href="docs_function_formatPrice.html">formatPrice</a></li>
|
| 310 |
<li><a href="docs_function_formatQuantity.html">formatQuantity</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 311 |
<li><a href="docs_function_getDate.html">getDate</a></li>
|
| 312 |
<li><a href="docs_function_getTimestamp.html">getTimestamp</a></li>
|
| 313 |
<li><a href="docs_function_getMode.html">getMode</a></li>
|
| 314 |
<li><a href="docs_function_getSymbol.html">getSymbol</a></li>
|
| 315 |
<li><a href="docs_function_getContext.html">getContext</a></li>
|
| 316 |
-
<li><a href="docs_function_getOrderBook.html">getOrderBook</a></li>
|
| 317 |
-
<li><a href="docs_function_getRawCandles.html">getRawCandles</a></li>
|
| 318 |
-
<li><a href="docs_function_getNextCandles.html">getNextCandles</a></li>
|
| 319 |
-
<li><a href="docs_function_getAggregatedTrades.html">getAggregatedTrades</a></li>
|
| 320 |
<li><a href="docs_function_getLatestSignal.html">getLatestSignal</a></li>
|
| 321 |
<li><a href="docs_function_getMinutesSinceLatestSignalCreated.html">getMinutesSinceLatestSignalCreated</a></li>
|
| 322 |
<li><a href="docs_function_getSignalState.html">getSignalState</a></li>
|
|
@@ -461,6 +466,8 @@
|
|
| 461 |
<li><a href="docs_interface_HighestProfitContract.html">HighestProfitContract</a></li>
|
| 462 |
<li><a href="docs_interface_MaxDrawdownContract.html">MaxDrawdownContract</a></li>
|
| 463 |
<li><a href="docs_interface_SignalInfoContract.html">SignalInfoContract</a></li>
|
|
|
|
|
|
|
| 464 |
<li><a href="docs_interface_IStateInstance.html">IStateInstance</a></li>
|
| 465 |
<li><a href="docs_interface_IStateParams.html">IStateParams</a></li>
|
| 466 |
<li><a href="docs_interface_MessageModel.html">MessageModel</a></li>
|
|
@@ -545,6 +552,8 @@
|
|
| 545 |
<li><a href="docs_interface_IMemoryInstance.html">IMemoryInstance</a></li>
|
| 546 |
<li><a href="docs_interface_IDumpContext.html">IDumpContext</a></li>
|
| 547 |
<li><a href="docs_interface_IDumpInstance.html">IDumpInstance</a></li>
|
|
|
|
|
|
|
| 548 |
<li><a href="docs_interface_IBroker.html">IBroker</a></li>
|
| 549 |
<li><a href="docs_interface_WalkerStopContract.html">WalkerStopContract</a></li>
|
| 550 |
<li><a href="docs_interface_IParseArgsParams.html">IParseArgsParams</a></li>
|
|
@@ -681,6 +690,7 @@
|
|
| 681 |
<li><a href="docs_type_IntervalFileFunction.html">IntervalFileFunction</a></li>
|
| 682 |
<li><a href="docs_type_DropFirst.html">DropFirst</a></li>
|
| 683 |
<li><a href="docs_type_IntervalFileKeyArgs.html">IntervalFileKeyArgs</a></li>
|
|
|
|
| 684 |
<li><a href="docs_type_Columns_1.html">Columns$1</a></li>
|
| 685 |
<li><a href="docs_type_Columns.html">Columns</a></li>
|
| 686 |
<li><a href="docs_type_BrokerSignalOpenPayload.html">BrokerSignalOpenPayload</a></li>
|
|
@@ -710,7 +720,9 @@
|
|
| 710 |
<li><a href="docs_type_TWalkerLogicPublicService.html">TWalkerLogicPublicService</a></li>
|
| 711 |
<li><a href="docs_type_ILiveLogicPrivateService.html">ILiveLogicPrivateService</a></li>
|
| 712 |
<li><a href="docs_type_TLiveLogicPrivateService.html">TLiveLogicPrivateService</a></li>
|
|
|
|
| 713 |
<li><a href="docs_type_TLiveLogicPublicService.html">TLiveLogicPublicService</a></li>
|
|
|
|
| 714 |
<li><a href="docs_type_TBacktestLogicPublicService.html">TBacktestLogicPublicService</a></li>
|
| 715 |
<li><a href="docs_type_TPartial.html">TPartial</a></li>
|
| 716 |
<li><a href="docs_type_TBreakeven.html">TBreakeven</a></li>
|
|
|
|
| 92 |
<li><a href="docs_class_ExchangeUtils.html">ExchangeUtils</a></li>
|
| 93 |
<li><a href="docs_class_CacheUtils.html">CacheUtils</a></li>
|
| 94 |
<li><a href="docs_class_IntervalUtils.html">IntervalUtils</a></li>
|
| 95 |
+
<li><a href="docs_class_CronUtils.html">CronUtils</a></li>
|
| 96 |
<li><a href="docs_class_BreakevenMarkdownService.html">BreakevenMarkdownService</a></li>
|
| 97 |
<li><a href="docs_class_BreakevenUtils.html">BreakevenUtils</a></li>
|
| 98 |
<li><a href="docs_class_StrategyMarkdownService.html">StrategyMarkdownService</a></li>
|
|
|
|
| 124 |
<li><a href="docs_class_SizingGlobalService.html">SizingGlobalService</a></li>
|
| 125 |
<li><a href="docs_class_RiskGlobalService.html">RiskGlobalService</a></li>
|
| 126 |
<li><a href="docs_class_BacktestLogicPrivateService.html">BacktestLogicPrivateService</a></li>
|
| 127 |
+
<li><a href="docs_class_FrameSchemaService.html">FrameSchemaService</a></li>
|
| 128 |
<li><a href="docs_class_BacktestLogicPublicService.html">BacktestLogicPublicService</a></li>
|
| 129 |
<li><a href="docs_class_WalkerSchemaService.html">WalkerSchemaService</a></li>
|
| 130 |
<li><a href="docs_class_WalkerLogicPrivateService.html">WalkerLogicPrivateService</a></li>
|
| 131 |
<li><a href="docs_class_WalkerLogicPublicService.html">WalkerLogicPublicService</a></li>
|
| 132 |
<li><a href="docs_class_WalkerCommandService.html">WalkerCommandService</a></li>
|
| 133 |
<li><a href="docs_class_ExchangeSchemaService.html">ExchangeSchemaService</a></li>
|
|
|
|
| 134 |
<li><a href="docs_class_SizingSchemaService.html">SizingSchemaService</a></li>
|
| 135 |
<li><a href="docs_class_ActionSchemaService.html">ActionSchemaService</a></li>
|
| 136 |
<li><a href="docs_class_LiveLogicPrivateService.html">LiveLogicPrivateService</a></li>
|
|
|
|
| 303 |
<li><a href="docs_function_listenMaxDrawdownOnce.html">listenMaxDrawdownOnce</a></li>
|
| 304 |
<li><a href="docs_function_listenSignalNotify.html">listenSignalNotify</a></li>
|
| 305 |
<li><a href="docs_function_listenSignalNotifyOnce.html">listenSignalNotifyOnce</a></li>
|
| 306 |
+
<li><a href="docs_function_listenBeforeStart.html">listenBeforeStart</a></li>
|
| 307 |
+
<li><a href="docs_function_listenBeforeStartOnce.html">listenBeforeStartOnce</a></li>
|
| 308 |
+
<li><a href="docs_function_listenAfterEnd.html">listenAfterEnd</a></li>
|
| 309 |
+
<li><a href="docs_function_listenAfterEndOnce.html">listenAfterEndOnce</a></li>
|
| 310 |
<li><a href="docs_function_hasTradeContext.html">hasTradeContext</a></li>
|
| 311 |
<li><a href="docs_function_getCandles.html">getCandles</a></li>
|
| 312 |
<li><a href="docs_function_getAveragePrice.html">getAveragePrice</a></li>
|
| 313 |
<li><a href="docs_function_getClosePrice.html">getClosePrice</a></li>
|
| 314 |
<li><a href="docs_function_formatPrice.html">formatPrice</a></li>
|
| 315 |
<li><a href="docs_function_formatQuantity.html">formatQuantity</a></li>
|
| 316 |
+
<li><a href="docs_function_getOrderBook.html">getOrderBook</a></li>
|
| 317 |
+
<li><a href="docs_function_getRawCandles.html">getRawCandles</a></li>
|
| 318 |
+
<li><a href="docs_function_getNextCandles.html">getNextCandles</a></li>
|
| 319 |
+
<li><a href="docs_function_getAggregatedTrades.html">getAggregatedTrades</a></li>
|
| 320 |
<li><a href="docs_function_getDate.html">getDate</a></li>
|
| 321 |
<li><a href="docs_function_getTimestamp.html">getTimestamp</a></li>
|
| 322 |
<li><a href="docs_function_getMode.html">getMode</a></li>
|
| 323 |
<li><a href="docs_function_getSymbol.html">getSymbol</a></li>
|
| 324 |
<li><a href="docs_function_getContext.html">getContext</a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 325 |
<li><a href="docs_function_getLatestSignal.html">getLatestSignal</a></li>
|
| 326 |
<li><a href="docs_function_getMinutesSinceLatestSignalCreated.html">getMinutesSinceLatestSignalCreated</a></li>
|
| 327 |
<li><a href="docs_function_getSignalState.html">getSignalState</a></li>
|
|
|
|
| 466 |
<li><a href="docs_interface_HighestProfitContract.html">HighestProfitContract</a></li>
|
| 467 |
<li><a href="docs_interface_MaxDrawdownContract.html">MaxDrawdownContract</a></li>
|
| 468 |
<li><a href="docs_interface_SignalInfoContract.html">SignalInfoContract</a></li>
|
| 469 |
+
<li><a href="docs_interface_BeforeStartContract.html">BeforeStartContract</a></li>
|
| 470 |
+
<li><a href="docs_interface_AfterEndContract.html">AfterEndContract</a></li>
|
| 471 |
<li><a href="docs_interface_IStateInstance.html">IStateInstance</a></li>
|
| 472 |
<li><a href="docs_interface_IStateParams.html">IStateParams</a></li>
|
| 473 |
<li><a href="docs_interface_MessageModel.html">MessageModel</a></li>
|
|
|
|
| 552 |
<li><a href="docs_interface_IMemoryInstance.html">IMemoryInstance</a></li>
|
| 553 |
<li><a href="docs_interface_IDumpContext.html">IDumpContext</a></li>
|
| 554 |
<li><a href="docs_interface_IDumpInstance.html">IDumpInstance</a></li>
|
| 555 |
+
<li><a href="docs_interface_CronEntry.html">CronEntry</a></li>
|
| 556 |
+
<li><a href="docs_interface_CronHandle.html">CronHandle</a></li>
|
| 557 |
<li><a href="docs_interface_IBroker.html">IBroker</a></li>
|
| 558 |
<li><a href="docs_interface_WalkerStopContract.html">WalkerStopContract</a></li>
|
| 559 |
<li><a href="docs_interface_IParseArgsParams.html">IParseArgsParams</a></li>
|
|
|
|
| 690 |
<li><a href="docs_type_IntervalFileFunction.html">IntervalFileFunction</a></li>
|
| 691 |
<li><a href="docs_type_DropFirst.html">DropFirst</a></li>
|
| 692 |
<li><a href="docs_type_IntervalFileKeyArgs.html">IntervalFileKeyArgs</a></li>
|
| 693 |
+
<li><a href="docs_type_CronCallback.html">CronCallback</a></li>
|
| 694 |
<li><a href="docs_type_Columns_1.html">Columns$1</a></li>
|
| 695 |
<li><a href="docs_type_Columns.html">Columns</a></li>
|
| 696 |
<li><a href="docs_type_BrokerSignalOpenPayload.html">BrokerSignalOpenPayload</a></li>
|
|
|
|
| 720 |
<li><a href="docs_type_TWalkerLogicPublicService.html">TWalkerLogicPublicService</a></li>
|
| 721 |
<li><a href="docs_type_ILiveLogicPrivateService.html">ILiveLogicPrivateService</a></li>
|
| 722 |
<li><a href="docs_type_TLiveLogicPrivateService.html">TLiveLogicPrivateService</a></li>
|
| 723 |
+
<li><a href="docs_type_Keys_1.html">Keys$1</a></li>
|
| 724 |
<li><a href="docs_type_TLiveLogicPublicService.html">TLiveLogicPublicService</a></li>
|
| 725 |
+
<li><a href="docs_type_Keys.html">Keys</a></li>
|
| 726 |
<li><a href="docs_type_TBacktestLogicPublicService.html">TBacktestLogicPublicService</a></li>
|
| 727 |
<li><a href="docs_type_TPartial.html">TPartial</a></li>
|
| 728 |
<li><a href="docs_type_TBreakeven.html">TBreakeven</a></li>
|
documents/docs_class_BacktestLogicPublicService.html
CHANGED
|
@@ -7,19 +7,28 @@ explicit context parameters.</p>
|
|
| 7 |
<a id="constructor" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Constructor<a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><pre><code class="ts"><span class="hl-0">constructor</span><span class="hl-1">();</span>
|
| 8 |
</code><button type="button">Copy</button></pre>
|
| 9 |
|
| 10 |
-
<a id="properties" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Properties<a href="#properties" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="loggerservice" class="tsd-anchor"></a><h3 class="tsd-anchor-link">loggerService<a href="#loggerservice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">loggerService</span><span class="hl-1">: </span><span class="hl-4">
|
| 11 |
</code><button type="button">Copy</button></pre>
|
| 12 |
|
| 13 |
-
<a id="backtestlogicprivateservice" class="tsd-anchor"></a><h3 class="tsd-anchor-link">backtestLogicPrivateService<a href="#backtestlogicprivateservice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">backtestLogicPrivateService</span><span class="hl-1">: </span><span class="hl-4">
|
| 14 |
</code><button type="button">Copy</button></pre>
|
| 15 |
|
| 16 |
-
<a id="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
</code><button type="button">Copy</button></pre>
|
| 18 |
|
| 19 |
<p>Runs backtest for a symbol with context propagation.</p>
|
| 20 |
<p>Streams closed signals as async generator. Context is automatically
|
| 21 |
injected into all framework functions called during iteration.</p>
|
| 22 |
-
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#backtestlogicpublicservice"><span>Backtest<wbr/>Logic<wbr/>Public<wbr/>Service</span></a><ul><li><a href="#constructor"><span>Constructor</span></a></li><li><a href="#properties"><span>Properties</span></a></li><li><ul><li><a href="#loggerservice"><span>logger<wbr/>Service</span></a></li><li><a href="#backtestlogicprivateservice"><span>backtest<wbr/>Logic<wbr/>Private<wbr/>Service</span></a></li><li><a href="#run"><span>run</span></a></li></ul></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 23 |
|
| 24 |
<!-- Yandex.Metrika counter -->
|
| 25 |
<script type="text/javascript">
|
|
|
|
| 7 |
<a id="constructor" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Constructor<a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><pre><code class="ts"><span class="hl-0">constructor</span><span class="hl-1">();</span>
|
| 8 |
</code><button type="button">Copy</button></pre>
|
| 9 |
|
| 10 |
+
<a id="properties" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Properties<a href="#properties" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="loggerservice" class="tsd-anchor"></a><h3 class="tsd-anchor-link">loggerService<a href="#loggerservice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">loggerService</span><span class="hl-1">: { </span><span class="hl-4">readonly</span><span class="hl-1"> </span><span class="hl-10">methodContextService</span><span class="hl-1">: { </span><span class="hl-4">readonly</span><span class="hl-1"> </span><span class="hl-10">context</span><span class="hl-1">: </span><span class="hl-4">IMethodContext</span><span class="hl-1">; }; </span><span class="hl-4">readonly</span><span class="hl-1"> </span><span class="hl-10">executionContextService</span><span class="hl-1">: { </span><span class="hl-4">readonly</span><span class="hl-1"> </span><span class="hl-10">context</span><span class="hl-1">: </span><span class="hl-4">IExecutionContext</span><span class="hl-1">; }; ... </span><span class="hl-7">7</span><span class="hl-1"> </span><span class="hl-4">more</span><span class="hl-1"> ...; </span><span class="hl-10">setLogger</span><span class="hl-1">: (</span><span class="hl-4">logger</span><span class="hl-1">: </span><span class="hl-11">ILogger</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-3">void</span><span class="hl-1">; }</span>
|
| 11 |
</code><button type="button">Copy</button></pre>
|
| 12 |
|
| 13 |
+
<a id="backtestlogicprivateservice" class="tsd-anchor"></a><h3 class="tsd-anchor-link">backtestLogicPrivateService<a href="#backtestlogicprivateservice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">backtestLogicPrivateService</span><span class="hl-1">: </span><span class="hl-4">BacktestLogicPrivateService</span>
|
| 14 |
</code><button type="button">Copy</button></pre>
|
| 15 |
|
| 16 |
+
<a id="timemetaservice" class="tsd-anchor"></a><h3 class="tsd-anchor-link">timeMetaService<a href="#timemetaservice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">timeMetaService</span><span class="hl-1">: </span><span class="hl-4">TimeMetaService</span>
|
| 17 |
+
</code><button type="button">Copy</button></pre>
|
| 18 |
+
|
| 19 |
+
<a id="frameschemaservice" class="tsd-anchor"></a><h3 class="tsd-anchor-link">frameSchemaService<a href="#frameschemaservice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">frameSchemaService</span><span class="hl-1">: </span><span class="hl-4">FrameSchemaService</span>
|
| 20 |
+
</code><button type="button">Copy</button></pre>
|
| 21 |
+
|
| 22 |
+
<a id="exchangeconnectionservice" class="tsd-anchor"></a><h3 class="tsd-anchor-link">exchangeConnectionService<a href="#exchangeconnectionservice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">exchangeConnectionService</span><span class="hl-1">: </span><span class="hl-4">ExchangeConnectionService</span>
|
| 23 |
+
</code><button type="button">Copy</button></pre>
|
| 24 |
+
|
| 25 |
+
<a id="methods" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Methods<a href="#methods" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="run" class="tsd-anchor"></a><h3 class="tsd-anchor-link">run<a href="#run" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-0">run</span><span class="hl-1">(</span><span class="hl-4">symbol</span><span class="hl-1">: </span><span class="hl-4">string</span><span class="hl-1">, </span><span class="hl-4">context</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-4">strategyName:</span><span class="hl-1"> </span><span class="hl-4">StrategyName</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-4">exchangeName</span><span class="hl-1">: </span><span class="hl-4">ExchangeName</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-4">frameName</span><span class="hl-1">: </span><span class="hl-4">FrameName</span><span class="hl-1">;</span><br/><span class="hl-1">}): </span><span class="hl-4">AsyncGenerator</span><span class="hl-1"><</span><span class="hl-4">IStrategyTickResultScheduled</span><span class="hl-1"> | </span><span class="hl-4">IStrategyTickResultOpened</span><span class="hl-1"> | </span><span class="hl-4">IStrategyTickResultClosed</span><span class="hl-1"> | </span><span class="hl-4">IStrategyTickResultCancelled</span><span class="hl-1">, </span><span class="hl-3">void</span><span class="hl-1">, </span><span class="hl-4">any</span><span class="hl-1">>;</span>
|
| 26 |
</code><button type="button">Copy</button></pre>
|
| 27 |
|
| 28 |
<p>Runs backtest for a symbol with context propagation.</p>
|
| 29 |
<p>Streams closed signals as async generator. Context is automatically
|
| 30 |
injected into all framework functions called during iteration.</p>
|
| 31 |
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#backtestlogicpublicservice"><span>Backtest<wbr/>Logic<wbr/>Public<wbr/>Service</span></a><ul><li><a href="#constructor"><span>Constructor</span></a></li><li><a href="#properties"><span>Properties</span></a></li><li><ul><li><a href="#loggerservice"><span>logger<wbr/>Service</span></a></li><li><a href="#backtestlogicprivateservice"><span>backtest<wbr/>Logic<wbr/>Private<wbr/>Service</span></a></li><li><a href="#timemetaservice"><span>time<wbr/>Meta<wbr/>Service</span></a></li><li><a href="#frameschemaservice"><span>frame<wbr/>Schema<wbr/>Service</span></a></li><li><a href="#exchangeconnectionservice"><span>exchange<wbr/>Connection<wbr/>Service</span></a></li></ul></li><li><a href="#methods"><span>Methods</span></a></li><li><ul><li><a href="#run"><span>run</span></a></li></ul></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 32 |
|
| 33 |
<!-- Yandex.Metrika counter -->
|
| 34 |
<script type="text/javascript">
|
documents/docs_class_CronUtils.html
ADDED
|
@@ -0,0 +1,324 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>docs/class/CronUtils | backtest-kit</title><meta name="description" content="Documentation for backtest-kit"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">backtest-kit</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">backtest-kit</a></li><li><a href="docs_class_CronUtils.html">docs/class/CronUtils</a></li></ul></div><div class="tsd-panel tsd-typography"><a id="cronutils" class="tsd-anchor"></a><h1 class="tsd-anchor-link">CronUtils<a href="#cronutils" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h1><p>Utility class for registering periodic tasks that fire on candle-interval
|
| 2 |
+
boundaries of the virtual time produced by parallel backtests.</p>
|
| 3 |
+
<p>Exported as singleton instance <code>Cron</code> for convenient usage.</p>
|
| 4 |
+
<p>Key property β <strong>singleshot coordination across parallel backtests</strong>:
|
| 5 |
+
when several <code>Backtest.background(symbol, ...)</code> runs hit the same aligned
|
| 6 |
+
boundary concurrently, the handler is invoked exactly once. Every parallel
|
| 7 |
+
<code>tick</code> for that boundary awaits the same in-flight promise and is released
|
| 8 |
+
together when the promise settles. After settlement the slot is cleared and
|
| 9 |
+
the next boundary produces a fresh promise.</p>
|
| 10 |
+
<p>Typical wiring:</p>
|
| 11 |
+
<a id="constructor" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Constructor<a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><pre><code class="ts"><span class="hl-0">constructor</span><span class="hl-1">();</span>
|
| 12 |
+
</code><button type="button">Copy</button></pre>
|
| 13 |
+
|
| 14 |
+
<a id="properties" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Properties<a href="#properties" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="_entries" class="tsd-anchor"></a><h3 class="tsd-anchor-link">_entries<a href="#_entries" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">_entries</span><span class="hl-1">: </span><span class="hl-4">any</span>
|
| 15 |
+
</code><button type="button">Copy</button></pre>
|
| 16 |
+
|
| 17 |
+
<p>Registered entries by <code>name</code>.</p>
|
| 18 |
+
<p>Each record carries a monotonically increasing <code>generation</code> counter that
|
| 19 |
+
is bumped on every <code>register(entry)</code> call for the same name. The
|
| 20 |
+
generation participates in <code>firedKey</code> so writes from a still-in-flight
|
| 21 |
+
handler of a previous incarnation cannot poison <code>_firedOnce</code> for the
|
| 22 |
+
current incarnation β their key has a different generation suffix and
|
| 23 |
+
is simply ignored on lookup.</p>
|
| 24 |
+
<a id="_generationcounter" class="tsd-anchor"></a><h3 class="tsd-anchor-link">_generationCounter<a href="#_generationcounter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">_generationCounter</span><span class="hl-1">: </span><span class="hl-4">any</span>
|
| 25 |
+
</code><button type="button">Copy</button></pre>
|
| 26 |
+
|
| 27 |
+
<p>Monotonic counter used to mint new entry generations on <code>register</code>.</p>
|
| 28 |
+
<a id="_inflight" class="tsd-anchor"></a><h3 class="tsd-anchor-link">_inFlight<a href="#_inflight" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">_inFlight</span><span class="hl-1">: </span><span class="hl-4">any</span>
|
| 29 |
+
</code><button type="button">Copy</button></pre>
|
| 30 |
+
|
| 31 |
+
<p>In-flight handler slots.</p>
|
| 32 |
+
<p>Slot key shape (always includes the generation suffix <code>:g${generation}</code>;
|
| 33 |
+
the <code>:${symbol}</code> scope is present only in fan-out mode):</p>
|
| 34 |
+
<ul>
|
| 35 |
+
<li>Periodic global: <code>${name}:${alignedMs}:g${generation}</code>.</li>
|
| 36 |
+
<li>Periodic fan-out: <code>${name}:${alignedMs}:${symbol}:g${generation}</code>.</li>
|
| 37 |
+
<li>Fire-once global: <code>${name}:once:g${generation}</code>.</li>
|
| 38 |
+
<li>Fire-once fan-out: <code>${name}:once:${symbol}:g${generation}</code>.</li>
|
| 39 |
+
</ul>
|
| 40 |
+
<p>Value is the shared in-flight handler promise. Every parallel <code>tick</code> for
|
| 41 |
+
the same slot key awaits this exact promise (mutex semantics) and is
|
| 42 |
+
released together when it settles. <code>_inFlight</code> is owned exclusively by
|
| 43 |
+
<code>_runEntry</code> β <code>clear()</code> does <strong>not</strong> touch it, so the singleshot promise
|
| 44 |
+
survives concurrent <code>clear</code> calls and continues to coordinate parallel
|
| 45 |
+
ticks until it settles.</p>
|
| 46 |
+
<a id="_firedonce" class="tsd-anchor"></a><h3 class="tsd-anchor-link">_firedOnce<a href="#_firedonce" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">_firedOnce</span><span class="hl-1">: </span><span class="hl-4">any</span>
|
| 47 |
+
</code><button type="button">Copy</button></pre>
|
| 48 |
+
|
| 49 |
+
<p>Keys of fire-once entries whose handler has already settled successfully.</p>
|
| 50 |
+
<p>Key shape (always includes the entry generation suffix <code>:g${generation}</code>):</p>
|
| 51 |
+
<ul>
|
| 52 |
+
<li>Global fire-once: <code>${name}:g${generation}</code>.</li>
|
| 53 |
+
<li>Fan-out fire-once: <code>${name}:${symbol}:g${generation}</code> β one entry per
|
| 54 |
+
whitelisted symbol.</li>
|
| 55 |
+
</ul>
|
| 56 |
+
<p>The generation suffix isolates incarnations of the same <code>name</code>: writes
|
| 57 |
+
landing from a still-in-flight handler of a previous <code>register()</code> carry
|
| 58 |
+
the old generation and are never matched by the new entry's lookup.
|
| 59 |
+
Stale entries are pruned by <code>_clearFiredOnceFor</code> on <code>register</code>/<code>unregister</code>
|
| 60 |
+
and wiped by <code>clear()</code>.</p>
|
| 61 |
+
<p>Looked up by <code>_tick</code> to decide whether to skip; written by <code>_runEntry</code>
|
| 62 |
+
on successful settle.</p>
|
| 63 |
+
<a id="_lastboundary" class="tsd-anchor"></a><h3 class="tsd-anchor-link">_lastBoundary<a href="#_lastboundary" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">_lastBoundary</span><span class="hl-1">: </span><span class="hl-4">any</span>
|
| 64 |
+
</code><button type="button">Copy</button></pre>
|
| 65 |
+
|
| 66 |
+
<p>Last interval boundary already fired per periodic slot.</p>
|
| 67 |
+
<p>Key shape (no <code>alignedMs</code> segment β one entry per logical slot, not per
|
| 68 |
+
boundary; always carries the generation suffix <code>:g${generation}</code>, and the
|
| 69 |
+
<code>:${symbol}</code> scope only in fan-out mode):</p>
|
| 70 |
+
<ul>
|
| 71 |
+
<li>Periodic global: <code>${name}${genSuffix}</code>.</li>
|
| 72 |
+
<li>Periodic fan-out: <code>${name}:${symbol}${genSuffix}</code>.</li>
|
| 73 |
+
</ul>
|
| 74 |
+
<p>Value is the aligned-boundary epoch ms (<code>alignedMs</code>) most recently opened
|
| 75 |
+
for that slot. <code>_tick</code> fires a periodic entry whenever the incoming tick's
|
| 76 |
+
aligned boundary is <strong>strictly greater</strong> than the stored value, instead of
|
| 77 |
+
requiring the tick to land <em>exactly</em> on the boundary. This fixes the
|
| 78 |
+
dropped-boundary bug: when virtual time jumps over a boundary (e.g. a
|
| 79 |
+
<code>5m</code>-driven loop skipping from 00:14 to 00:29 never lands on the <code>15m</code>
|
| 80 |
+
00:15 boundary), the old <code>ts === alignedMs</code> check silently lost the tick.
|
| 81 |
+
With the watermark, the next tick whose <code>alignedMs</code> advanced past the
|
| 82 |
+
stored value fires once for the newest crossed boundary (catch-up
|
| 83 |
+
collapses multiple skipped boundaries into a single invocation at the
|
| 84 |
+
latest one).</p>
|
| 85 |
+
<p>Written synchronously in <code>_tick</code> at slot-open time (before the <code>await</code>),
|
| 86 |
+
so a still-in-flight handler does not let a later tick re-open the same
|
| 87 |
+
(or an already-passed) boundary. Fire-once entries never touch this map β
|
| 88 |
+
they use <code>_firedOnce</code>. Pruned by <code>_clearBoundaryFor</code> on
|
| 89 |
+
<code>register</code>/<code>unregister</code> and wiped by <code>dispose</code>.</p>
|
| 90 |
+
<a id="_clearboundaryfor" class="tsd-anchor"></a><h3 class="tsd-anchor-link">_clearBoundaryFor<a href="#_clearboundaryfor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">_clearBoundaryFor</span><span class="hl-1">: </span><span class="hl-4">any</span>
|
| 91 |
+
</code><button type="button">Copy</button></pre>
|
| 92 |
+
|
| 93 |
+
<p>Garbage-collect every <code>_lastBoundary</code> key that belongs to the entry <code>name</code>
|
| 94 |
+
(any generation, global or fan-out).</p>
|
| 95 |
+
<p>Called from <code>register</code>/<code>unregister</code> alongside <code>_clearFiredOnceFor</code>. Like
|
| 96 |
+
that helper this is memory hygiene, not correctness β the generation suffix
|
| 97 |
+
already isolates re-registrations, so a stale watermark from an old
|
| 98 |
+
generation can never gate a new entry.</p>
|
| 99 |
+
<a id="_clearfiredoncefor" class="tsd-anchor"></a><h3 class="tsd-anchor-link">_clearFiredOnceFor<a href="#_clearfiredoncefor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">_clearFiredOnceFor</span><span class="hl-1">: </span><span class="hl-4">any</span>
|
| 100 |
+
</code><button type="button">Copy</button></pre>
|
| 101 |
+
|
| 102 |
+
<p>Garbage-collect every <code>_firedOnce</code> key that belongs to the entry <code>name</code>
|
| 103 |
+
(any generation, global or fan-out).</p>
|
| 104 |
+
<p>Called from <code>register</code>/<code>unregister</code> to free memory; <strong>not</strong> required
|
| 105 |
+
for correctness β the generation suffix already isolates re-registrations,
|
| 106 |
+
so leftover keys from old generations can never block a new entry.
|
| 107 |
+
They just sit unused until they are GC'd here or wiped by <code>clear()</code>.</p>
|
| 108 |
+
<a id="_runentry" class="tsd-anchor"></a><h3 class="tsd-anchor-link">_runEntry<a href="#_runentry" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">_runEntry</span><span class="hl-1">: </span><span class="hl-4">any</span>
|
| 109 |
+
</code><button type="button">Copy</button></pre>
|
| 110 |
+
|
| 111 |
+
<p>Build the singleshot promise for a single in-flight slot.</p>
|
| 112 |
+
<p>Invokes <code>entry.handler(symbol, aligned, backtest)</code>, swallows and logs
|
| 113 |
+
any error via <code>console.error</code>, and clears the <code>_inFlight</code> slot
|
| 114 |
+
in <code>.finally()</code> so the next boundary produces a fresh promise. For
|
| 115 |
+
fire-once entries <code>firedKey</code> is added to <code>_firedOnce</code> on success so
|
| 116 |
+
subsequent ticks skip it.</p>
|
| 117 |
+
<a id="register" class="tsd-anchor"></a><h3 class="tsd-anchor-link">register<a href="#register" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">register</span><span class="hl-1">: (</span><span class="hl-4">entry</span><span class="hl-1">: </span><span class="hl-11">CronEntry</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-4">CronHandle</span>
|
| 118 |
+
</code><button type="button">Copy</button></pre>
|
| 119 |
+
|
| 120 |
+
<p>Register a periodic cron entry.</p>
|
| 121 |
+
<p>Idempotent on <code>name</code>: re-registering the same name replaces the previous
|
| 122 |
+
entry (interval/symbols/handler can all change). Re-registration does
|
| 123 |
+
<strong>not</strong> clear in-flight promises β entries still resolving complete with
|
| 124 |
+
the previous handler.</p>
|
| 125 |
+
<a id="unregister" class="tsd-anchor"></a><h3 class="tsd-anchor-link">unregister<a href="#unregister" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">unregister</span><span class="hl-1">: (</span><span class="hl-4">name</span><span class="hl-1">: </span><span class="hl-11">string</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-3">void</span>
|
| 126 |
+
</code><button type="button">Copy</button></pre>
|
| 127 |
+
|
| 128 |
+
<p>Remove a registered entry by name.</p>
|
| 129 |
+
<p>Does not cancel handlers already in flight β those resolve on their own
|
| 130 |
+
and clear their slot via <code>.finally()</code>.</p>
|
| 131 |
+
<a id="clear" class="tsd-anchor"></a><h3 class="tsd-anchor-link">clear<a href="#clear" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">clear</span><span class="hl-1">: (</span><span class="hl-4">symbol</span><span class="hl-1">?: </span><span class="hl-11">string</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-3">void</span>
|
| 132 |
+
</code><button type="button">Copy</button></pre>
|
| 133 |
+
|
| 134 |
+
<p>Clear fire-once marks so that fire-once entries can fire again.</p>
|
| 135 |
+
<p>Does <strong>not</strong> touch <code>_inFlight</code> β that map holds shared in-flight handler
|
| 136 |
+
promises through which parallel <code>tick</code>s coordinate. Wiping it mid-flight
|
| 137 |
+
would let a new <code>tick</code> start a second handler for a boundary that's
|
| 138 |
+
already running, breaking the singleshot contract.</p>
|
| 139 |
+
<p>Two modes:</p>
|
| 140 |
+
<ul>
|
| 141 |
+
<li><strong>Per-symbol</strong> (<code>symbol</code> provided): clears only fan-out fire-once
|
| 142 |
+
marks for that symbol β keys of the shape <code>${name}:${symbol}:g${gen}</code>.
|
| 143 |
+
Global fire-once marks (<code>${name}:g${gen}</code>, no symbol component) are
|
| 144 |
+
left intact, since they are not attributable to a single symbol.
|
| 145 |
+
Useful for re-arming fan-out fire-once entries when a particular
|
| 146 |
+
symbol's run finishes and you want a future re-run to fire again.</li>
|
| 147 |
+
<li><strong>All</strong> (no argument): wipes every fire-once mark across all entries
|
| 148 |
+
and symbols. Registered entries are not removed β use <code>unregister</code>
|
| 149 |
+
(or the disposer returned by <code>register</code>) for that.</li>
|
| 150 |
+
</ul>
|
| 151 |
+
<p><strong>Race with in-flight handlers.</strong> <code>_firedOnce</code> is written in
|
| 152 |
+
<code>_runEntry</code>'s <code>.finally()</code>, which can run <em>after</em> a concurrent
|
| 153 |
+
<code>clear()</code> call. In that case the fire-once mark reappears immediately
|
| 154 |
+
after being wiped, and the next tick will treat the entry as already
|
| 155 |
+
fired. This is consistent with the singleshot promise itself surviving
|
| 156 |
+
<code>clear()</code> β the handler is allowed to finish β and the entry's
|
| 157 |
+
generation suffix in <code>firedKey</code> guarantees the stale mark cannot
|
| 158 |
+
outlive a subsequent <code>register()</code> of the same name. If you need a hard
|
| 159 |
+
re-arm, <code>unregister</code> + <code>register</code> bumps the generation and makes any
|
| 160 |
+
late write a no-op.</p>
|
| 161 |
+
<a id="_tick" class="tsd-anchor"></a><h3 class="tsd-anchor-link">_tick<a href="#_tick" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">_tick</span><span class="hl-1">: </span><span class="hl-4">any</span>
|
| 162 |
+
</code><button type="button">Copy</button></pre>
|
| 163 |
+
|
| 164 |
+
<p>Process a virtual-time tick for <code>symbol</code> and fire any due cron entries.</p>
|
| 165 |
+
<p><strong>Private.</strong> Invoked exclusively by the lifecycle bridge installed in
|
| 166 |
+
enable β <code>beforeStart</code> / <code>idlePing</code> / <code>activePing</code> / <code>schedulePing</code>
|
| 167 |
+
are funneled here through a shared <code>singlerun</code> queue, so calls to
|
| 168 |
+
<code>_tick</code> are serialised end-to-end. Do not call directly.</p>
|
| 169 |
+
<p>Algorithm (per registered entry):
|
| 170 |
+
0. Base-align the incoming <code>when</code> down to the 1-minute boundary (<code>ts</code>).
|
| 171 |
+
Lifecycle subjects may emit with sub-second jitter; rounding here
|
| 172 |
+
guarantees that <code>beforeStart</code> / <code>idlePing</code> / <code>activePing</code> /
|
| 173 |
+
<code>schedulePing</code> for the same virtual minute all hash to the same
|
| 174 |
+
slot key.</p>
|
| 175 |
+
<ol>
|
| 176 |
+
<li>If <code>entry.symbols</code> is non-empty and does not include <code>symbol</code>, skip.</li>
|
| 177 |
+
<li>Decide scope from <code>entry.symbols</code>:
|
| 178 |
+
<ul>
|
| 179 |
+
<li>Empty/undefined β <strong>global</strong> (slot key has no symbol component).</li>
|
| 180 |
+
<li>Non-empty β <strong>fan-out</strong>, slot key carries <code>:${symbol}</code> so each
|
| 181 |
+
whitelisted symbol gets its own slot and handler invocation.</li>
|
| 182 |
+
</ul>
|
| 183 |
+
</li>
|
| 184 |
+
<li>Append the current entry generation suffix <code>:g${generation}</code> to both
|
| 185 |
+
slot key and fired-once key. This isolates incarnations of the same
|
| 186 |
+
<code>name</code>: a <code>register()</code> after an in-flight handler bumps the
|
| 187 |
+
generation, so the late <code>_firedOnce</code> write from the old handler can
|
| 188 |
+
never block the new entry.</li>
|
| 189 |
+
<li><strong>Fire-once</strong> (<code>entry.interval === undefined</code>):
|
| 190 |
+
<ul>
|
| 191 |
+
<li>If the entry's fired-once key is already in <code>_firedOnce</code>, skip.</li>
|
| 192 |
+
<li>Slot key: <code>${name}:once</code> (+ scope) (+ gen).</li>
|
| 193 |
+
<li><code>aligned</code> = the 1-minute-aligned <code>when</code> from step 0.</li>
|
| 194 |
+
</ul>
|
| 195 |
+
</li>
|
| 196 |
+
<li><strong>Periodic</strong> (<code>entry.interval</code> set):
|
| 197 |
+
<ul>
|
| 198 |
+
<li>Align <code>when</code> to the entry's interval via <a href="../functions/types.alignToInterval.html" class="tsd-kind-function"> alignToInterval</a> to
|
| 199 |
+
get <code>alignedMs</code>, the boundary this tick belongs to.</li>
|
| 200 |
+
<li>Compare against the slot's watermark in <code>_lastBoundary</code> (keyed by
|
| 201 |
+
<code>${name}</code> + scope + gen, without the <code>alignedMs</code> segment). If a
|
| 202 |
+
watermark exists and <code>alignedMs &lt;= lastBoundary</code>, this boundary was
|
| 203 |
+
already fired β skip.</li>
|
| 204 |
+
<li>This <strong>watermark</strong> check replaces the old exact <code>ts === alignedMs</code>
|
| 205 |
+
match. The exact match required virtual time to land <em>precisely</em> on
|
| 206 |
+
the boundary; when a tick jumped clean over a boundary (e.g. a <code>5m</code>
|
| 207 |
+
loop going 00:14 β 00:29 never touching the <code>15m</code> 00:15 boundary)
|
| 208 |
+
the boundary was silently lost. With the watermark, the first tick
|
| 209 |
+
whose <code>alignedMs</code> advanced past the stored value fires once, at the
|
| 210 |
+
newest crossed boundary (catch-up collapses several skipped
|
| 211 |
+
boundaries into a single invocation at the latest one).</li>
|
| 212 |
+
<li>The watermark is advanced to <code>alignedMs</code> synchronously when the slot
|
| 213 |
+
is opened (before the <code>await</code>), so a concurrent tick on the same or
|
| 214 |
+
an already-passed boundary cannot open a duplicate slot while the
|
| 215 |
+
handler is still in flight.</li>
|
| 216 |
+
<li>Slot key: <code>${name}:${alignedMs}</code> (+ scope) (+ gen).</li>
|
| 217 |
+
</ul>
|
| 218 |
+
</li>
|
| 219 |
+
<li>Singleshot per slot key: look up the slot in <code>_inFlight</code>. If a promise
|
| 220 |
+
already exists, <code>await</code> the same promise. Otherwise invoke
|
| 221 |
+
<code>entry.handler</code>, store the promise, and <code>await</code> it. The slot is
|
| 222 |
+
removed in <code>.finally()</code> so the next boundary creates a fresh promise;
|
| 223 |
+
for fire-once entries the fired-once key is also added to
|
| 224 |
+
<code>_firedOnce</code> on success so subsequent ticks skip it.</li>
|
| 225 |
+
</ol>
|
| 226 |
+
<p>Errors thrown by <code>handler</code> are caught, logged via <code>console.error</code>, and
|
| 227 |
+
<strong>not</strong> rethrown β a failing handler must not break the per-symbol
|
| 228 |
+
tick loop or unblock other parallel backtests with an unhandled
|
| 229 |
+
rejection. A failed fire-once handler is <strong>not</strong> marked as fired and
|
| 230 |
+
will retry on the next tick.</p>
|
| 231 |
+
<p>Requires active method context and execution context.</p>
|
| 232 |
+
<a id="enable" class="tsd-anchor"></a><h3 class="tsd-anchor-link">enable<a href="#enable" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">enable</span><span class="hl-1">: (() </span><span class="hl-3">=></span><span class="hl-1"> (...</span><span class="hl-4">args</span><span class="hl-1">: </span><span class="hl-11">any</span><span class="hl-1">[]) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-4">any</span><span class="hl-1">) & </span><span class="hl-4">ISingleshotClearable</span><span class="hl-1"><() </span><span class="hl-3">=></span><span class="hl-1"> (...</span><span class="hl-4">args</span><span class="hl-1">: </span><span class="hl-11">any</span><span class="hl-1">[]) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-4">any</span><span class="hl-1">></span>
|
| 233 |
+
</code><button type="button">Copy</button></pre>
|
| 234 |
+
|
| 235 |
+
<p>Subscribe <code>Cron</code> to the engine's strategy lifecycle subjects so registered
|
| 236 |
+
entries fire automatically β no manual wiring of <code>listenTickBacktest</code> /
|
| 237 |
+
<code>listenSchedulePing</code> etc. needed.</p>
|
| 238 |
+
<p>Subjects funneled into _tick:</p>
|
| 239 |
+
<ul>
|
| 240 |
+
<li><code>beforeStartSubject</code> β first event of every run.</li>
|
| 241 |
+
<li><code>idlePingSubject</code> β every tick when no signal is pending or scheduled.</li>
|
| 242 |
+
<li><code>activePingSubject</code> β every tick while a pending signal is being monitored.</li>
|
| 243 |
+
<li><code>schedulePingSubject</code> β every tick while a scheduled signal is being monitored.</li>
|
| 244 |
+
</ul>
|
| 245 |
+
<p>All four subjects are subscribed to a single <code>singlerun</code>-wrapped
|
| 246 |
+
handler that builds <code>_tick(event.symbol, new Date(event.timestamp), event.backtest)</code>. <code>singlerun</code> merges the four streams into one serial
|
| 247 |
+
queue: at most one <code>_tick</code> runs at a time, the next waits. This matters
|
| 248 |
+
because the engine can emit <code>beforeStart</code> and an immediate <code>idlePing</code>
|
| 249 |
+
on the very same minute, and concurrent <code>_tick</code>s on the same
|
| 250 |
+
<code>(symbol, minute)</code> would otherwise race to open the same <code>_inFlight</code>
|
| 251 |
+
slot before either commit. Together these four sources cover every
|
| 252 |
+
tick the engine processes for every <code>(symbol, virtual-minute)</code> pair
|
| 253 |
+
regardless of whether the strategy is idle, active, or scheduled.</p>
|
| 254 |
+
<p><code>enable</code> itself is wrapped in <code>singleshot</code>, so calling it repeatedly is
|
| 255 |
+
a no-op β subsequent calls return the same disposer. The disposer
|
| 256 |
+
unsubscribes from every subject and resets the singleshot so a future
|
| 257 |
+
<code>enable()</code> can re-subscribe cleanly. Equivalent to the
|
| 258 |
+
<code>RecentAdapter.enable</code> pattern.</p>
|
| 259 |
+
<p>The <code>.subscribe</code> callbacks are synchronous wrappers around the
|
| 260 |
+
<code>singlerun</code>-async handler; <code>_tick</code>'s returned promise is awaited inside
|
| 261 |
+
<code>singlerun</code> to enforce ordering but not bubbled back to the subject.
|
| 262 |
+
Errors are caught and logged inside <code>_runEntry</code>.</p>
|
| 263 |
+
<a id="disable" class="tsd-anchor"></a><h3 class="tsd-anchor-link">disable<a href="#disable" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">disable</span><span class="hl-1">: () </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-3">void</span>
|
| 264 |
+
</code><button type="button">Copy</button></pre>
|
| 265 |
+
|
| 266 |
+
<p>Tear down the lifecycle subscriptions installed by enable.</p>
|
| 267 |
+
<p>Safe to call multiple times and safe to call before <code>enable()</code> β both
|
| 268 |
+
are no-ops. Does <strong>not</strong> unregister entries, does <strong>not</strong> touch
|
| 269 |
+
<code>_inFlight</code>, and does <strong>not</strong> wipe <code>_firedOnce</code> (use <code>unregister</code> or
|
| 270 |
+
<code>clear()</code> for those).</p>
|
| 271 |
+
<a id="dispose" class="tsd-anchor"></a><h3 class="tsd-anchor-link">dispose<a href="#dispose" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">dispose</span><span class="hl-1">: () </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-3">void</span>
|
| 272 |
+
</code><button type="button">Copy</button></pre>
|
| 273 |
+
|
| 274 |
+
<p>Hard-reset the entire <code>Cron</code> state.</p>
|
| 275 |
+
<p>Performs in order:</p>
|
| 276 |
+
<ol>
|
| 277 |
+
<li>disable β tears down lifecycle subscriptions and resets the
|
| 278 |
+
<code>enable</code> singleshot so a future <code>enable()</code> re-subscribes cleanly.</li>
|
| 279 |
+
<li>Wipes <code>_entries</code> β every register'ed entry is forgotten.
|
| 280 |
+
Disposers returned by previous <code>register()</code> calls become no-ops
|
| 281 |
+
(their <code>unregister(name)</code> will not find anything to remove).</li>
|
| 282 |
+
<li>Wipes <code>_firedOnce</code> β all fire-once marks are dropped, so any future
|
| 283 |
+
re-registration of the same <code>name</code> fires again on the next matching
|
| 284 |
+
tick.</li>
|
| 285 |
+
<li>Wipes <code>_lastBoundary</code> β all periodic watermarks are dropped, so a
|
| 286 |
+
re-registered periodic entry starts firing from its next crossed
|
| 287 |
+
boundary again.</li>
|
| 288 |
+
<li>Does <strong>not</strong> touch <code>_inFlight</code> β in-flight handlers continue to
|
| 289 |
+
settle in the background and clear their own slots via <code>.finally()</code>.
|
| 290 |
+
Their final <code>_firedOnce.add(firedKey)</code> writes carry old-generation
|
| 291 |
+
keys and are harmless (lookup uses the post-dispose generation).</li>
|
| 292 |
+
</ol>
|
| 293 |
+
<p>Use from a CLI/session teardown when you want to throw away every
|
| 294 |
+
registration along with the lifecycle wiring β e.g. between two
|
| 295 |
+
independent runner scopes. For "just snap the subscriptions but keep
|
| 296 |
+
registrations" use disable instead; for "just re-arm fire-once
|
| 297 |
+
marks" use clear.</p>
|
| 298 |
+
<p>Idempotent. Safe to call multiple times and safe to call before
|
| 299 |
+
<code>enable()</code> / without any registrations.</p>
|
| 300 |
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#cronutils"><span>Cron<wbr/>Utils</span></a><ul><li><a href="#constructor"><span>Constructor</span></a></li><li><a href="#properties"><span>Properties</span></a></li><li><ul><li><a href="#_entries"><span>_entries</span></a></li><li><a href="#_generationcounter"><span>_generation<wbr/>Counter</span></a></li><li><a href="#_inflight"><span>_in<wbr/>Flight</span></a></li><li><a href="#_firedonce"><span>_fired<wbr/>Once</span></a></li><li><a href="#_lastboundary"><span>_last<wbr/>Boundary</span></a></li><li><a href="#_clearboundaryfor"><span>_clear<wbr/>Boundary<wbr/>For</span></a></li><li><a href="#_clearfiredoncefor"><span>_clear<wbr/>Fired<wbr/>Once<wbr/>For</span></a></li><li><a href="#_runentry"><span>_run<wbr/>Entry</span></a></li><li><a href="#register"><span>register</span></a></li><li><a href="#unregister"><span>unregister</span></a></li><li><a href="#clear"><span>clear</span></a></li><li><a href="#_tick"><span>_tick</span></a></li><li><a href="#enable"><span>enable</span></a></li><li><a href="#disable"><span>disable</span></a></li><li><a href="#dispose"><span>dispose</span></a></li></ul></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 301 |
+
|
| 302 |
+
<!-- Yandex.Metrika counter -->
|
| 303 |
+
<script type="text/javascript">
|
| 304 |
+
(function(m,e,t,r,i,k,a){
|
| 305 |
+
m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
| 306 |
+
m[i].l=1*new Date();
|
| 307 |
+
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
|
| 308 |
+
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)
|
| 309 |
+
})(window, document,'script','https://mc.yandex.ru/metrika/tag.js?id=105455585', 'ym');
|
| 310 |
+
|
| 311 |
+
ym(105455585, 'init', {ssr:true, webvisor:true, clickmap:true, ecommerce:"dataLayer", accurateTrackBounce:true, trackLinks:true});
|
| 312 |
+
</script>
|
| 313 |
+
<noscript><div><img src="https://mc.yandex.ru/watch/105455585" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
| 314 |
+
<!-- /Yandex.Metrika counter -->
|
| 315 |
+
|
| 316 |
+
<!-- Google tag (gtag.js) -->
|
| 317 |
+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3MQZEBBDDR"></script>
|
| 318 |
+
<script>
|
| 319 |
+
window.dataLayer = window.dataLayer || [];
|
| 320 |
+
function gtag(){dataLayer.push(arguments);}
|
| 321 |
+
gtag('js', new Date());
|
| 322 |
+
|
| 323 |
+
gtag('config', 'G-3MQZEBBDDR');
|
| 324 |
+
</script>
|
documents/docs_class_LiveLogicPublicService.html
CHANGED
|
@@ -13,20 +13,23 @@ explicit context parameters.</p>
|
|
| 13 |
<a id="constructor" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Constructor<a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><pre><code class="ts"><span class="hl-0">constructor</span><span class="hl-1">();</span>
|
| 14 |
</code><button type="button">Copy</button></pre>
|
| 15 |
|
| 16 |
-
<a id="properties" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Properties<a href="#properties" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="loggerservice" class="tsd-anchor"></a><h3 class="tsd-anchor-link">loggerService<a href="#loggerservice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">loggerService</span><span class="hl-1">: </span><span class="hl-4">
|
| 17 |
</code><button type="button">Copy</button></pre>
|
| 18 |
|
| 19 |
-
<a id="livelogicprivateservice" class="tsd-anchor"></a><h3 class="tsd-anchor-link">liveLogicPrivateService<a href="#livelogicprivateservice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">liveLogicPrivateService</span><span class="hl-1">: </span><span class="hl-4">
|
| 20 |
</code><button type="button">Copy</button></pre>
|
| 21 |
|
| 22 |
-
<a id="
|
|
|
|
|
|
|
|
|
|
| 23 |
</code><button type="button">Copy</button></pre>
|
| 24 |
|
| 25 |
<p>Runs live trading for a symbol with context propagation.</p>
|
| 26 |
<p>Streams opened and closed signals as infinite async generator.
|
| 27 |
Context is automatically injected into all framework functions.
|
| 28 |
Process can crash and restart - state will be recovered from disk.</p>
|
| 29 |
-
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#livelogicpublicservice"><span>Live<wbr/>Logic<wbr/>Public<wbr/>Service</span></a><ul><li><a href="#constructor"><span>Constructor</span></a></li><li><a href="#properties"><span>Properties</span></a></li><li><ul><li><a href="#loggerservice"><span>logger<wbr/>Service</span></a></li><li><a href="#livelogicprivateservice"><span>live<wbr/>Logic<wbr/>Private<wbr/>Service</span></a></li><li><a href="#run"><span>run</span></a></li></ul></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 30 |
|
| 31 |
<!-- Yandex.Metrika counter -->
|
| 32 |
<script type="text/javascript">
|
|
|
|
| 13 |
<a id="constructor" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Constructor<a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><pre><code class="ts"><span class="hl-0">constructor</span><span class="hl-1">();</span>
|
| 14 |
</code><button type="button">Copy</button></pre>
|
| 15 |
|
| 16 |
+
<a id="properties" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Properties<a href="#properties" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="loggerservice" class="tsd-anchor"></a><h3 class="tsd-anchor-link">loggerService<a href="#loggerservice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">loggerService</span><span class="hl-1">: { </span><span class="hl-4">readonly</span><span class="hl-1"> </span><span class="hl-10">methodContextService</span><span class="hl-1">: { </span><span class="hl-4">readonly</span><span class="hl-1"> </span><span class="hl-10">context</span><span class="hl-1">: </span><span class="hl-4">IMethodContext</span><span class="hl-1">; }; </span><span class="hl-4">readonly</span><span class="hl-1"> </span><span class="hl-10">executionContextService</span><span class="hl-1">: { </span><span class="hl-4">readonly</span><span class="hl-1"> </span><span class="hl-10">context</span><span class="hl-1">: </span><span class="hl-4">IExecutionContext</span><span class="hl-1">; }; ... </span><span class="hl-7">7</span><span class="hl-1"> </span><span class="hl-4">more</span><span class="hl-1"> ...; </span><span class="hl-10">setLogger</span><span class="hl-1">: (</span><span class="hl-4">logger</span><span class="hl-1">: </span><span class="hl-11">ILogger</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-3">void</span><span class="hl-1">; }</span>
|
| 17 |
</code><button type="button">Copy</button></pre>
|
| 18 |
|
| 19 |
+
<a id="livelogicprivateservice" class="tsd-anchor"></a><h3 class="tsd-anchor-link">liveLogicPrivateService<a href="#livelogicprivateservice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">liveLogicPrivateService</span><span class="hl-1">: </span><span class="hl-4">LiveLogicPrivateService</span>
|
| 20 |
</code><button type="button">Copy</button></pre>
|
| 21 |
|
| 22 |
+
<a id="exchangeconnectionservice" class="tsd-anchor"></a><h3 class="tsd-anchor-link">exchangeConnectionService<a href="#exchangeconnectionservice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">exchangeConnectionService</span><span class="hl-1">: </span><span class="hl-4">ExchangeConnectionService</span>
|
| 23 |
+
</code><button type="button">Copy</button></pre>
|
| 24 |
+
|
| 25 |
+
<a id="methods" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Methods<a href="#methods" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="run" class="tsd-anchor"></a><h3 class="tsd-anchor-link">run<a href="#run" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-0">run</span><span class="hl-1">(</span><span class="hl-4">symbol</span><span class="hl-1">: </span><span class="hl-4">string</span><span class="hl-1">, </span><span class="hl-4">context</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-4">strategyName:</span><span class="hl-1"> </span><span class="hl-4">StrategyName</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-4">exchangeName</span><span class="hl-1">: </span><span class="hl-4">ExchangeName</span><span class="hl-1">;</span><br/><span class="hl-1">}): </span><span class="hl-4">AsyncGenerator</span><span class="hl-1"><</span><span class="hl-4">IStrategyTickResultOpened</span><span class="hl-1"> | </span><span class="hl-4">IStrategyTickResultClosed</span><span class="hl-1"> | </span><span class="hl-4">IStrategyTickResultCancelled</span><span class="hl-1">, </span><span class="hl-3">void</span><span class="hl-1">, </span><span class="hl-4">unknown</span><span class="hl-1">>;</span>
|
| 26 |
</code><button type="button">Copy</button></pre>
|
| 27 |
|
| 28 |
<p>Runs live trading for a symbol with context propagation.</p>
|
| 29 |
<p>Streams opened and closed signals as infinite async generator.
|
| 30 |
Context is automatically injected into all framework functions.
|
| 31 |
Process can crash and restart - state will be recovered from disk.</p>
|
| 32 |
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#livelogicpublicservice"><span>Live<wbr/>Logic<wbr/>Public<wbr/>Service</span></a><ul><li><a href="#constructor"><span>Constructor</span></a></li><li><a href="#properties"><span>Properties</span></a></li><li><ul><li><a href="#loggerservice"><span>logger<wbr/>Service</span></a></li><li><a href="#livelogicprivateservice"><span>live<wbr/>Logic<wbr/>Private<wbr/>Service</span></a></li><li><a href="#exchangeconnectionservice"><span>exchange<wbr/>Connection<wbr/>Service</span></a></li></ul></li><li><a href="#methods"><span>Methods</span></a></li><li><ul><li><a href="#run"><span>run</span></a></li></ul></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 33 |
|
| 34 |
<!-- Yandex.Metrika counter -->
|
| 35 |
<script type="text/javascript">
|
documents/docs_class_MarkdownFileBase.html
CHANGED
|
@@ -30,13 +30,13 @@ Each line contains: markdownName, data, symbol, strategyName, exchangeName, fram
|
|
| 30 |
</code><button type="button">Copy</button></pre>
|
| 31 |
|
| 32 |
<p>Base directory for all JSONL markdown files</p>
|
| 33 |
-
<a id="
|
| 34 |
</code><button type="button">Copy</button></pre>
|
| 35 |
|
| 36 |
<p>Singleshot initialization function that creates directory and stream.
|
| 37 |
Protected by singleshot to ensure one-time execution.
|
| 38 |
Sets up error handler that emits to exitEmitter.</p>
|
| 39 |
-
<a id="
|
| 40 |
</code><button type="button">Copy</button></pre>
|
| 41 |
|
| 42 |
<p>Timeout-protected write function with backpressure handling.
|
|
@@ -58,7 +58,7 @@ Appends a single line with JSON object containing:</p>
|
|
| 58 |
<li>Search flags: symbol, strategyName, exchangeName, frameName, signalId</li>
|
| 59 |
<li>timestamp: Current timestamp in milliseconds</li>
|
| 60 |
</ul>
|
| 61 |
-
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#markdownfilebase"><span>Markdown<wbr/>File<wbr/>Base</span></a><ul><li><a href="#constructor"><span>Constructor</span></a></li><li><a href="#properties"><span>Properties</span></a></li><li><ul><li><a href="#markdownname"><span>markdown<wbr/>Name</span></a></li><li><a href="#_filepath"><span>_file<wbr/>Path</span></a></li><li><a href="#_stream"><span>_stream</span></a></li><li><a href="#_basedir"><span>_base<wbr/>Dir</span></a></li><li><a href="#
|
| 62 |
|
| 63 |
<!-- Yandex.Metrika counter -->
|
| 64 |
<script type="text/javascript">
|
|
|
|
| 30 |
</code><button type="button">Copy</button></pre>
|
| 31 |
|
| 32 |
<p>Base directory for all JSONL markdown files</p>
|
| 33 |
+
<a id="__wait_for_init_symbol4233" class="tsd-anchor"></a><h3 class="tsd-anchor-link">__@WAIT_FOR_INIT_SYMBOL@4233<a href="#__wait_for_init_symbol4233" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-4">__</span><span class="hl-1">@</span><span class="hl-8">WAIT_FOR_INIT_SYMBOL</span><span class="hl-1">@</span><span class="hl-7">4233</span><span class="hl-1">: (() </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-11">Promise</span><span class="hl-1"><</span><span class="hl-3">void</span><span class="hl-1">>) & </span><span class="hl-4">ISingleshotClearable</span><span class="hl-1"><() </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-11">Promise</span><span class="hl-1"><</span><span class="hl-3">void</span><span class="hl-1">>></span>
|
| 34 |
</code><button type="button">Copy</button></pre>
|
| 35 |
|
| 36 |
<p>Singleshot initialization function that creates directory and stream.
|
| 37 |
Protected by singleshot to ensure one-time execution.
|
| 38 |
Sets up error handler that emits to exitEmitter.</p>
|
| 39 |
+
<a id="__write_safe_symbol4234" class="tsd-anchor"></a><h3 class="tsd-anchor-link">__@WRITE_SAFE_SYMBOL@4234<a href="#__write_safe_symbol4234" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-4">__</span><span class="hl-1">@</span><span class="hl-8">WRITE_SAFE_SYMBOL</span><span class="hl-1">@</span><span class="hl-7">4234</span><span class="hl-1">: (</span><span class="hl-4">line</span><span class="hl-1">: </span><span class="hl-11">string</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-11">Promise</span><span class="hl-1"><</span><span class="hl-4">symbol</span><span class="hl-1"> | </span><span class="hl-3">void</span><span class="hl-1">></span>
|
| 40 |
</code><button type="button">Copy</button></pre>
|
| 41 |
|
| 42 |
<p>Timeout-protected write function with backpressure handling.
|
|
|
|
| 58 |
<li>Search flags: symbol, strategyName, exchangeName, frameName, signalId</li>
|
| 59 |
<li>timestamp: Current timestamp in milliseconds</li>
|
| 60 |
</ul>
|
| 61 |
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#markdownfilebase"><span>Markdown<wbr/>File<wbr/>Base</span></a><ul><li><a href="#constructor"><span>Constructor</span></a></li><li><a href="#properties"><span>Properties</span></a></li><li><ul><li><a href="#markdownname"><span>markdown<wbr/>Name</span></a></li><li><a href="#_filepath"><span>_file<wbr/>Path</span></a></li><li><a href="#_stream"><span>_stream</span></a></li><li><a href="#_basedir"><span>_base<wbr/>Dir</span></a></li><li><a href="#__wait_for_init_symbol4233"><span>__@WAIT_<wbr/>FOR_<wbr/>INIT_<wbr/>SYMBOL@4233</span></a></li><li><a href="#__write_safe_symbol4234"><span>__@WRITE_<wbr/>SAFE_<wbr/>SYMBOL@4234</span></a></li></ul></li><li><a href="#methods"><span>Methods</span></a></li><li><ul><li><a href="#waitforinit"><span>wait<wbr/>For<wbr/>Init</span></a></li><li><a href="#dump"><span>dump</span></a></li></ul></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 62 |
|
| 63 |
<!-- Yandex.Metrika counter -->
|
| 64 |
<script type="text/javascript">
|
documents/docs_class_PersistBase.html
CHANGED
|
@@ -20,7 +20,7 @@
|
|
| 20 |
</code><button type="button">Copy</button></pre>
|
| 21 |
|
| 22 |
<p>Computed directory path for entity storage</p>
|
| 23 |
-
<a id="
|
| 24 |
</code><button type="button">Copy</button></pre>
|
| 25 |
|
| 26 |
<a id="methods" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Methods<a href="#methods" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="_getfilepath" class="tsd-anchor"></a><h3 class="tsd-anchor-link">_getFilePath<a href="#_getfilepath" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-0">_getFilePath</span><span class="hl-1">(</span><span class="hl-4">entityId</span><span class="hl-1">: </span><span class="hl-4">EntityId</span><span class="hl-1">): </span><span class="hl-4">string</span><span class="hl-1">;</span>
|
|
@@ -50,7 +50,7 @@ Uses singleshot to ensure one-time execution.</p>
|
|
| 50 |
<p>Async generator yielding all entity IDs.
|
| 51 |
Sorted alphanumerically.
|
| 52 |
Used internally by waitForInit for validation.</p>
|
| 53 |
-
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#persistbase"><span>Persist<wbr/>Base</span></a><ul><li><a href="#constructor"><span>Constructor</span></a></li><li><a href="#properties"><span>Properties</span></a></li><li><ul><li><a href="#entityname"><span>entity<wbr/>Name</span></a></li><li><a href="#basedir"><span>base<wbr/>Dir</span></a></li><li><a href="#_directory"><span>_directory</span></a></li><li><a href="#
|
| 54 |
|
| 55 |
<!-- Yandex.Metrika counter -->
|
| 56 |
<script type="text/javascript">
|
|
|
|
| 20 |
</code><button type="button">Copy</button></pre>
|
| 21 |
|
| 22 |
<p>Computed directory path for entity storage</p>
|
| 23 |
+
<a id="__base_wait_for_init_symbol3438" class="tsd-anchor"></a><h3 class="tsd-anchor-link">__@BASE_WAIT_FOR_INIT_SYMBOL@3438<a href="#__base_wait_for_init_symbol3438" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-4">__</span><span class="hl-1">@</span><span class="hl-8">BASE_WAIT_FOR_INIT_SYMBOL</span><span class="hl-1">@</span><span class="hl-7">3438</span><span class="hl-1">: (() </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-11">Promise</span><span class="hl-1"><</span><span class="hl-3">void</span><span class="hl-1">>) & </span><span class="hl-4">ISingleshotClearable</span><span class="hl-1"><() </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-11">Promise</span><span class="hl-1"><</span><span class="hl-3">void</span><span class="hl-1">>></span>
|
| 24 |
</code><button type="button">Copy</button></pre>
|
| 25 |
|
| 26 |
<a id="methods" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Methods<a href="#methods" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="_getfilepath" class="tsd-anchor"></a><h3 class="tsd-anchor-link">_getFilePath<a href="#_getfilepath" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-0">_getFilePath</span><span class="hl-1">(</span><span class="hl-4">entityId</span><span class="hl-1">: </span><span class="hl-4">EntityId</span><span class="hl-1">): </span><span class="hl-4">string</span><span class="hl-1">;</span>
|
|
|
|
| 50 |
<p>Async generator yielding all entity IDs.
|
| 51 |
Sorted alphanumerically.
|
| 52 |
Used internally by waitForInit for validation.</p>
|
| 53 |
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#persistbase"><span>Persist<wbr/>Base</span></a><ul><li><a href="#constructor"><span>Constructor</span></a></li><li><a href="#properties"><span>Properties</span></a></li><li><ul><li><a href="#entityname"><span>entity<wbr/>Name</span></a></li><li><a href="#basedir"><span>base<wbr/>Dir</span></a></li><li><a href="#_directory"><span>_directory</span></a></li><li><a href="#__base_wait_for_init_symbol3438"><span>__@BASE_<wbr/>WAIT_<wbr/>FOR_<wbr/>INIT_<wbr/>SYMBOL@3438</span></a></li></ul></li><li><a href="#methods"><span>Methods</span></a></li><li><ul><li><a href="#_getfilepath"><span>_get<wbr/>File<wbr/>Path</span></a></li><li><a href="#waitforinit"><span>wait<wbr/>For<wbr/>Init</span></a></li><li><a href="#readvalue"><span>read<wbr/>Value</span></a></li><li><a href="#hasvalue"><span>has<wbr/>Value</span></a></li><li><a href="#writevalue"><span>write<wbr/>Value</span></a></li><li><a href="#keys"><span>keys</span></a></li></ul></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 54 |
|
| 55 |
<!-- Yandex.Metrika counter -->
|
| 56 |
<script type="text/javascript">
|
documents/docs_class_ReportBase.html
CHANGED
|
@@ -29,13 +29,13 @@ Each line contains: reportName, data, metadata, timestamp</p>
|
|
| 29 |
</code><button type="button">Copy</button></pre>
|
| 30 |
|
| 31 |
<p>WriteStream instance for append-only writes, null until initialized</p>
|
| 32 |
-
<a id="
|
| 33 |
</code><button type="button">Copy</button></pre>
|
| 34 |
|
| 35 |
<p>Singleshot initialization function that creates directory and stream.
|
| 36 |
Protected by singleshot to ensure one-time execution.
|
| 37 |
Sets up error handler that emits to exitEmitter.</p>
|
| 38 |
-
<a id="
|
| 39 |
</code><button type="button">Copy</button></pre>
|
| 40 |
|
| 41 |
<p>Timeout-protected write function with backpressure handling.
|
|
@@ -57,7 +57,7 @@ Appends a single line with JSON object containing:</p>
|
|
| 57 |
<li>Search flags: symbol, strategyName, exchangeName, frameName, signalId, walkerName</li>
|
| 58 |
<li>timestamp: Current timestamp in milliseconds</li>
|
| 59 |
</ul>
|
| 60 |
-
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#reportbase"><span>Report<wbr/>Base</span></a><ul><li><a href="#constructor"><span>Constructor</span></a></li><li><a href="#properties"><span>Properties</span></a></li><li><ul><li><a href="#reportname"><span>report<wbr/>Name</span></a></li><li><a href="#basedir"><span>base<wbr/>Dir</span></a></li><li><a href="#_filepath"><span>_file<wbr/>Path</span></a></li><li><a href="#_stream"><span>_stream</span></a></li><li><a href="#
|
| 61 |
|
| 62 |
<!-- Yandex.Metrika counter -->
|
| 63 |
<script type="text/javascript">
|
|
|
|
| 29 |
</code><button type="button">Copy</button></pre>
|
| 30 |
|
| 31 |
<p>WriteStream instance for append-only writes, null until initialized</p>
|
| 32 |
+
<a id="__wait_for_init_symbol4233" class="tsd-anchor"></a><h3 class="tsd-anchor-link">__@WAIT_FOR_INIT_SYMBOL@4233<a href="#__wait_for_init_symbol4233" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-4">__</span><span class="hl-1">@</span><span class="hl-8">WAIT_FOR_INIT_SYMBOL</span><span class="hl-1">@</span><span class="hl-7">4233</span><span class="hl-1">: (() </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-11">Promise</span><span class="hl-1"><</span><span class="hl-3">void</span><span class="hl-1">>) & </span><span class="hl-4">ISingleshotClearable</span><span class="hl-1"><() </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-11">Promise</span><span class="hl-1"><</span><span class="hl-3">void</span><span class="hl-1">>></span>
|
| 33 |
</code><button type="button">Copy</button></pre>
|
| 34 |
|
| 35 |
<p>Singleshot initialization function that creates directory and stream.
|
| 36 |
Protected by singleshot to ensure one-time execution.
|
| 37 |
Sets up error handler that emits to exitEmitter.</p>
|
| 38 |
+
<a id="__write_safe_symbol4234" class="tsd-anchor"></a><h3 class="tsd-anchor-link">__@WRITE_SAFE_SYMBOL@4234<a href="#__write_safe_symbol4234" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-4">__</span><span class="hl-1">@</span><span class="hl-8">WRITE_SAFE_SYMBOL</span><span class="hl-1">@</span><span class="hl-7">4234</span><span class="hl-1">: </span><span class="hl-4">IWrappedQueuedFn</span><span class="hl-1"><</span><span class="hl-4">symbol</span><span class="hl-1"> | </span><span class="hl-3">void</span><span class="hl-1">, [</span><span class="hl-4">line</span><span class="hl-1">: </span><span class="hl-4">string</span><span class="hl-1">]></span>
|
| 39 |
</code><button type="button">Copy</button></pre>
|
| 40 |
|
| 41 |
<p>Timeout-protected write function with backpressure handling.
|
|
|
|
| 57 |
<li>Search flags: symbol, strategyName, exchangeName, frameName, signalId, walkerName</li>
|
| 58 |
<li>timestamp: Current timestamp in milliseconds</li>
|
| 59 |
</ul>
|
| 60 |
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#reportbase"><span>Report<wbr/>Base</span></a><ul><li><a href="#constructor"><span>Constructor</span></a></li><li><a href="#properties"><span>Properties</span></a></li><li><ul><li><a href="#reportname"><span>report<wbr/>Name</span></a></li><li><a href="#basedir"><span>base<wbr/>Dir</span></a></li><li><a href="#_filepath"><span>_file<wbr/>Path</span></a></li><li><a href="#_stream"><span>_stream</span></a></li><li><a href="#__wait_for_init_symbol4233"><span>__@WAIT_<wbr/>FOR_<wbr/>INIT_<wbr/>SYMBOL@4233</span></a></li><li><a href="#__write_safe_symbol4234"><span>__@WRITE_<wbr/>SAFE_<wbr/>SYMBOL@4234</span></a></li></ul></li><li><a href="#methods"><span>Methods</span></a></li><li><ul><li><a href="#waitforinit"><span>wait<wbr/>For<wbr/>Init</span></a></li><li><a href="#write"><span>write</span></a></li></ul></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 61 |
|
| 62 |
<!-- Yandex.Metrika counter -->
|
| 63 |
<script type="text/javascript">
|
documents/docs_class_TimeMetaService.html
CHANGED
|
@@ -32,6 +32,10 @@ e.g., when a command is triggered between ticks.</p>
|
|
| 32 |
<p>Memoized factory for BehaviorSubject streams keyed by (symbol, strategyName, exchangeName, frameName, backtest).</p>
|
| 33 |
<p>Each subject holds the latest createdAt timestamp emitted by the strategy iterator for that key.
|
| 34 |
Instances are cached until clear() is called.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
<a id="gettimestamp" class="tsd-anchor"></a><h3 class="tsd-anchor-link">getTimestamp<a href="#gettimestamp" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">getTimestamp</span><span class="hl-1">: (</span><span class="hl-4">symbol</span><span class="hl-1">: </span><span class="hl-11">string</span><span class="hl-1">, </span><span class="hl-4">context</span><span class="hl-1">: { </span><span class="hl-4">strategyName</span><span class="hl-1">: </span><span class="hl-11">string</span><span class="hl-1">; </span><span class="hl-4">exchangeName</span><span class="hl-1">: </span><span class="hl-11">string</span><span class="hl-1">; </span><span class="hl-4">frameName</span><span class="hl-1">: </span><span class="hl-11">string</span><span class="hl-1">; }, </span><span class="hl-4">backtest</span><span class="hl-1">: </span><span class="hl-11">boolean</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-11">Promise</span><span class="hl-1"><</span><span class="hl-4">number</span><span class="hl-1">></span>
|
| 36 |
</code><button type="button">Copy</button></pre>
|
| 37 |
|
|
@@ -53,7 +57,7 @@ the cached timestamp up to date.</p>
|
|
| 53 |
<p>When called without arguments, clears all memoized timestamp streams.
|
| 54 |
When called with a payload, clears only the stream for the specified key.
|
| 55 |
Should be called at strategy start (Backtest/Live/Walker) to reset state.</p>
|
| 56 |
-
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#timemetaservice"><span>Time<wbr/>Meta<wbr/>Service</span></a><ul><li><a href="#constructor"><span>Constructor</span></a></li><li><a href="#properties"><span>Properties</span></a></li><li><ul><li><a href="#loggerservice"><span>logger<wbr/>Service</span></a></li><li><a href="#executioncontextservice"><span>execution<wbr/>Context<wbr/>Service</span></a></li><li><a href="#getsource"><span>get<wbr/>Source</span></a></li><li><a href="#gettimestamp"><span>get<wbr/>Timestamp</span></a></li><li><a href="#next"><span>next</span></a></li><li><a href="#clear"><span>clear</span></a></li></ul></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 57 |
|
| 58 |
<!-- Yandex.Metrika counter -->
|
| 59 |
<script type="text/javascript">
|
|
|
|
| 32 |
<p>Memoized factory for BehaviorSubject streams keyed by (symbol, strategyName, exchangeName, frameName, backtest).</p>
|
| 33 |
<p>Each subject holds the latest createdAt timestamp emitted by the strategy iterator for that key.
|
| 34 |
Instances are cached until clear() is called.</p>
|
| 35 |
+
<a id="hastimestamp" class="tsd-anchor"></a><h3 class="tsd-anchor-link">hasTimestamp<a href="#hastimestamp" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">hasTimestamp</span><span class="hl-1">: (</span><span class="hl-4">symbol</span><span class="hl-1">: </span><span class="hl-11">string</span><span class="hl-1">, </span><span class="hl-4">context</span><span class="hl-1">: { </span><span class="hl-4">strategyName</span><span class="hl-1">: </span><span class="hl-11">string</span><span class="hl-1">; </span><span class="hl-4">exchangeName</span><span class="hl-1">: </span><span class="hl-11">string</span><span class="hl-1">; </span><span class="hl-4">frameName</span><span class="hl-1">: </span><span class="hl-11">string</span><span class="hl-1">; }, </span><span class="hl-4">backtest</span><span class="hl-1">: </span><span class="hl-11">boolean</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-4">boolean</span>
|
| 36 |
+
</code><button type="button">Copy</button></pre>
|
| 37 |
+
|
| 38 |
+
<p>Checks if a timestamp exists for the given symbol and context.</p>
|
| 39 |
<a id="gettimestamp" class="tsd-anchor"></a><h3 class="tsd-anchor-link">getTimestamp<a href="#gettimestamp" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">getTimestamp</span><span class="hl-1">: (</span><span class="hl-4">symbol</span><span class="hl-1">: </span><span class="hl-11">string</span><span class="hl-1">, </span><span class="hl-4">context</span><span class="hl-1">: { </span><span class="hl-4">strategyName</span><span class="hl-1">: </span><span class="hl-11">string</span><span class="hl-1">; </span><span class="hl-4">exchangeName</span><span class="hl-1">: </span><span class="hl-11">string</span><span class="hl-1">; </span><span class="hl-4">frameName</span><span class="hl-1">: </span><span class="hl-11">string</span><span class="hl-1">; }, </span><span class="hl-4">backtest</span><span class="hl-1">: </span><span class="hl-11">boolean</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-11">Promise</span><span class="hl-1"><</span><span class="hl-4">number</span><span class="hl-1">></span>
|
| 40 |
</code><button type="button">Copy</button></pre>
|
| 41 |
|
|
|
|
| 57 |
<p>When called without arguments, clears all memoized timestamp streams.
|
| 58 |
When called with a payload, clears only the stream for the specified key.
|
| 59 |
Should be called at strategy start (Backtest/Live/Walker) to reset state.</p>
|
| 60 |
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#timemetaservice"><span>Time<wbr/>Meta<wbr/>Service</span></a><ul><li><a href="#constructor"><span>Constructor</span></a></li><li><a href="#properties"><span>Properties</span></a></li><li><ul><li><a href="#loggerservice"><span>logger<wbr/>Service</span></a></li><li><a href="#executioncontextservice"><span>execution<wbr/>Context<wbr/>Service</span></a></li><li><a href="#getsource"><span>get<wbr/>Source</span></a></li><li><a href="#hastimestamp"><span>has<wbr/>Timestamp</span></a></li><li><a href="#gettimestamp"><span>get<wbr/>Timestamp</span></a></li><li><a href="#next"><span>next</span></a></li><li><a href="#clear"><span>clear</span></a></li></ul></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 61 |
|
| 62 |
<!-- Yandex.Metrika counter -->
|
| 63 |
<script type="text/javascript">
|
documents/docs_function_listenAfterEnd.html
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>docs/function/listenAfterEnd | backtest-kit</title><meta name="description" content="Documentation for backtest-kit"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">backtest-kit</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">backtest-kit</a></li><li><a href="docs_function_listenAfterEnd.html">docs/function/listenAfterEnd</a></li></ul></div><div class="tsd-panel tsd-typography"><a id="listenafterend" class="tsd-anchor"></a><h1 class="tsd-anchor-link">listenAfterEnd<a href="#listenafterend" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h1><pre><code class="ts"><span class="hl-3">declare</span><span class="hl-1"> </span><span class="hl-3">function</span><span class="hl-1"> </span><span class="hl-0">listenAfterEnd</span><span class="hl-1">(</span><span class="hl-0">fn</span><span class="hl-1">: (</span><span class="hl-4">event</span><span class="hl-1">: </span><span class="hl-11">AfterEndContract</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-11">void</span><span class="hl-1">): () </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-11">void</span><span class="hl-1">;</span>
|
| 2 |
+
</code><button type="button">Copy</button></pre>
|
| 3 |
+
|
| 4 |
+
<p>Subscribes to after end events with queued async processing.
|
| 5 |
+
Emits when the engine has completed processing a strategy execution for a symbol.
|
| 6 |
+
Events are processed sequentially in order received, even if callback is async.
|
| 7 |
+
Uses queued wrapper to prevent concurrent execution of the callback.</p>
|
| 8 |
+
<a id="parameters" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Parameters<a href="#parameters" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><table>
|
| 9 |
+
<thead>
|
| 10 |
+
<tr>
|
| 11 |
+
<th>Parameter</th>
|
| 12 |
+
<th>Description</th>
|
| 13 |
+
</tr>
|
| 14 |
+
</thead>
|
| 15 |
+
<tbody>
|
| 16 |
+
<tr>
|
| 17 |
+
<td><code>fn</code></td>
|
| 18 |
+
<td>Callback function to handle after end events</td>
|
| 19 |
+
</tr>
|
| 20 |
+
</tbody>
|
| 21 |
+
</table>
|
| 22 |
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#listenafterend"><span>listen<wbr/>After<wbr/>End</span></a><ul><li><a href="#parameters"><span>Parameters</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 23 |
+
|
| 24 |
+
<!-- Yandex.Metrika counter -->
|
| 25 |
+
<script type="text/javascript">
|
| 26 |
+
(function(m,e,t,r,i,k,a){
|
| 27 |
+
m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
| 28 |
+
m[i].l=1*new Date();
|
| 29 |
+
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
|
| 30 |
+
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)
|
| 31 |
+
})(window, document,'script','https://mc.yandex.ru/metrika/tag.js?id=105455585', 'ym');
|
| 32 |
+
|
| 33 |
+
ym(105455585, 'init', {ssr:true, webvisor:true, clickmap:true, ecommerce:"dataLayer", accurateTrackBounce:true, trackLinks:true});
|
| 34 |
+
</script>
|
| 35 |
+
<noscript><div><img src="https://mc.yandex.ru/watch/105455585" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
| 36 |
+
<!-- /Yandex.Metrika counter -->
|
| 37 |
+
|
| 38 |
+
<!-- Google tag (gtag.js) -->
|
| 39 |
+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3MQZEBBDDR"></script>
|
| 40 |
+
<script>
|
| 41 |
+
window.dataLayer = window.dataLayer || [];
|
| 42 |
+
function gtag(){dataLayer.push(arguments);}
|
| 43 |
+
gtag('js', new Date());
|
| 44 |
+
|
| 45 |
+
gtag('config', 'G-3MQZEBBDDR');
|
| 46 |
+
</script>
|
documents/docs_function_listenAfterEndOnce.html
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>docs/function/listenAfterEndOnce | backtest-kit</title><meta name="description" content="Documentation for backtest-kit"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">backtest-kit</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">backtest-kit</a></li><li><a href="docs_function_listenAfterEndOnce.html">docs/function/listenAfterEndOnce</a></li></ul></div><div class="tsd-panel tsd-typography"><a id="listenafterendonce" class="tsd-anchor"></a><h1 class="tsd-anchor-link">listenAfterEndOnce<a href="#listenafterendonce" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h1><pre><code class="ts"><span class="hl-3">declare</span><span class="hl-1"> </span><span class="hl-3">function</span><span class="hl-1"> </span><span class="hl-0">listenAfterEndOnce</span><span class="hl-1">(</span><span class="hl-0">filterFn</span><span class="hl-1">: (</span><span class="hl-4">event</span><span class="hl-1">: </span><span class="hl-11">AfterEndContract</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-11">boolean</span><span class="hl-1">, </span><span class="hl-0">fn</span><span class="hl-1">: (</span><span class="hl-4">event</span><span class="hl-1">: </span><span class="hl-11">AfterEndContract</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-11">void</span><span class="hl-1">): () </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-11">void</span><span class="hl-1">;</span>
|
| 2 |
+
</code><button type="button">Copy</button></pre>
|
| 3 |
+
|
| 4 |
+
<p>Subscribes to filtered after end events with one-time execution.
|
| 5 |
+
Listens for events matching the filter predicate, then executes callback once
|
| 6 |
+
and automatically unsubscribes.</p>
|
| 7 |
+
<a id="parameters" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Parameters<a href="#parameters" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><table>
|
| 8 |
+
<thead>
|
| 9 |
+
<tr>
|
| 10 |
+
<th>Parameter</th>
|
| 11 |
+
<th>Description</th>
|
| 12 |
+
</tr>
|
| 13 |
+
</thead>
|
| 14 |
+
<tbody>
|
| 15 |
+
<tr>
|
| 16 |
+
<td><code>filterFn</code></td>
|
| 17 |
+
<td>Predicate to filter which events trigger the callback</td>
|
| 18 |
+
</tr>
|
| 19 |
+
<tr>
|
| 20 |
+
<td><code>fn</code></td>
|
| 21 |
+
<td>Callback function to handle the filtered event (called only once)</td>
|
| 22 |
+
</tr>
|
| 23 |
+
</tbody>
|
| 24 |
+
</table>
|
| 25 |
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#listenafterendonce"><span>listen<wbr/>After<wbr/>End<wbr/>Once</span></a><ul><li><a href="#parameters"><span>Parameters</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 26 |
+
|
| 27 |
+
<!-- Yandex.Metrika counter -->
|
| 28 |
+
<script type="text/javascript">
|
| 29 |
+
(function(m,e,t,r,i,k,a){
|
| 30 |
+
m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
| 31 |
+
m[i].l=1*new Date();
|
| 32 |
+
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
|
| 33 |
+
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)
|
| 34 |
+
})(window, document,'script','https://mc.yandex.ru/metrika/tag.js?id=105455585', 'ym');
|
| 35 |
+
|
| 36 |
+
ym(105455585, 'init', {ssr:true, webvisor:true, clickmap:true, ecommerce:"dataLayer", accurateTrackBounce:true, trackLinks:true});
|
| 37 |
+
</script>
|
| 38 |
+
<noscript><div><img src="https://mc.yandex.ru/watch/105455585" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
| 39 |
+
<!-- /Yandex.Metrika counter -->
|
| 40 |
+
|
| 41 |
+
<!-- Google tag (gtag.js) -->
|
| 42 |
+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3MQZEBBDDR"></script>
|
| 43 |
+
<script>
|
| 44 |
+
window.dataLayer = window.dataLayer || [];
|
| 45 |
+
function gtag(){dataLayer.push(arguments);}
|
| 46 |
+
gtag('js', new Date());
|
| 47 |
+
|
| 48 |
+
gtag('config', 'G-3MQZEBBDDR');
|
| 49 |
+
</script>
|
documents/docs_function_listenBeforeStart.html
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>docs/function/listenBeforeStart | backtest-kit</title><meta name="description" content="Documentation for backtest-kit"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">backtest-kit</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">backtest-kit</a></li><li><a href="docs_function_listenBeforeStart.html">docs/function/listenBeforeStart</a></li></ul></div><div class="tsd-panel tsd-typography"><a id="listenbeforestart" class="tsd-anchor"></a><h1 class="tsd-anchor-link">listenBeforeStart<a href="#listenbeforestart" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h1><pre><code class="ts"><span class="hl-3">declare</span><span class="hl-1"> </span><span class="hl-3">function</span><span class="hl-1"> </span><span class="hl-0">listenBeforeStart</span><span class="hl-1">(</span><span class="hl-0">fn</span><span class="hl-1">: (</span><span class="hl-4">event</span><span class="hl-1">: </span><span class="hl-11">BeforeStartContract</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-11">void</span><span class="hl-1">): () </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-11">void</span><span class="hl-1">;</span>
|
| 2 |
+
</code><button type="button">Copy</button></pre>
|
| 3 |
+
|
| 4 |
+
<p>Subscribes to before start events with queued async processing.
|
| 5 |
+
Emits when the engine is about to start a new strategy execution for a symbol.
|
| 6 |
+
Events are processed sequentially in order received, even if callback is async.
|
| 7 |
+
Uses queued wrapper to prevent concurrent execution of the callback.</p>
|
| 8 |
+
<a id="parameters" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Parameters<a href="#parameters" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><table>
|
| 9 |
+
<thead>
|
| 10 |
+
<tr>
|
| 11 |
+
<th>Parameter</th>
|
| 12 |
+
<th>Description</th>
|
| 13 |
+
</tr>
|
| 14 |
+
</thead>
|
| 15 |
+
<tbody>
|
| 16 |
+
<tr>
|
| 17 |
+
<td><code>fn</code></td>
|
| 18 |
+
<td>Callback function to handle before start events</td>
|
| 19 |
+
</tr>
|
| 20 |
+
</tbody>
|
| 21 |
+
</table>
|
| 22 |
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#listenbeforestart"><span>listen<wbr/>Before<wbr/>Start</span></a><ul><li><a href="#parameters"><span>Parameters</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 23 |
+
|
| 24 |
+
<!-- Yandex.Metrika counter -->
|
| 25 |
+
<script type="text/javascript">
|
| 26 |
+
(function(m,e,t,r,i,k,a){
|
| 27 |
+
m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
| 28 |
+
m[i].l=1*new Date();
|
| 29 |
+
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
|
| 30 |
+
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)
|
| 31 |
+
})(window, document,'script','https://mc.yandex.ru/metrika/tag.js?id=105455585', 'ym');
|
| 32 |
+
|
| 33 |
+
ym(105455585, 'init', {ssr:true, webvisor:true, clickmap:true, ecommerce:"dataLayer", accurateTrackBounce:true, trackLinks:true});
|
| 34 |
+
</script>
|
| 35 |
+
<noscript><div><img src="https://mc.yandex.ru/watch/105455585" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
| 36 |
+
<!-- /Yandex.Metrika counter -->
|
| 37 |
+
|
| 38 |
+
<!-- Google tag (gtag.js) -->
|
| 39 |
+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3MQZEBBDDR"></script>
|
| 40 |
+
<script>
|
| 41 |
+
window.dataLayer = window.dataLayer || [];
|
| 42 |
+
function gtag(){dataLayer.push(arguments);}
|
| 43 |
+
gtag('js', new Date());
|
| 44 |
+
|
| 45 |
+
gtag('config', 'G-3MQZEBBDDR');
|
| 46 |
+
</script>
|
documents/docs_function_listenBeforeStartOnce.html
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>docs/function/listenBeforeStartOnce | backtest-kit</title><meta name="description" content="Documentation for backtest-kit"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">backtest-kit</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">backtest-kit</a></li><li><a href="docs_function_listenBeforeStartOnce.html">docs/function/listenBeforeStartOnce</a></li></ul></div><div class="tsd-panel tsd-typography"><a id="listenbeforestartonce" class="tsd-anchor"></a><h1 class="tsd-anchor-link">listenBeforeStartOnce<a href="#listenbeforestartonce" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h1><pre><code class="ts"><span class="hl-3">declare</span><span class="hl-1"> </span><span class="hl-3">function</span><span class="hl-1"> </span><span class="hl-0">listenBeforeStartOnce</span><span class="hl-1">(</span><span class="hl-0">filterFn</span><span class="hl-1">: (</span><span class="hl-4">event</span><span class="hl-1">: </span><span class="hl-11">BeforeStartContract</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-11">boolean</span><span class="hl-1">, </span><span class="hl-0">fn</span><span class="hl-1">: (</span><span class="hl-4">event</span><span class="hl-1">: </span><span class="hl-11">BeforeStartContract</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-11">void</span><span class="hl-1">): () </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-11">void</span><span class="hl-1">;</span>
|
| 2 |
+
</code><button type="button">Copy</button></pre>
|
| 3 |
+
|
| 4 |
+
<p>Subscribes to filtered before start events with one-time execution.
|
| 5 |
+
Listens for events matching the filter predicate, then executes callback once
|
| 6 |
+
and automatically unsubscribes.</p>
|
| 7 |
+
<a id="parameters" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Parameters<a href="#parameters" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><table>
|
| 8 |
+
<thead>
|
| 9 |
+
<tr>
|
| 10 |
+
<th>Parameter</th>
|
| 11 |
+
<th>Description</th>
|
| 12 |
+
</tr>
|
| 13 |
+
</thead>
|
| 14 |
+
<tbody>
|
| 15 |
+
<tr>
|
| 16 |
+
<td><code>filterFn</code></td>
|
| 17 |
+
<td>Predicate to filter which events trigger the callback</td>
|
| 18 |
+
</tr>
|
| 19 |
+
<tr>
|
| 20 |
+
<td><code>fn</code></td>
|
| 21 |
+
<td>Callback function to handle the filtered event (called only once)</td>
|
| 22 |
+
</tr>
|
| 23 |
+
</tbody>
|
| 24 |
+
</table>
|
| 25 |
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#listenbeforestartonce"><span>listen<wbr/>Before<wbr/>Start<wbr/>Once</span></a><ul><li><a href="#parameters"><span>Parameters</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 26 |
+
|
| 27 |
+
<!-- Yandex.Metrika counter -->
|
| 28 |
+
<script type="text/javascript">
|
| 29 |
+
(function(m,e,t,r,i,k,a){
|
| 30 |
+
m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
| 31 |
+
m[i].l=1*new Date();
|
| 32 |
+
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
|
| 33 |
+
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)
|
| 34 |
+
})(window, document,'script','https://mc.yandex.ru/metrika/tag.js?id=105455585', 'ym');
|
| 35 |
+
|
| 36 |
+
ym(105455585, 'init', {ssr:true, webvisor:true, clickmap:true, ecommerce:"dataLayer", accurateTrackBounce:true, trackLinks:true});
|
| 37 |
+
</script>
|
| 38 |
+
<noscript><div><img src="https://mc.yandex.ru/watch/105455585" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
| 39 |
+
<!-- /Yandex.Metrika counter -->
|
| 40 |
+
|
| 41 |
+
<!-- Google tag (gtag.js) -->
|
| 42 |
+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3MQZEBBDDR"></script>
|
| 43 |
+
<script>
|
| 44 |
+
window.dataLayer = window.dataLayer || [];
|
| 45 |
+
function gtag(){dataLayer.push(arguments);}
|
| 46 |
+
gtag('js', new Date());
|
| 47 |
+
|
| 48 |
+
gtag('config', 'G-3MQZEBBDDR');
|
| 49 |
+
</script>
|
documents/docs_interface_AfterEndContract.html
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>docs/interface/AfterEndContract | backtest-kit</title><meta name="description" content="Documentation for backtest-kit"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">backtest-kit</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">backtest-kit</a></li><li><a href="docs_interface_AfterEndContract.html">docs/interface/AfterEndContract</a></li></ul></div><div class="tsd-panel tsd-typography"><a id="afterendcontract" class="tsd-anchor"></a><h1 class="tsd-anchor-link">AfterEndContract<a href="#afterendcontract" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h1><p>Contract for the afterEnd lifecycle event of strategy execution.</p>
|
| 2 |
+
<p>Emitted by the engine after the strategy iterator has finished β whether
|
| 3 |
+
by reaching the end of the frame, being stopped via <code>stopStrategy</code>,
|
| 4 |
+
throwing an error, or being cancelled by the consumer (e.g., breaking out
|
| 5 |
+
of <code>for await</code>). Used by subscribers to perform teardown that should
|
| 6 |
+
happen exactly once per run: flushing buffers, closing files, computing
|
| 7 |
+
final aggregates, sending a "run completed" notification, etc.</p>
|
| 8 |
+
<p>Guarantees:</p>
|
| 9 |
+
<ul>
|
| 10 |
+
<li>Fires exactly once per <code>run()</code> invocation, paired with the matching
|
| 11 |
+
<code>BeforeStartContract</code> event. The pairing holds for every termination
|
| 12 |
+
path including exceptions and external cancellation (delivered via the
|
| 13 |
+
generator's <code>try/finally</code> block).</li>
|
| 14 |
+
<li>Listener errors are caught and routed to the global errorEmitter; they
|
| 15 |
+
never propagate to the original caller.</li>
|
| 16 |
+
</ul>
|
| 17 |
+
<p>Mode differences:</p>
|
| 18 |
+
<ul>
|
| 19 |
+
<li>In backtest mode, <code>when</code> is the cursor position from <code>TimeMetaService</code>
|
| 20 |
+
at the moment of completion β i.e., the historical time of the last
|
| 21 |
+
processed candle. If the run was interrupted before any candle was
|
| 22 |
+
processed (e.g., empty frame, immediate cancellation), <code>when</code> falls
|
| 23 |
+
back to the frame's planned start date so it equals
|
| 24 |
+
<code>BeforeStartContract.when</code> for the same run. This means
|
| 25 |
+
<code>afterEnd.when - beforeStart.when</code> is always the real processed
|
| 26 |
+
duration, never an inflated planned one.</li>
|
| 27 |
+
<li>In live mode, <code>when</code> is the current wall-clock time aligned to the
|
| 28 |
+
1-minute boundary at the moment of emission.</li>
|
| 29 |
+
</ul>
|
| 30 |
+
<a id="properties" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Properties<a href="#properties" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="symbol" class="tsd-anchor"></a><h3 class="tsd-anchor-link">symbol<a href="#symbol" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">symbol</span><span class="hl-1">: </span><span class="hl-4">string</span>
|
| 31 |
+
</code><button type="button">Copy</button></pre>
|
| 32 |
+
|
| 33 |
+
<p>Trading symbol the run was for (e.g., "BTCUSDT", "ETHUSDT").
|
| 34 |
+
Matches the symbol from the paired <code>BeforeStartContract</code>.</p>
|
| 35 |
+
<a id="strategyname" class="tsd-anchor"></a><h3 class="tsd-anchor-link">strategyName<a href="#strategyname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">strategyName</span><span class="hl-1">: </span><span class="hl-4">string</span>
|
| 36 |
+
</code><button type="button">Copy</button></pre>
|
| 37 |
+
|
| 38 |
+
<p>Name of the strategy that was executed. Use this to demultiplex events
|
| 39 |
+
when subscribing globally to runs across multiple strategies on the
|
| 40 |
+
same symbol.</p>
|
| 41 |
+
<a id="exchangename" class="tsd-anchor"></a><h3 class="tsd-anchor-link">exchangeName<a href="#exchangename" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">exchangeName</span><span class="hl-1">: </span><span class="hl-4">string</span>
|
| 42 |
+
</code><button type="button">Copy</button></pre>
|
| 43 |
+
|
| 44 |
+
<p>Name of the exchange that provided market data for this run.</p>
|
| 45 |
+
<a id="framename" class="tsd-anchor"></a><h3 class="tsd-anchor-link">frameName<a href="#framename" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">frameName</span><span class="hl-1">: </span><span class="hl-4">string</span>
|
| 46 |
+
</code><button type="button">Copy</button></pre>
|
| 47 |
+
|
| 48 |
+
<p>Name of the frame (timeframe / date range) the run used. Empty string
|
| 49 |
+
in live mode, where frames are not used.</p>
|
| 50 |
+
<a id="backtest" class="tsd-anchor"></a><h3 class="tsd-anchor-link">backtest<a href="#backtest" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">backtest</span><span class="hl-1">: </span><span class="hl-4">boolean</span>
|
| 51 |
+
</code><button type="button">Copy</button></pre>
|
| 52 |
+
|
| 53 |
+
<p><code>true</code> if this event was emitted from a backtest run, <code>false</code> if from a
|
| 54 |
+
live trading run. Use this to branch listener logic without inspecting
|
| 55 |
+
other fields.</p>
|
| 56 |
+
<a id="currentprice" class="tsd-anchor"></a><h3 class="tsd-anchor-link">currentPrice<a href="#currentprice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">currentPrice</span><span class="hl-1">: </span><span class="hl-4">number</span>
|
| 57 |
+
</code><button type="button">Copy</button></pre>
|
| 58 |
+
|
| 59 |
+
<p>Average symbol price observed at the moment the event was emitted,
|
| 60 |
+
fetched from <code>ExchangeConnectionService.getAveragePrice(symbol)</code>.
|
| 61 |
+
Provided as a convenience so subscribers don't need to query the
|
| 62 |
+
exchange themselves.</p>
|
| 63 |
+
<a id="when" class="tsd-anchor"></a><h3 class="tsd-anchor-link">when<a href="#when" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">when</span><span class="hl-1">: </span><span class="hl-4">Date</span>
|
| 64 |
+
</code><button type="button">Copy</button></pre>
|
| 65 |
+
|
| 66 |
+
<p>Event time as a <code>Date</code> instance.</p>
|
| 67 |
+
<p>In backtest: cursor position from <code>TimeMetaService</code> at completion (the
|
| 68 |
+
time of the last processed candle), with fallback to the frame's
|
| 69 |
+
planned start date if no candle was processed.</p>
|
| 70 |
+
<p>In live: wall-clock now, aligned to 1-minute boundary.</p>
|
| 71 |
+
<p>Always equal to <code>new Date(timestamp)</code>.</p>
|
| 72 |
+
<a id="timestamp" class="tsd-anchor"></a><h3 class="tsd-anchor-link">timestamp<a href="#timestamp" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">timestamp</span><span class="hl-1">: </span><span class="hl-4">number</span>
|
| 73 |
+
</code><button type="button">Copy</button></pre>
|
| 74 |
+
|
| 75 |
+
<p>Same value as <code>when</code>, expressed as milliseconds since the Unix epoch.
|
| 76 |
+
Provided so subscribers can avoid calling <code>.getTime()</code> and to keep the
|
| 77 |
+
payload trivially serialisable (e.g., for forwarding over IPC or
|
| 78 |
+
writing to a log).</p>
|
| 79 |
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#afterendcontract"><span>After<wbr/>End<wbr/>Contract</span></a><ul><li><a href="#properties"><span>Properties</span></a></li><li><ul><li><a href="#symbol"><span>symbol</span></a></li><li><a href="#strategyname"><span>strategy<wbr/>Name</span></a></li><li><a href="#exchangename"><span>exchange<wbr/>Name</span></a></li><li><a href="#framename"><span>frame<wbr/>Name</span></a></li><li><a href="#backtest"><span>backtest</span></a></li><li><a href="#currentprice"><span>current<wbr/>Price</span></a></li><li><a href="#when"><span>when</span></a></li><li><a href="#timestamp"><span>timestamp</span></a></li></ul></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 80 |
+
|
| 81 |
+
<!-- Yandex.Metrika counter -->
|
| 82 |
+
<script type="text/javascript">
|
| 83 |
+
(function(m,e,t,r,i,k,a){
|
| 84 |
+
m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
| 85 |
+
m[i].l=1*new Date();
|
| 86 |
+
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
|
| 87 |
+
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)
|
| 88 |
+
})(window, document,'script','https://mc.yandex.ru/metrika/tag.js?id=105455585', 'ym');
|
| 89 |
+
|
| 90 |
+
ym(105455585, 'init', {ssr:true, webvisor:true, clickmap:true, ecommerce:"dataLayer", accurateTrackBounce:true, trackLinks:true});
|
| 91 |
+
</script>
|
| 92 |
+
<noscript><div><img src="https://mc.yandex.ru/watch/105455585" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
| 93 |
+
<!-- /Yandex.Metrika counter -->
|
| 94 |
+
|
| 95 |
+
<!-- Google tag (gtag.js) -->
|
| 96 |
+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3MQZEBBDDR"></script>
|
| 97 |
+
<script>
|
| 98 |
+
window.dataLayer = window.dataLayer || [];
|
| 99 |
+
function gtag(){dataLayer.push(arguments);}
|
| 100 |
+
gtag('js', new Date());
|
| 101 |
+
|
| 102 |
+
gtag('config', 'G-3MQZEBBDDR');
|
| 103 |
+
</script>
|
documents/docs_interface_BacktestStatisticsModel.html
CHANGED
|
@@ -40,7 +40,7 @@ Provides comprehensive metrics for strategy performance analysis.</p>
|
|
| 40 |
<a id="annualizedsharperatio" class="tsd-anchor"></a><h3 class="tsd-anchor-link">annualizedSharpeRatio<a href="#annualizedsharperatio" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">annualizedSharpeRatio</span><span class="hl-1">: </span><span class="hl-4">number</span>
|
| 41 |
</code><button type="button">Copy</button></pre>
|
| 42 |
|
| 43 |
-
<p>Annualized Sharpe Ratio (sharpeRatio Γ β
|
| 44 |
<a id="certaintyratio" class="tsd-anchor"></a><h3 class="tsd-anchor-link">certaintyRatio<a href="#certaintyratio" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">certaintyRatio</span><span class="hl-1">: </span><span class="hl-4">number</span>
|
| 45 |
</code><button type="button">Copy</button></pre>
|
| 46 |
|
|
@@ -60,7 +60,7 @@ Provides comprehensive metrics for strategy performance analysis.</p>
|
|
| 60 |
<a id="sortinoratio" class="tsd-anchor"></a><h3 class="tsd-anchor-link">sortinoRatio<a href="#sortinoratio" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">sortinoRatio</span><span class="hl-1">: </span><span class="hl-4">number</span>
|
| 61 |
</code><button type="button">Copy</button></pre>
|
| 62 |
|
| 63 |
-
<p>Sortino Ratio (avgPnl / downside deviation β
|
| 64 |
<a id="calmarratio" class="tsd-anchor"></a><h3 class="tsd-anchor-link">calmarRatio<a href="#calmarratio" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">calmarRatio</span><span class="hl-1">: </span><span class="hl-4">number</span>
|
| 65 |
</code><button type="button">Copy</button></pre>
|
| 66 |
|
|
|
|
| 40 |
<a id="annualizedsharperatio" class="tsd-anchor"></a><h3 class="tsd-anchor-link">annualizedSharpeRatio<a href="#annualizedsharperatio" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">annualizedSharpeRatio</span><span class="hl-1">: </span><span class="hl-4">number</span>
|
| 41 |
</code><button type="button">Copy</button></pre>
|
| 42 |
|
| 43 |
+
<p>Annualized Sharpe Ratio (sharpeRatio Γ βtradesPerYear), null if unsafe. Higher is better.</p>
|
| 44 |
<a id="certaintyratio" class="tsd-anchor"></a><h3 class="tsd-anchor-link">certaintyRatio<a href="#certaintyratio" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">certaintyRatio</span><span class="hl-1">: </span><span class="hl-4">number</span>
|
| 45 |
</code><button type="button">Copy</button></pre>
|
| 46 |
|
|
|
|
| 60 |
<a id="sortinoratio" class="tsd-anchor"></a><h3 class="tsd-anchor-link">sortinoRatio<a href="#sortinoratio" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">sortinoRatio</span><span class="hl-1">: </span><span class="hl-4">number</span>
|
| 61 |
</code><button type="button">Copy</button></pre>
|
| 62 |
|
| 63 |
+
<p>Sortino Ratio (avgPnl / downside deviation β RMS of losing trades only), null if unsafe. Higher is better.</p>
|
| 64 |
<a id="calmarratio" class="tsd-anchor"></a><h3 class="tsd-anchor-link">calmarRatio<a href="#calmarratio" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">calmarRatio</span><span class="hl-1">: </span><span class="hl-4">number</span>
|
| 65 |
</code><button type="button">Copy</button></pre>
|
| 66 |
|
documents/docs_interface_BeforeStartContract.html
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>docs/interface/BeforeStartContract | backtest-kit</title><meta name="description" content="Documentation for backtest-kit"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">backtest-kit</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">backtest-kit</a></li><li><a href="docs_interface_BeforeStartContract.html">docs/interface/BeforeStartContract</a></li></ul></div><div class="tsd-panel tsd-typography"><a id="beforestartcontract" class="tsd-anchor"></a><h1 class="tsd-anchor-link">BeforeStartContract<a href="#beforestartcontract" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h1><p>Contract for the beforeStart lifecycle event of strategy execution.</p>
|
| 2 |
+
<p>Emitted by the engine immediately before it begins iterating the strategy
|
| 3 |
+
for a given symbol β after validation and context setup, but before the
|
| 4 |
+
first candle/tick is processed. Used by subscribers to perform
|
| 5 |
+
initialization that should happen exactly once per run: opening log files,
|
| 6 |
+
resetting per-run accumulators, sending a "run started" notification,
|
| 7 |
+
snapshotting initial state, etc.</p>
|
| 8 |
+
<p>Guarantees:</p>
|
| 9 |
+
<ul>
|
| 10 |
+
<li>Fires exactly once per <code>run()</code> invocation, before any signal is yielded.</li>
|
| 11 |
+
<li>Always paired with an <code>AfterEndContract</code> event for the same run, even if
|
| 12 |
+
the iterator is interrupted, throws, or is cancelled externally. If
|
| 13 |
+
beforeStart fires, afterEnd is guaranteed to fire afterwards.</li>
|
| 14 |
+
<li>Listener errors are caught and routed to the global errorEmitter; they
|
| 15 |
+
never abort the run.</li>
|
| 16 |
+
</ul>
|
| 17 |
+
<p>Mode differences:</p>
|
| 18 |
+
<ul>
|
| 19 |
+
<li>In backtest mode, <code>when</code> is the planned start of the frame (from
|
| 20 |
+
FrameSchemaService.startDate, aligned to 1-minute boundary). It is the
|
| 21 |
+
intended beginning of the historical replay, not wall-clock time.</li>
|
| 22 |
+
<li>In live mode, <code>when</code> is the current wall-clock time aligned to the
|
| 23 |
+
1-minute boundary.</li>
|
| 24 |
+
</ul>
|
| 25 |
+
<a id="properties" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Properties<a href="#properties" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="symbol" class="tsd-anchor"></a><h3 class="tsd-anchor-link">symbol<a href="#symbol" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">symbol</span><span class="hl-1">: </span><span class="hl-4">string</span>
|
| 26 |
+
</code><button type="button">Copy</button></pre>
|
| 27 |
+
|
| 28 |
+
<p>Trading symbol the run is for (e.g., "BTCUSDT", "ETHUSDT").
|
| 29 |
+
Same value that was passed to <code>Backtest.run</code> / <code>Live.run</code>.</p>
|
| 30 |
+
<a id="strategyname" class="tsd-anchor"></a><h3 class="tsd-anchor-link">strategyName<a href="#strategyname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">strategyName</span><span class="hl-1">: </span><span class="hl-4">string</span>
|
| 31 |
+
</code><button type="button">Copy</button></pre>
|
| 32 |
+
|
| 33 |
+
<p>Name of the strategy being executed. Use this to demultiplex events when
|
| 34 |
+
subscribing globally to runs across multiple strategies on the same
|
| 35 |
+
symbol.</p>
|
| 36 |
+
<a id="exchangename" class="tsd-anchor"></a><h3 class="tsd-anchor-link">exchangeName<a href="#exchangename" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">exchangeName</span><span class="hl-1">: </span><span class="hl-4">string</span>
|
| 37 |
+
</code><button type="button">Copy</button></pre>
|
| 38 |
+
|
| 39 |
+
<p>Name of the exchange providing market data for this run.</p>
|
| 40 |
+
<a id="framename" class="tsd-anchor"></a><h3 class="tsd-anchor-link">frameName<a href="#framename" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">frameName</span><span class="hl-1">: </span><span class="hl-4">string</span>
|
| 41 |
+
</code><button type="button">Copy</button></pre>
|
| 42 |
+
|
| 43 |
+
<p>Name of the frame (timeframe / date range) for the run. Empty string in
|
| 44 |
+
live mode, where frames are not used.</p>
|
| 45 |
+
<a id="backtest" class="tsd-anchor"></a><h3 class="tsd-anchor-link">backtest<a href="#backtest" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">backtest</span><span class="hl-1">: </span><span class="hl-4">boolean</span>
|
| 46 |
+
</code><button type="button">Copy</button></pre>
|
| 47 |
+
|
| 48 |
+
<p><code>true</code> if this event was emitted from a backtest run, <code>false</code> if from a
|
| 49 |
+
live trading run. Use this to branch listener logic without inspecting
|
| 50 |
+
other fields.</p>
|
| 51 |
+
<a id="currentprice" class="tsd-anchor"></a><h3 class="tsd-anchor-link">currentPrice<a href="#currentprice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">currentPrice</span><span class="hl-1">: </span><span class="hl-4">number</span>
|
| 52 |
+
</code><button type="button">Copy</button></pre>
|
| 53 |
+
|
| 54 |
+
<p>Average symbol price observed at the moment the event was emitted,
|
| 55 |
+
fetched from <code>ExchangeConnectionService.getAveragePrice(symbol)</code>.
|
| 56 |
+
Provided as a convenience so subscribers don't need to query the
|
| 57 |
+
exchange themselves.</p>
|
| 58 |
+
<a id="when" class="tsd-anchor"></a><h3 class="tsd-anchor-link">when<a href="#when" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">when</span><span class="hl-1">: </span><span class="hl-4">Date</span>
|
| 59 |
+
</code><button type="button">Copy</button></pre>
|
| 60 |
+
|
| 61 |
+
<p>Event time as a <code>Date</code> instance.</p>
|
| 62 |
+
<p>In backtest: the planned start of the frame (aligned to 1-minute
|
| 63 |
+
boundary). Represents intended start time, not the moment of emission.</p>
|
| 64 |
+
<p>In live: wall-clock now, aligned to 1-minute boundary.</p>
|
| 65 |
+
<p>Always equal to <code>new Date(timestamp)</code>.</p>
|
| 66 |
+
<a id="timestamp" class="tsd-anchor"></a><h3 class="tsd-anchor-link">timestamp<a href="#timestamp" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">timestamp</span><span class="hl-1">: </span><span class="hl-4">number</span>
|
| 67 |
+
</code><button type="button">Copy</button></pre>
|
| 68 |
+
|
| 69 |
+
<p>Same value as <code>when</code>, expressed as milliseconds since the Unix epoch.
|
| 70 |
+
Provided so subscribers can avoid calling <code>.getTime()</code> and to keep the
|
| 71 |
+
payload trivially serialisable (e.g., for forwarding over IPC or
|
| 72 |
+
writing to a log).</p>
|
| 73 |
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#beforestartcontract"><span>Before<wbr/>Start<wbr/>Contract</span></a><ul><li><a href="#properties"><span>Properties</span></a></li><li><ul><li><a href="#symbol"><span>symbol</span></a></li><li><a href="#strategyname"><span>strategy<wbr/>Name</span></a></li><li><a href="#exchangename"><span>exchange<wbr/>Name</span></a></li><li><a href="#framename"><span>frame<wbr/>Name</span></a></li><li><a href="#backtest"><span>backtest</span></a></li><li><a href="#currentprice"><span>current<wbr/>Price</span></a></li><li><a href="#when"><span>when</span></a></li><li><a href="#timestamp"><span>timestamp</span></a></li></ul></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 74 |
+
|
| 75 |
+
<!-- Yandex.Metrika counter -->
|
| 76 |
+
<script type="text/javascript">
|
| 77 |
+
(function(m,e,t,r,i,k,a){
|
| 78 |
+
m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
| 79 |
+
m[i].l=1*new Date();
|
| 80 |
+
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
|
| 81 |
+
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)
|
| 82 |
+
})(window, document,'script','https://mc.yandex.ru/metrika/tag.js?id=105455585', 'ym');
|
| 83 |
+
|
| 84 |
+
ym(105455585, 'init', {ssr:true, webvisor:true, clickmap:true, ecommerce:"dataLayer", accurateTrackBounce:true, trackLinks:true});
|
| 85 |
+
</script>
|
| 86 |
+
<noscript><div><img src="https://mc.yandex.ru/watch/105455585" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
| 87 |
+
<!-- /Yandex.Metrika counter -->
|
| 88 |
+
|
| 89 |
+
<!-- Google tag (gtag.js) -->
|
| 90 |
+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3MQZEBBDDR"></script>
|
| 91 |
+
<script>
|
| 92 |
+
window.dataLayer = window.dataLayer || [];
|
| 93 |
+
function gtag(){dataLayer.push(arguments);}
|
| 94 |
+
gtag('js', new Date());
|
| 95 |
+
|
| 96 |
+
gtag('config', 'G-3MQZEBBDDR');
|
| 97 |
+
</script>
|
documents/docs_interface_CronEntry.html
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>docs/interface/CronEntry | backtest-kit</title><meta name="description" content="Documentation for backtest-kit"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">backtest-kit</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">backtest-kit</a></li><li><a href="docs_interface_CronEntry.html">docs/interface/CronEntry</a></li></ul></div><div class="tsd-panel tsd-typography"><a id="cronentry" class="tsd-anchor"></a><h1 class="tsd-anchor-link">CronEntry<a href="#cronentry" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h1><p>Configuration for a registered cron entry.</p>
|
| 2 |
+
<a id="properties" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Properties<a href="#properties" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="name" class="tsd-anchor"></a><h3 class="tsd-anchor-link">name<a href="#name" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">name</span><span class="hl-1">: </span><span class="hl-4">string</span>
|
| 3 |
+
</code><button type="button">Copy</button></pre>
|
| 4 |
+
|
| 5 |
+
<p>Unique name of the entry. Used as the dedup key on <code>register</code> (re-registering
|
| 6 |
+
the same name replaces the previous entry) and as part of the singleshot
|
| 7 |
+
coordination key.</p>
|
| 8 |
+
<p>Must be non-empty and must not contain <code>:</code> β <code>:</code> is reserved as the slot-key
|
| 9 |
+
segment separator and would otherwise create ambiguity between global and
|
| 10 |
+
fan-out fire-once keys.</p>
|
| 11 |
+
<a id="interval" class="tsd-anchor"></a><h3 class="tsd-anchor-link">interval<a href="#interval" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">interval</span><span class="hl-1">: </span><span class="hl-4">CandleInterval</span>
|
| 12 |
+
</code><button type="button">Copy</button></pre>
|
| 13 |
+
|
| 14 |
+
<p>Candle interval at whose boundaries the handler fires.
|
| 15 |
+
Same scale as <a href="../types/types.CandleInterval.html" class="tsd-kind-type-alias"> CandleInterval</a> used by <code>Interval</code> and <code>Cache</code>:
|
| 16 |
+
<code>"1m" &vert; "5m" | "1h" | "1d"</code> etc.</p>
|
| 17 |
+
<p>If omitted, the entry switches to <strong>fire-once</strong> mode: the handler is
|
| 18 |
+
invoked on the very first matching tick (no boundary check) and never
|
| 19 |
+
again. If the handler throws, the entry is <strong>not</strong> marked as fired and
|
| 20 |
+
will retry on the next tick.</p>
|
| 21 |
+
<a id="symbols" class="tsd-anchor"></a><h3 class="tsd-anchor-link">symbols<a href="#symbols" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">symbols</span><span class="hl-1">: </span><span class="hl-4">string</span><span class="hl-1">[]</span>
|
| 22 |
+
</code><button type="button">Copy</button></pre>
|
| 23 |
+
|
| 24 |
+
<p>Symbol whitelist that doubles as the fan-out switch.</p>
|
| 25 |
+
<ul>
|
| 26 |
+
<li><strong>Empty/undefined β global singleshot</strong>: across all parallel backtests
|
| 27 |
+
the handler runs <strong>once</strong> per boundary. The first symbol to reach the
|
| 28 |
+
boundary opens the slot; others await the same promise.</li>
|
| 29 |
+
<li><strong>Non-empty β per-symbol fan-out</strong>: ticks whose <code>symbol</code> is not in the
|
| 30 |
+
list are skipped, and ticks whose <code>symbol</code> <em>is</em> in the list each open
|
| 31 |
+
their own slot. The handler runs <strong>once per whitelisted symbol</strong> per
|
| 32 |
+
boundary.</li>
|
| 33 |
+
</ul>
|
| 34 |
+
<p>The same rule applies in fire-once mode: global β handler runs once
|
| 35 |
+
total; fan-out β once per whitelisted symbol.</p>
|
| 36 |
+
<p>Each symbol must not contain <code>:</code> (same reason as <a href="../interfaces/types.CronEntry.html#name" class="tsd-kind-property"> CronEntry.name</a>).</p>
|
| 37 |
+
<a id="handler" class="tsd-anchor"></a><h3 class="tsd-anchor-link">handler<a href="#handler" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="ts"><span class="hl-10">handler</span><span class="hl-1">: </span><span class="hl-4">CronCallback</span>
|
| 38 |
+
</code><button type="button">Copy</button></pre>
|
| 39 |
+
|
| 40 |
+
<p>Handler invoked on the first parallel tick to reach a new boundary.</p>
|
| 41 |
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#cronentry"><span>Cron<wbr/>Entry</span></a><ul><li><a href="#properties"><span>Properties</span></a></li><li><ul><li><a href="#name"><span>name</span></a></li><li><a href="#interval"><span>interval</span></a></li><li><a href="#symbols"><span>symbols</span></a></li><li><a href="#handler"><span>handler</span></a></li></ul></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 42 |
+
|
| 43 |
+
<!-- Yandex.Metrika counter -->
|
| 44 |
+
<script type="text/javascript">
|
| 45 |
+
(function(m,e,t,r,i,k,a){
|
| 46 |
+
m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
| 47 |
+
m[i].l=1*new Date();
|
| 48 |
+
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
|
| 49 |
+
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)
|
| 50 |
+
})(window, document,'script','https://mc.yandex.ru/metrika/tag.js?id=105455585', 'ym');
|
| 51 |
+
|
| 52 |
+
ym(105455585, 'init', {ssr:true, webvisor:true, clickmap:true, ecommerce:"dataLayer", accurateTrackBounce:true, trackLinks:true});
|
| 53 |
+
</script>
|
| 54 |
+
<noscript><div><img src="https://mc.yandex.ru/watch/105455585" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
| 55 |
+
<!-- /Yandex.Metrika counter -->
|
| 56 |
+
|
| 57 |
+
<!-- Google tag (gtag.js) -->
|
| 58 |
+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3MQZEBBDDR"></script>
|
| 59 |
+
<script>
|
| 60 |
+
window.dataLayer = window.dataLayer || [];
|
| 61 |
+
function gtag(){dataLayer.push(arguments);}
|
| 62 |
+
gtag('js', new Date());
|
| 63 |
+
|
| 64 |
+
gtag('config', 'G-3MQZEBBDDR');
|
| 65 |
+
</script>
|
documents/docs_interface_CronHandle.html
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>docs/interface/CronHandle | backtest-kit</title><meta name="description" content="Documentation for backtest-kit"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">backtest-kit</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">backtest-kit</a></li><li><a href="docs_interface_CronHandle.html">docs/interface/CronHandle</a></li></ul></div><div class="tsd-panel tsd-typography"><a id="cronhandle" class="tsd-anchor"></a><h1 class="tsd-anchor-link">CronHandle<a href="#cronhandle" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h1><p>Handle returned from <code>register</code>. Call it to unregister the entry β
|
| 2 |
+
equivalent to <code>Cron.unregister(name)</code>.</p>
|
| 3 |
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#cronhandle"><span>Cron<wbr/>Handle</span></a></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">backtest-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
| 4 |
+
|
| 5 |
+
<!-- Yandex.Metrika counter -->
|
| 6 |
+
<script type="text/javascript">
|
| 7 |
+
(function(m,e,t,r,i,k,a){
|
| 8 |
+
m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
| 9 |
+
m[i].l=1*new Date();
|
| 10 |
+
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
|
| 11 |
+
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)
|
| 12 |
+
})(window, document,'script','https://mc.yandex.ru/metrika/tag.js?id=105455585', 'ym');
|
| 13 |
+
|
| 14 |
+
ym(105455585, 'init', {ssr:true, webvisor:true, clickmap:true, ecommerce:"dataLayer", accurateTrackBounce:true, trackLinks:true});
|
| 15 |
+
</script>
|
| 16 |
+
<noscript><div><img src="https://mc.yandex.ru/watch/105455585" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
| 17 |
+
<!-- /Yandex.Metrika counter -->
|
| 18 |
+
|
| 19 |
+
<!-- Google tag (gtag.js) -->
|
| 20 |
+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3MQZEBBDDR"></script>
|
| 21 |
+
<script>
|
| 22 |
+
window.dataLayer = window.dataLayer || [];
|
| 23 |
+
function gtag(){dataLayer.push(arguments);}
|
| 24 |
+
gtag('js', new Date());
|
| 25 |
+
|
| 26 |
+
gtag('config', 'G-3MQZEBBDDR');
|
| 27 |
+
</script>
|