backtest-kit-docs / documents /begin_23_glossary.html
tripolskypetr's picture
deploy: migrate media images to Git LFS
8b8fb92
Raw
History Blame Contribute Delete
17.5 kB
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>begin/23_glossary | 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="begin_23_glossary.html">begin/23_glossary</a></li></ul></div><div class="tsd-panel tsd-typography"><a id="glossary" class="tsd-anchor"></a><h1 class="tsd-anchor-link">Glossary<a href="#glossary" aria-label="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>This page provides definitions for codebase-specific terminology, domain concepts, and implementation details used within the <code>news-sentiment-ai-trader</code> system.</p>
<a id="1-core-domain-concepts" class="tsd-anchor"></a><h2 class="tsd-anchor-link">1. Core Domain Concepts<a href="#1-core-domain-concepts" aria-label="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="forecast-sentiment" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Forecast (Sentiment)<a href="#forecast-sentiment" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The primary output of the LLM logic, representing the predicted market direction based on news analysis.</p>
<ul>
<li><strong>bullish</strong>: News background is positive; participants expect growth.</li>
<li><strong>bearish</strong>: News background is negative; participants expect a drop.</li>
<li><strong>neutral</strong>: Balanced or absent news background.</li>
<li><strong>sideways</strong>: Contradictory news causing uncertainty.</li>
</ul>
<a id="signal" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Signal<a href="#signal" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><p>A structured instruction generated by a strategy to enter or exit a market position.</p>
<ul>
<li><strong>Implementation</strong>: Defined in <code>getSignal</code> within <code>addStrategySchema</code>.</li>
<li><strong>State Machine</strong>: Progresses through states: <code>idle</code>, <code>scheduled</code>, <code>opened</code>, <code>active</code>, <code>closed</code>, or <code>cancelled</code>.</li>
</ul>
<a id="backtest-frame" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Backtest Frame<a href="#backtest-frame" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><p>A temporal configuration defining the window and interval for historical simulation.</p>
<ul>
<li><strong>Implementation</strong>: <code>addFrameSchema</code> defines the <code>startDate</code>, <code>endDate</code>, and <code>interval</code> (e.g., <code>1m</code>).</li>
</ul>
<a id="moonbag" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Moonbag<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><p>A specific position configuration provided by <code>backtest-kit</code> that typically involves a fixed stop-loss and trailing logic.</p>
<ul>
<li><strong>Implementation</strong>: Used in <code>feb_2026_strategy</code> via <code>Position.moonbag()</code>.</li>
</ul>
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
<hr>
<a id="2-technical-infrastructure-terms" class="tsd-anchor"></a><h2 class="tsd-anchor-link">2. Technical Infrastructure Terms<a href="#2-technical-infrastructure-terms" aria-label="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="advisor" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Advisor<a href="#advisor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><p>A component within the <code>agent-swarm-kit</code> ecosystem that provides specific data to the LLM.</p>
<ul>
<li><strong>TavilyNewsAdvisor</strong>: Fetches and formats news data from the Tavily API.</li>
</ul>
<a id="outline" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Outline<a href="#outline" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><p>A template for LLM interaction that defines the prompt, expected JSON schema, and validation rules.</p>
<ul>
<li><strong>ForecastOutline</strong>: The specific outline used to generate market sentiment.</li>
</ul>
<a id="completion" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Completion<a href="#completion" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The specific LLM execution mode.</p>
<ul>
<li><strong>OllamaOutlineToolCompletion</strong>: Uses Ollama with tool-calling capabilities (specifically the <code>provide_answer</code> function) to ensure structured JSON output.</li>
</ul>
<a id="news-window" class="tsd-anchor"></a><h3 class="tsd-anchor-link">News Window<a href="#news-window" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><p>A temporal filter applied to news fetching to prevent look-ahead bias and focus on recent events.</p>
<ul>
<li><strong>Implementation</strong>: Set to 24 hours in the strategy and enforced in the fetcher.</li>
</ul>
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
<hr>
<a id="3-implementation-mapping-diagrams" class="tsd-anchor"></a><h2 class="tsd-anchor-link">3. Implementation Mapping Diagrams<a href="#3-implementation-mapping-diagrams" aria-label="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="forecast-data-flow-from-news-to-signal" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Forecast Data Flow: From News to Signal<a href="#forecast-data-flow-from-news-to-signal" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><p>This diagram maps the logical transition from raw external news to a code-level <code>Signal</code>.</p>
<a id="forecast-pipeline-architecturemermaid-diagram" class="tsd-anchor"></a><h2 class="tsd-anchor-link"><strong>Forecast Pipeline Architecture</strong>
<img src="../media/23-glossary_0.svg" alt="Mermaid Diagram"><a href="#forecast-pipeline-architecturemermaid-diagram" aria-label="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>
<li></li>
<li></li>
</ul>
<a id="execution-mapping-strategy-to-exchange" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Execution Mapping: Strategy to Exchange<a href="#execution-mapping-strategy-to-exchange" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><p>This diagram shows how strategy logic interacts with the framework-level exchange adapters.</p>
<a id="execution-logic-mappingmermaid-diagram" class="tsd-anchor"></a><h2 class="tsd-anchor-link"><strong>Execution Logic Mapping</strong>
<img src="../media/23-glossary_1.svg" alt="Mermaid Diagram"><a href="#execution-logic-mappingmermaid-diagram" aria-label="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>
<li></li>
<li></li>
<li></li>
</ul>
<hr>
<a id="4-key-abbreviations--variables" class="tsd-anchor"></a><h2 class="tsd-anchor-link">4. Key Abbreviations &amp; Variables<a href="#4-key-abbreviations--variables" aria-label="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>
<thead>
<tr>
<th style="text-align:left">Term</th>
<th style="text-align:left">Definition</th>
<th style="text-align:left">Code Reference</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><strong>PNL</strong></td>
<td style="text-align:left">Profit and Loss. Calculated as a percentage including slippage and fees.</td>
<td style="text-align:left"></td>
</tr>
<tr>
<td style="text-align:left"><strong>SL</strong></td>
<td style="text-align:left">Stop-Loss. The price level at which a losing position is automatically closed.</td>
<td style="text-align:left"></td>
</tr>
<tr>
<td style="text-align:left"><strong>TP</strong></td>
<td style="text-align:left">Take-Profit. The price level at which a winning position is closed.</td>
<td style="text-align:left"></td>
</tr>
<tr>
<td style="text-align:left"><strong>OHLCV</strong></td>
<td style="text-align:left">Open, High, Low, Close, Volume. Standard candle data format.</td>
<td style="text-align:left"></td>
</tr>
<tr>
<td style="text-align:left"><strong>Trailing Take</strong></td>
<td style="text-align:left">A dynamic exit strategy that closes a position if profit drops by a certain amount from its peak.</td>
<td style="text-align:left"></td>
</tr>
<tr>
<td style="text-align:left"><strong>Sentiment Flip</strong></td>
<td style="text-align:left">Closing a position because the LLM forecast changed to the opposite direction.</td>
<td style="text-align:left"></td>
</tr>
</tbody>
</table>
<ul>
<li></li>
<li></li>
<li></li>
</ul>
</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="#glossary"><span>Glossary</span></a><ul><li><a href="#1-core-domain-concepts"><span>1. <wbr/>Core <wbr/>Domain <wbr/>Concepts</span></a></li><li><ul><li><a href="#forecast-sentiment"><span>Forecast (<wbr/>Sentiment)</span></a></li><li><a href="#signal"><span>Signal</span></a></li><li><a href="#backtest-frame"><span>Backtest <wbr/>Frame</span></a></li><li><a href="#moonbag"><span>Moonbag</span></a></li></ul></li><li><a href="#2-technical-infrastructure-terms"><span>2. <wbr/>Technical <wbr/>Infrastructure <wbr/>Terms</span></a></li><li><ul><li><a href="#advisor"><span>Advisor</span></a></li><li><a href="#outline"><span>Outline</span></a></li><li><a href="#completion"><span>Completion</span></a></li><li><a href="#news-window"><span>News <wbr/>Window</span></a></li></ul></li><li><a href="#3-implementation-mapping-diagrams"><span>3. <wbr/>Implementation <wbr/>Mapping <wbr/>Diagrams</span></a></li><li><ul><li><a href="#forecast-data-flow-from-news-to-signal"><span>Forecast <wbr/>Data <wbr/>Flow: <wbr/>From <wbr/>News to <wbr/>Signal</span></a></li></ul></li></ul><a href="#forecast-pipeline-architecturemermaid-diagram"><span>Forecast <wbr/>Pipeline <wbr/>Architecture<wbr/>Mermaid <wbr/>Diagram</span></a><ul><li><ul><li><a href="#execution-mapping-strategy-to-exchange"><span>Execution <wbr/>Mapping: <wbr/>Strategy to <wbr/>Exchange</span></a></li></ul></li></ul><a href="#execution-logic-mappingmermaid-diagram"><span>Execution <wbr/>Logic <wbr/>Mapping<wbr/>Mermaid <wbr/>Diagram</span></a><ul><li><a href="#4-key-abbreviations--variables"><span>4. <wbr/>Key <wbr/>Abbreviations &amp; <wbr/>Variables</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>
<!-- Yandex.Metrika counter -->
<script type="text/javascript">
(function(m,e,t,r,i,k,a){
m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)
})(window, document,'script','https://mc.yandex.ru/metrika/tag.js?id=105455585', 'ym');
ym(105455585, 'init', {ssr:true, webvisor:true, clickmap:true, ecommerce:"dataLayer", accurateTrackBounce:true, trackLinks:true});
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/105455585" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3MQZEBBDDR"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-3MQZEBBDDR');
</script>