mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-14 12:13:57 +00:00
1735 lines
87 KiB
HTML
1735 lines
87 KiB
HTML
|
|
<!doctype html>
|
|
<html lang="en" class="no-js">
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
|
|
|
|
|
|
<link rel="canonical" href="https://www.freqtrade.io/2022.7/strategy_migration/">
|
|
|
|
<link rel="icon" href="../images/logo.png">
|
|
<meta name="generator" content="mkdocs-1.3.1, mkdocs-material-8.3.9">
|
|
|
|
|
|
|
|
<title>Strategy migration - Freqtrade</title>
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../assets/stylesheets/main.1d29e8d0.min.css">
|
|
|
|
|
|
<link rel="stylesheet" href="../assets/stylesheets/palette.cbb835fc.min.css">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
|
|
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../stylesheets/ft.extra.css">
|
|
|
|
<script>__md_scope=new URL("..",location),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
|
|
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="blue-grey" data-md-color-accent="tear">
|
|
|
|
|
|
|
|
<script>var palette=__md_get("__palette");if(palette&&"object"==typeof palette.color)for(var key of Object.keys(palette.color))document.body.setAttribute("data-md-color-"+key,palette.color[key])</script>
|
|
|
|
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
|
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
|
<label class="md-overlay" for="__drawer"></label>
|
|
<div data-md-component="skip">
|
|
|
|
|
|
<a href="#strategy-migration-between-v2-and-v3" class="md-skip">
|
|
Skip to content
|
|
</a>
|
|
|
|
</div>
|
|
<div data-md-component="announce">
|
|
|
|
</div>
|
|
|
|
<div data-md-component="outdated" hidden>
|
|
<aside class="md-banner md-banner--warning">
|
|
|
|
</aside>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<header class="md-header" data-md-component="header">
|
|
<nav class="md-header__inner md-grid" aria-label="Header">
|
|
<a href=".." title="Freqtrade" class="md-header__button md-logo" aria-label="Freqtrade" data-md-component="logo">
|
|
|
|
<img src="../images/logo.png" alt="logo">
|
|
|
|
</a>
|
|
<label class="md-header__button md-icon" for="__drawer">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
|
|
</label>
|
|
<div class="md-header__title" data-md-component="header-title">
|
|
<div class="md-header__ellipsis">
|
|
<div class="md-header__topic">
|
|
<span class="md-ellipsis">
|
|
Freqtrade
|
|
</span>
|
|
</div>
|
|
<div class="md-header__topic" data-md-component="header-topic">
|
|
<span class="md-ellipsis">
|
|
|
|
Strategy migration
|
|
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<form class="md-header__option" data-md-component="palette">
|
|
|
|
|
|
|
|
<input class="md-option" data-md-color-media="" data-md-color-scheme="default" data-md-color-primary="blue-grey" data-md-color-accent="tear" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_1">
|
|
|
|
<label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_2" hidden>
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zM7 9c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<input class="md-option" data-md-color-media="" data-md-color-scheme="slate" data-md-color-primary="blue-grey" data-md-color-accent="tear" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_2">
|
|
|
|
<label class="md-header__button md-icon" title="Switch to light mode" for="__palette_1" hidden>
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 7H7a5 5 0 0 0-5 5 5 5 0 0 0 5 5h10a5 5 0 0 0 5-5 5 5 0 0 0-5-5m0 8a3 3 0 0 1-3-3 3 3 0 0 1 3-3 3 3 0 0 1 3 3 3 3 0 0 1-3 3Z"/></svg>
|
|
</label>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<label class="md-header__button md-icon" for="__search">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
|
|
</label>
|
|
<div class="md-search" data-md-component="search" role="dialog">
|
|
<label class="md-search__overlay" for="__search"></label>
|
|
<div class="md-search__inner" role="search">
|
|
<form class="md-search__form" name="search">
|
|
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
|
|
<label class="md-search__icon md-icon" for="__search">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
|
|
</label>
|
|
<nav class="md-search__options" aria-label="Search">
|
|
|
|
<button type="reset" class="md-search__icon md-icon" aria-label="Clear" tabindex="-1">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"/></svg>
|
|
</button>
|
|
</nav>
|
|
|
|
</form>
|
|
<div class="md-search__output">
|
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
|
<div class="md-search-result" data-md-component="search-result">
|
|
<div class="md-search-result__meta">
|
|
Initializing search
|
|
</div>
|
|
<ol class="md-search-result__list"></ol>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="md-header__source">
|
|
<a href="https://github.com/freqtrade/freqtrade" title="Go to repository" class="md-source" data-md-component="source">
|
|
<div class="md-source__icon md-icon">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
|
|
</div>
|
|
<div class="md-source__repository">
|
|
GitHub
|
|
</div>
|
|
</a>
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
</header>
|
|
|
|
<div class="md-container" data-md-component="container">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<main class="md-main" data-md-component="main">
|
|
<div class="md-main__inner md-grid">
|
|
|
|
|
|
<!-- Main navigation -->
|
|
|
|
|
|
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
|
|
<div class="md-sidebar__scrollwrap">
|
|
<div id="widget-wrapper">
|
|
|
|
</div>
|
|
<div class="md-sidebar__inner">
|
|
|
|
|
|
|
|
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
|
|
<label class="md-nav__title" for="__drawer">
|
|
<a href=".." title="Freqtrade" class="md-nav__button md-logo" aria-label="Freqtrade" data-md-component="logo">
|
|
|
|
<img src="../images/logo.png" alt="logo">
|
|
|
|
</a>
|
|
Freqtrade
|
|
</label>
|
|
|
|
<div class="md-nav__source">
|
|
<a href="https://github.com/freqtrade/freqtrade" title="Go to repository" class="md-source" data-md-component="source">
|
|
<div class="md-source__icon md-icon">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
|
|
</div>
|
|
<div class="md-source__repository">
|
|
GitHub
|
|
</div>
|
|
</a>
|
|
</div>
|
|
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href=".." class="md-nav__link">
|
|
Home
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../docker_quickstart/" class="md-nav__link">
|
|
Quickstart with Docker
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--nested">
|
|
|
|
|
|
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_3" type="checkbox" id="__nav_3" >
|
|
|
|
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_3">
|
|
Installation
|
|
<span class="md-nav__icon md-icon"></span>
|
|
</label>
|
|
|
|
<nav class="md-nav" aria-label="Installation" data-md-level="1">
|
|
<label class="md-nav__title" for="__nav_3">
|
|
<span class="md-nav__icon md-icon"></span>
|
|
Installation
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../installation/" class="md-nav__link">
|
|
Linux/MacOS/Raspberry
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../windows_installation/" class="md-nav__link">
|
|
Windows
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../bot-basics/" class="md-nav__link">
|
|
Freqtrade Basics
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../configuration/" class="md-nav__link">
|
|
Configuration
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../strategy-customization/" class="md-nav__link">
|
|
Strategy Customization
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../strategy-callbacks/" class="md-nav__link">
|
|
Strategy Callbacks
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../stoploss/" class="md-nav__link">
|
|
Stoploss
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../plugins/" class="md-nav__link">
|
|
Plugins
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../bot-usage/" class="md-nav__link">
|
|
Start the bot
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--nested">
|
|
|
|
|
|
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_11" type="checkbox" id="__nav_11" >
|
|
|
|
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_11">
|
|
Control the bot
|
|
<span class="md-nav__icon md-icon"></span>
|
|
</label>
|
|
|
|
<nav class="md-nav" aria-label="Control the bot" data-md-level="1">
|
|
<label class="md-nav__title" for="__nav_11">
|
|
<span class="md-nav__icon md-icon"></span>
|
|
Control the bot
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../telegram-usage/" class="md-nav__link">
|
|
Telegram
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../rest-api/" class="md-nav__link">
|
|
REST API & FreqUI
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../webhook-config/" class="md-nav__link">
|
|
Web Hook
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../data-download/" class="md-nav__link">
|
|
Data Downloading
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../backtesting/" class="md-nav__link">
|
|
Backtesting
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../hyperopt/" class="md-nav__link">
|
|
Hyperopt
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../leverage/" class="md-nav__link">
|
|
Short / Leverage
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../utils/" class="md-nav__link">
|
|
Utility Sub-commands
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../plotting/" class="md-nav__link">
|
|
Plotting
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../exchanges/" class="md-nav__link">
|
|
Exchange-specific Notes
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--nested">
|
|
|
|
|
|
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_19" type="checkbox" id="__nav_19" >
|
|
|
|
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_19">
|
|
Data Analysis
|
|
<span class="md-nav__icon md-icon"></span>
|
|
</label>
|
|
|
|
<nav class="md-nav" aria-label="Data Analysis" data-md-level="1">
|
|
<label class="md-nav__title" for="__nav_19">
|
|
<span class="md-nav__icon md-icon"></span>
|
|
Data Analysis
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../data-analysis/" class="md-nav__link">
|
|
Jupyter Notebooks
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../strategy_analysis_example/" class="md-nav__link">
|
|
Strategy analysis
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../advanced-backtesting/" class="md-nav__link">
|
|
Backtest analysis
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--nested">
|
|
|
|
|
|
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_20" type="checkbox" id="__nav_20" >
|
|
|
|
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_20">
|
|
Advanced Topics
|
|
<span class="md-nav__icon md-icon"></span>
|
|
</label>
|
|
|
|
<nav class="md-nav" aria-label="Advanced Topics" data-md-level="1">
|
|
<label class="md-nav__title" for="__nav_20">
|
|
<span class="md-nav__icon md-icon"></span>
|
|
Advanced Topics
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../advanced-setup/" class="md-nav__link">
|
|
Advanced Post-installation Tasks
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../edge/" class="md-nav__link">
|
|
Edge Positioning
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../strategy-advanced/" class="md-nav__link">
|
|
Advanced Strategy
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../advanced-hyperopt/" class="md-nav__link">
|
|
Advanced Hyperopt
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../sandbox-testing/" class="md-nav__link">
|
|
Sandbox Testing
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../faq/" class="md-nav__link">
|
|
FAQ
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../sql_cheatsheet/" class="md-nav__link">
|
|
SQL Cheat-sheet
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--active">
|
|
|
|
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
|
|
|
|
|
|
|
|
|
|
|
<label class="md-nav__link md-nav__link--active" for="__toc">
|
|
Strategy migration
|
|
<span class="md-nav__icon md-icon"></span>
|
|
</label>
|
|
|
|
<a href="./" class="md-nav__link md-nav__link--active">
|
|
Strategy migration
|
|
</a>
|
|
|
|
|
|
|
|
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<label class="md-nav__title" for="__toc">
|
|
<span class="md-nav__icon md-icon"></span>
|
|
Table of contents
|
|
</label>
|
|
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#quick-summary-migration-checklist" class="md-nav__link">
|
|
Quick summary / migration checklist
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#extensive-explanation" class="md-nav__link">
|
|
Extensive explanation
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Extensive explanation">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#populate_buy_trend" class="md-nav__link">
|
|
populate_buy_trend
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#populate_sell_trend" class="md-nav__link">
|
|
populate_sell_trend
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#custom_sell" class="md-nav__link">
|
|
custom_sell
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#custom_entry_timeout" class="md-nav__link">
|
|
custom_entry_timeout
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#custom-stake-amount" class="md-nav__link">
|
|
Custom-stake-amount
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#confirm_trade_entry" class="md-nav__link">
|
|
confirm_trade_entry
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#confirm_trade_exit" class="md-nav__link">
|
|
confirm_trade_exit
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#custom_entry_price" class="md-nav__link">
|
|
custom_entry_price
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#adjust-trade-position-changes" class="md-nav__link">
|
|
Adjust trade position changes
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#helper-methods" class="md-nav__link">
|
|
Helper methods
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#strategyconfiguration-settings" class="md-nav__link">
|
|
Strategy/Configuration settings
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Strategy/Configuration settings">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#order_time_in_force" class="md-nav__link">
|
|
order_time_in_force
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#order_types" class="md-nav__link">
|
|
order_types
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#strategy-level-settings" class="md-nav__link">
|
|
Strategy level settings
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#unfilledtimeout" class="md-nav__link">
|
|
unfilledtimeout
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#order-pricing" class="md-nav__link">
|
|
order pricing
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../updating/" class="md-nav__link">
|
|
Updating Freqtrade
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../deprecated/" class="md-nav__link">
|
|
Deprecated Features
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../developer/" class="md-nav__link">
|
|
Contributors Guide
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- Table of contents -->
|
|
|
|
|
|
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
|
|
<div class="md-sidebar__scrollwrap">
|
|
<div class="md-sidebar__inner">
|
|
|
|
|
|
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<label class="md-nav__title" for="__toc">
|
|
<span class="md-nav__icon md-icon"></span>
|
|
Table of contents
|
|
</label>
|
|
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#quick-summary-migration-checklist" class="md-nav__link">
|
|
Quick summary / migration checklist
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#extensive-explanation" class="md-nav__link">
|
|
Extensive explanation
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Extensive explanation">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#populate_buy_trend" class="md-nav__link">
|
|
populate_buy_trend
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#populate_sell_trend" class="md-nav__link">
|
|
populate_sell_trend
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#custom_sell" class="md-nav__link">
|
|
custom_sell
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#custom_entry_timeout" class="md-nav__link">
|
|
custom_entry_timeout
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#custom-stake-amount" class="md-nav__link">
|
|
Custom-stake-amount
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#confirm_trade_entry" class="md-nav__link">
|
|
confirm_trade_entry
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#confirm_trade_exit" class="md-nav__link">
|
|
confirm_trade_exit
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#custom_entry_price" class="md-nav__link">
|
|
custom_entry_price
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#adjust-trade-position-changes" class="md-nav__link">
|
|
Adjust trade position changes
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#helper-methods" class="md-nav__link">
|
|
Helper methods
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#strategyconfiguration-settings" class="md-nav__link">
|
|
Strategy/Configuration settings
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Strategy/Configuration settings">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#order_time_in_force" class="md-nav__link">
|
|
order_time_in_force
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#order_types" class="md-nav__link">
|
|
order_types
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#strategy-level-settings" class="md-nav__link">
|
|
Strategy level settings
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#unfilledtimeout" class="md-nav__link">
|
|
unfilledtimeout
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#order-pricing" class="md-nav__link">
|
|
order pricing
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="md-content" data-md-component="content">
|
|
<article class="md-content__inner md-typeset">
|
|
|
|
|
|
<a href="https://github.com/freqtrade/freqtrade/edit/master/docs/strategy_migration.md" title="Edit this page" class="md-content__button md-icon">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25Z"/></svg>
|
|
</a>
|
|
|
|
|
|
|
|
<h1 id="strategy-migration-between-v2-and-v3">Strategy Migration between V2 and V3<a class="headerlink" href="#strategy-migration-between-v2-and-v3" title="Permanent link">¶</a></h1>
|
|
<p>To support new markets and trade-types (namely short trades / trades with leverage), some things had to change in the interface.
|
|
If you intend on using markets other than spot markets, please migrate your strategy to the new format.</p>
|
|
<p>We have put a great effort into keeping compatibility with existing strategies, so if you just want to continue using freqtrade in <strong>spot markets</strong>, there should be no changes necessary for now.</p>
|
|
<p>You can use the quick summary as checklist. Please refer to the detailed sections below for full migration details.</p>
|
|
<h2 id="quick-summary-migration-checklist">Quick summary / migration checklist<a class="headerlink" href="#quick-summary-migration-checklist" title="Permanent link">¶</a></h2>
|
|
<p>Note : <code>forcesell</code>, <code>forcebuy</code>, <code>emergencysell</code> are changed to <code>force_exit</code>, <code>force_enter</code>, <code>emergency_exit</code> respectively.</p>
|
|
<ul>
|
|
<li>Strategy methods:<ul>
|
|
<li><a href="#populate_buy_trend"><code>populate_buy_trend()</code> -> <code>populate_entry_trend()</code></a></li>
|
|
<li><a href="#populate_sell_trend"><code>populate_sell_trend()</code> -> <code>populate_exit_trend()</code></a></li>
|
|
<li><a href="#custom_sell"><code>custom_sell()</code> -> <code>custom_exit()</code></a></li>
|
|
<li><a href="#custom_entry_timeout"><code>check_buy_timeout()</code> -> <code>check_entry_timeout()</code></a></li>
|
|
<li><a href="#custom_entry_timeout"><code>check_sell_timeout()</code> -> <code>check_exit_timeout()</code></a></li>
|
|
<li>New <code>side</code> argument to callbacks without trade object<ul>
|
|
<li><a href="#custom-stake-amount"><code>custom_stake_amount</code></a></li>
|
|
<li><a href="#confirm_trade_entry"><code>confirm_trade_entry</code></a></li>
|
|
<li><a href="#custom_entry_price"><code>custom_entry_price</code></a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#confirm_trade_exit">Changed argument name in <code>confirm_trade_exit</code></a></li>
|
|
</ul>
|
|
</li>
|
|
<li>Dataframe columns:<ul>
|
|
<li><a href="#populate_buy_trend"><code>buy</code> -> <code>enter_long</code></a></li>
|
|
<li><a href="#populate_sell_trend"><code>sell</code> -> <code>exit_long</code></a></li>
|
|
<li><a href="#populate_buy_trend"><code>buy_tag</code> -> <code>enter_tag</code> (used for both long and short trades)</a></li>
|
|
<li><a href="#populate_sell_trend">New column <code>enter_short</code> and corresponding new column <code>exit_short</code></a></li>
|
|
</ul>
|
|
</li>
|
|
<li>trade-object now has the following new properties:<ul>
|
|
<li><code>is_short</code></li>
|
|
<li><code>entry_side</code></li>
|
|
<li><code>exit_side</code></li>
|
|
<li><code>trade_direction</code></li>
|
|
<li>renamed: <code>sell_reason</code> -> <code>exit_reason</code></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#adjust-trade-position-changes">Renamed <code>trade.nr_of_successful_buys</code> to <code>trade.nr_of_successful_entries</code> (mostly relevant for <code>adjust_trade_position()</code>)</a></li>
|
|
<li>Introduced new <a href="../strategy-callbacks/#leverage-callback"><code>leverage</code> callback</a>.</li>
|
|
<li>Informative pairs can now pass a 3<sup>rd</sup> element in the Tuple, defining the candle type.</li>
|
|
<li><code>@informative</code> decorator now takes an optional <code>candle_type</code> argument.</li>
|
|
<li><a href="#helper-methods">helper methods</a> <code>stoploss_from_open</code> and <code>stoploss_from_absolute</code> now take <code>is_short</code> as additional argument.</li>
|
|
<li><code>INTERFACE_VERSION</code> should be set to 3.</li>
|
|
<li><a href="#strategyconfiguration-settings">Strategy/Configuration settings</a>.<ul>
|
|
<li><code>order_time_in_force</code> buy -> entry, sell -> exit.</li>
|
|
<li><code>order_types</code> buy -> entry, sell -> exit.</li>
|
|
<li><code>unfilledtimeout</code> buy -> entry, sell -> exit.</li>
|
|
</ul>
|
|
</li>
|
|
<li>Terminology changes<ul>
|
|
<li>Sell reasons changed to reflect the new naming of "exit" instead of sells. Be careful in your strategy if you're using <code>exit_reason</code> checks and eventually update your strategy.<ul>
|
|
<li><code>sell_signal</code> -> <code>exit_signal</code></li>
|
|
<li><code>custom_sell</code> -> <code>custom_exit</code></li>
|
|
<li><code>force_sell</code> -> <code>force_exit</code></li>
|
|
<li><code>emergency_sell</code> -> <code>emergency_exit</code></li>
|
|
</ul>
|
|
</li>
|
|
<li>Webhook terminology changed from "sell" to "exit", and from "buy" to entry<ul>
|
|
<li><code>webhookbuy</code> -> <code>webhookentry</code></li>
|
|
<li><code>webhookbuyfill</code> -> <code>webhookentryfill</code></li>
|
|
<li><code>webhookbuycancel</code> -> <code>webhookentrycancel</code></li>
|
|
<li><code>webhooksell</code> -> <code>webhookexit</code></li>
|
|
<li><code>webhooksellfill</code> -> <code>webhookexitfill</code></li>
|
|
<li><code>webhooksellcancel</code> -> <code>webhookexitcancel</code></li>
|
|
</ul>
|
|
</li>
|
|
<li>Telegram notification settings<ul>
|
|
<li><code>buy</code> -> <code>entry</code></li>
|
|
<li><code>buy_fill</code> -> <code>entry_fill</code></li>
|
|
<li><code>buy_cancel</code> -> <code>entry_cancel</code></li>
|
|
<li><code>sell</code> -> <code>exit</code></li>
|
|
<li><code>sell_fill</code> -> <code>exit_fill</code></li>
|
|
<li><code>sell_cancel</code> -> <code>exit_cancel</code></li>
|
|
</ul>
|
|
</li>
|
|
<li>Strategy/config settings:<ul>
|
|
<li><code>use_sell_signal</code> -> <code>use_exit_signal</code></li>
|
|
<li><code>sell_profit_only</code> -> <code>exit_profit_only</code></li>
|
|
<li><code>sell_profit_offset</code> -> <code>exit_profit_offset</code></li>
|
|
<li><code>ignore_roi_if_buy_signal</code> -> <code>ignore_roi_if_entry_signal</code></li>
|
|
<li><code>forcebuy_enable</code> -> <code>force_entry_enable</code></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h2 id="extensive-explanation">Extensive explanation<a class="headerlink" href="#extensive-explanation" title="Permanent link">¶</a></h2>
|
|
<h3 id="populate_buy_trend"><code>populate_buy_trend</code><a class="headerlink" href="#populate_buy_trend" title="Permanent link">¶</a></h3>
|
|
<p>In <code>populate_buy_trend()</code> - you will want to change the columns you assign from <code>'buy</code>' to <code>'enter_long'</code>, as well as the method name from <code>populate_buy_trend</code> to <code>populate_entry_trend</code>.</p>
|
|
<div class="highlight"><pre><span></span><code><span class="hll"><span class="k">def</span> <span class="nf">populate_buy_trend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dataframe</span><span class="p">:</span> <span class="n">DataFrame</span><span class="p">,</span> <span class="n">metadata</span><span class="p">:</span> <span class="nb">dict</span><span class="p">)</span> <span class="o">-></span> <span class="n">DataFrame</span><span class="p">:</span>
|
|
</span> <span class="n">dataframe</span><span class="o">.</span><span class="n">loc</span><span class="p">[</span>
|
|
<span class="p">(</span>
|
|
<span class="p">(</span><span class="n">qtpylib</span><span class="o">.</span><span class="n">crossed_above</span><span class="p">(</span><span class="n">dataframe</span><span class="p">[</span><span class="s1">'rsi'</span><span class="p">],</span> <span class="mi">30</span><span class="p">))</span> <span class="o">&</span> <span class="c1"># Signal: RSI crosses above 30</span>
|
|
<span class="p">(</span><span class="n">dataframe</span><span class="p">[</span><span class="s1">'tema'</span><span class="p">]</span> <span class="o"><=</span> <span class="n">dataframe</span><span class="p">[</span><span class="s1">'bb_middleband'</span><span class="p">])</span> <span class="o">&</span> <span class="c1"># Guard</span>
|
|
<span class="p">(</span><span class="n">dataframe</span><span class="p">[</span><span class="s1">'tema'</span><span class="p">]</span> <span class="o">></span> <span class="n">dataframe</span><span class="p">[</span><span class="s1">'tema'</span><span class="p">]</span><span class="o">.</span><span class="n">shift</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span> <span class="o">&</span> <span class="c1"># Guard</span>
|
|
<span class="p">(</span><span class="n">dataframe</span><span class="p">[</span><span class="s1">'volume'</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">)</span> <span class="c1"># Make sure Volume is not 0</span>
|
|
<span class="p">),</span>
|
|
<span class="hll"> <span class="p">[</span><span class="s1">'buy'</span><span class="p">,</span> <span class="s1">'buy_tag'</span><span class="p">]]</span> <span class="o">=</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="s1">'rsi_cross'</span><span class="p">)</span>
|
|
</span>
|
|
<span class="k">return</span> <span class="n">dataframe</span>
|
|
</code></pre></div>
|
|
<p>After:</p>
|
|
<div class="highlight"><pre><span></span><code><span class="hll"><span class="k">def</span> <span class="nf">populate_entry_trend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dataframe</span><span class="p">:</span> <span class="n">DataFrame</span><span class="p">,</span> <span class="n">metadata</span><span class="p">:</span> <span class="nb">dict</span><span class="p">)</span> <span class="o">-></span> <span class="n">DataFrame</span><span class="p">:</span>
|
|
</span> <span class="n">dataframe</span><span class="o">.</span><span class="n">loc</span><span class="p">[</span>
|
|
<span class="p">(</span>
|
|
<span class="p">(</span><span class="n">qtpylib</span><span class="o">.</span><span class="n">crossed_above</span><span class="p">(</span><span class="n">dataframe</span><span class="p">[</span><span class="s1">'rsi'</span><span class="p">],</span> <span class="mi">30</span><span class="p">))</span> <span class="o">&</span> <span class="c1"># Signal: RSI crosses above 30</span>
|
|
<span class="p">(</span><span class="n">dataframe</span><span class="p">[</span><span class="s1">'tema'</span><span class="p">]</span> <span class="o"><=</span> <span class="n">dataframe</span><span class="p">[</span><span class="s1">'bb_middleband'</span><span class="p">])</span> <span class="o">&</span> <span class="c1"># Guard</span>
|
|
<span class="p">(</span><span class="n">dataframe</span><span class="p">[</span><span class="s1">'tema'</span><span class="p">]</span> <span class="o">></span> <span class="n">dataframe</span><span class="p">[</span><span class="s1">'tema'</span><span class="p">]</span><span class="o">.</span><span class="n">shift</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span> <span class="o">&</span> <span class="c1"># Guard</span>
|
|
<span class="p">(</span><span class="n">dataframe</span><span class="p">[</span><span class="s1">'volume'</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">)</span> <span class="c1"># Make sure Volume is not 0</span>
|
|
<span class="p">),</span>
|
|
<span class="hll"> <span class="p">[</span><span class="s1">'enter_long'</span><span class="p">,</span> <span class="s1">'enter_tag'</span><span class="p">]]</span> <span class="o">=</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="s1">'rsi_cross'</span><span class="p">)</span>
|
|
</span>
|
|
<span class="k">return</span> <span class="n">dataframe</span>
|
|
</code></pre></div>
|
|
<p>Please refer to the <a href="../strategy-customization/#entry-signal-rules">Strategy documentation</a> on how to enter and exit short trades.</p>
|
|
<h3 id="populate_sell_trend"><code>populate_sell_trend</code><a class="headerlink" href="#populate_sell_trend" title="Permanent link">¶</a></h3>
|
|
<p>Similar to <code>populate_buy_trend</code>, <code>populate_sell_trend()</code> will be renamed to <code>populate_exit_trend()</code>.
|
|
We'll also change the column from <code>'sell'</code> to <code>'exit_long'</code>.</p>
|
|
<div class="highlight"><pre><span></span><code><span class="hll"><span class="k">def</span> <span class="nf">populate_sell_trend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dataframe</span><span class="p">:</span> <span class="n">DataFrame</span><span class="p">,</span> <span class="n">metadata</span><span class="p">:</span> <span class="nb">dict</span><span class="p">)</span> <span class="o">-></span> <span class="n">DataFrame</span><span class="p">:</span>
|
|
</span> <span class="n">dataframe</span><span class="o">.</span><span class="n">loc</span><span class="p">[</span>
|
|
<span class="p">(</span>
|
|
<span class="p">(</span><span class="n">qtpylib</span><span class="o">.</span><span class="n">crossed_above</span><span class="p">(</span><span class="n">dataframe</span><span class="p">[</span><span class="s1">'rsi'</span><span class="p">],</span> <span class="mi">70</span><span class="p">))</span> <span class="o">&</span> <span class="c1"># Signal: RSI crosses above 70</span>
|
|
<span class="p">(</span><span class="n">dataframe</span><span class="p">[</span><span class="s1">'tema'</span><span class="p">]</span> <span class="o">></span> <span class="n">dataframe</span><span class="p">[</span><span class="s1">'bb_middleband'</span><span class="p">])</span> <span class="o">&</span> <span class="c1"># Guard</span>
|
|
<span class="p">(</span><span class="n">dataframe</span><span class="p">[</span><span class="s1">'tema'</span><span class="p">]</span> <span class="o"><</span> <span class="n">dataframe</span><span class="p">[</span><span class="s1">'tema'</span><span class="p">]</span><span class="o">.</span><span class="n">shift</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span> <span class="o">&</span> <span class="c1"># Guard</span>
|
|
<span class="p">(</span><span class="n">dataframe</span><span class="p">[</span><span class="s1">'volume'</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">)</span> <span class="c1"># Make sure Volume is not 0</span>
|
|
<span class="p">),</span>
|
|
<span class="hll"> <span class="p">[</span><span class="s1">'sell'</span><span class="p">,</span> <span class="s1">'exit_tag'</span><span class="p">]]</span> <span class="o">=</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="s1">'some_exit_tag'</span><span class="p">)</span>
|
|
</span> <span class="k">return</span> <span class="n">dataframe</span>
|
|
</code></pre></div>
|
|
<p>After</p>
|
|
<div class="highlight"><pre><span></span><code><span class="hll"><span class="k">def</span> <span class="nf">populate_exit_trend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dataframe</span><span class="p">:</span> <span class="n">DataFrame</span><span class="p">,</span> <span class="n">metadata</span><span class="p">:</span> <span class="nb">dict</span><span class="p">)</span> <span class="o">-></span> <span class="n">DataFrame</span><span class="p">:</span>
|
|
</span> <span class="n">dataframe</span><span class="o">.</span><span class="n">loc</span><span class="p">[</span>
|
|
<span class="p">(</span>
|
|
<span class="p">(</span><span class="n">qtpylib</span><span class="o">.</span><span class="n">crossed_above</span><span class="p">(</span><span class="n">dataframe</span><span class="p">[</span><span class="s1">'rsi'</span><span class="p">],</span> <span class="mi">70</span><span class="p">))</span> <span class="o">&</span> <span class="c1"># Signal: RSI crosses above 70</span>
|
|
<span class="p">(</span><span class="n">dataframe</span><span class="p">[</span><span class="s1">'tema'</span><span class="p">]</span> <span class="o">></span> <span class="n">dataframe</span><span class="p">[</span><span class="s1">'bb_middleband'</span><span class="p">])</span> <span class="o">&</span> <span class="c1"># Guard</span>
|
|
<span class="p">(</span><span class="n">dataframe</span><span class="p">[</span><span class="s1">'tema'</span><span class="p">]</span> <span class="o"><</span> <span class="n">dataframe</span><span class="p">[</span><span class="s1">'tema'</span><span class="p">]</span><span class="o">.</span><span class="n">shift</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span> <span class="o">&</span> <span class="c1"># Guard</span>
|
|
<span class="p">(</span><span class="n">dataframe</span><span class="p">[</span><span class="s1">'volume'</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">)</span> <span class="c1"># Make sure Volume is not 0</span>
|
|
<span class="p">),</span>
|
|
<span class="hll"> <span class="p">[</span><span class="s1">'exit_long'</span><span class="p">,</span> <span class="s1">'exit_tag'</span><span class="p">]]</span> <span class="o">=</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="s1">'some_exit_tag'</span><span class="p">)</span>
|
|
</span> <span class="k">return</span> <span class="n">dataframe</span>
|
|
</code></pre></div>
|
|
<p>Please refer to the <a href="../strategy-customization/#exit-signal-rules">Strategy documentation</a> on how to enter and exit short trades.</p>
|
|
<h3 id="custom_sell"><code>custom_sell</code><a class="headerlink" href="#custom_sell" title="Permanent link">¶</a></h3>
|
|
<p><code>custom_sell</code> has been renamed to <code>custom_exit</code>.
|
|
It's now also being called for every iteration, independent of current profit and <code>exit_profit_only</code> settings.</p>
|
|
<div class="highlight"><pre><span></span><code><span class="k">class</span> <span class="nc">AwesomeStrategy</span><span class="p">(</span><span class="n">IStrategy</span><span class="p">):</span>
|
|
<span class="hll"> <span class="k">def</span> <span class="nf">custom_sell</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pair</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">trade</span><span class="p">:</span> <span class="s1">'Trade'</span><span class="p">,</span> <span class="n">current_time</span><span class="p">:</span> <span class="s1">'datetime'</span><span class="p">,</span> <span class="n">current_rate</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
</span> <span class="n">current_profit</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
|
<span class="n">dataframe</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">dp</span><span class="o">.</span><span class="n">get_analyzed_dataframe</span><span class="p">(</span><span class="n">pair</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">timeframe</span><span class="p">)</span>
|
|
<span class="n">last_candle</span> <span class="o">=</span> <span class="n">dataframe</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">squeeze</span><span class="p">()</span>
|
|
<span class="c1"># ...</span>
|
|
</code></pre></div>
|
|
<div class="highlight"><pre><span></span><code><span class="k">class</span> <span class="nc">AwesomeStrategy</span><span class="p">(</span><span class="n">IStrategy</span><span class="p">):</span>
|
|
<span class="hll"> <span class="k">def</span> <span class="nf">custom_exit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pair</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">trade</span><span class="p">:</span> <span class="s1">'Trade'</span><span class="p">,</span> <span class="n">current_time</span><span class="p">:</span> <span class="s1">'datetime'</span><span class="p">,</span> <span class="n">current_rate</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
</span> <span class="n">current_profit</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
|
<span class="n">dataframe</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">dp</span><span class="o">.</span><span class="n">get_analyzed_dataframe</span><span class="p">(</span><span class="n">pair</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">timeframe</span><span class="p">)</span>
|
|
<span class="n">last_candle</span> <span class="o">=</span> <span class="n">dataframe</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">squeeze</span><span class="p">()</span>
|
|
<span class="c1"># ...</span>
|
|
</code></pre></div>
|
|
<h3 id="custom_entry_timeout"><code>custom_entry_timeout</code><a class="headerlink" href="#custom_entry_timeout" title="Permanent link">¶</a></h3>
|
|
<p><code>check_buy_timeout()</code> has been renamed to <code>check_entry_timeout()</code>, and <code>check_sell_timeout()</code> has been renamed to <code>check_exit_timeout()</code>.</p>
|
|
<div class="highlight"><pre><span></span><code><span class="k">class</span> <span class="nc">AwesomeStrategy</span><span class="p">(</span><span class="n">IStrategy</span><span class="p">):</span>
|
|
<span class="hll"> <span class="k">def</span> <span class="nf">check_buy_timeout</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pair</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">trade</span><span class="p">:</span> <span class="s1">'Trade'</span><span class="p">,</span> <span class="n">order</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span>
|
|
</span> <span class="n">current_time</span><span class="p">:</span> <span class="n">datetime</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span>
|
|
<span class="k">return</span> <span class="kc">False</span>
|
|
|
|
<span class="hll"> <span class="k">def</span> <span class="nf">check_sell_timeout</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pair</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">trade</span><span class="p">:</span> <span class="s1">'Trade'</span><span class="p">,</span> <span class="n">order</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span>
|
|
</span> <span class="n">current_time</span><span class="p">:</span> <span class="n">datetime</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span>
|
|
<span class="k">return</span> <span class="kc">False</span>
|
|
</code></pre></div>
|
|
<div class="highlight"><pre><span></span><code><span class="k">class</span> <span class="nc">AwesomeStrategy</span><span class="p">(</span><span class="n">IStrategy</span><span class="p">):</span>
|
|
<span class="hll"> <span class="k">def</span> <span class="nf">check_entry_timeout</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pair</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">trade</span><span class="p">:</span> <span class="s1">'Trade'</span><span class="p">,</span> <span class="n">order</span><span class="p">:</span> <span class="s1">'Order'</span><span class="p">,</span>
|
|
</span> <span class="n">current_time</span><span class="p">:</span> <span class="n">datetime</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span>
|
|
<span class="k">return</span> <span class="kc">False</span>
|
|
|
|
<span class="hll"> <span class="k">def</span> <span class="nf">check_exit_timeout</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pair</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">trade</span><span class="p">:</span> <span class="s1">'Trade'</span><span class="p">,</span> <span class="n">order</span><span class="p">:</span> <span class="s1">'Order'</span><span class="p">,</span>
|
|
</span> <span class="n">current_time</span><span class="p">:</span> <span class="n">datetime</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span>
|
|
<span class="k">return</span> <span class="kc">False</span>
|
|
</code></pre></div>
|
|
<h3 id="custom-stake-amount">Custom-stake-amount<a class="headerlink" href="#custom-stake-amount" title="Permanent link">¶</a></h3>
|
|
<p>New string argument <code>side</code> - which can be either <code>"long"</code> or <code>"short"</code>.</p>
|
|
<div class="highlight"><pre><span></span><code><span class="k">class</span> <span class="nc">AwesomeStrategy</span><span class="p">(</span><span class="n">IStrategy</span><span class="p">):</span>
|
|
<span class="k">def</span> <span class="nf">custom_stake_amount</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pair</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">current_time</span><span class="p">:</span> <span class="n">datetime</span><span class="p">,</span> <span class="n">current_rate</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<span class="n">proposed_stake</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">min_stake</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">float</span><span class="p">],</span> <span class="n">max_stake</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<span class="hll"> <span class="n">entry_tag</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="nb">float</span><span class="p">:</span>
|
|
</span> <span class="c1"># ... </span>
|
|
<span class="k">return</span> <span class="n">proposed_stake</span>
|
|
</code></pre></div>
|
|
<div class="highlight"><pre><span></span><code><span class="k">class</span> <span class="nc">AwesomeStrategy</span><span class="p">(</span><span class="n">IStrategy</span><span class="p">):</span>
|
|
<span class="k">def</span> <span class="nf">custom_stake_amount</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pair</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">current_time</span><span class="p">:</span> <span class="n">datetime</span><span class="p">,</span> <span class="n">current_rate</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<span class="n">proposed_stake</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">min_stake</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">float</span><span class="p">],</span> <span class="n">max_stake</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<span class="hll"> <span class="n">entry_tag</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span> <span class="n">side</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="nb">float</span><span class="p">:</span>
|
|
</span> <span class="c1"># ... </span>
|
|
<span class="k">return</span> <span class="n">proposed_stake</span>
|
|
</code></pre></div>
|
|
<h3 id="confirm_trade_entry"><code>confirm_trade_entry</code><a class="headerlink" href="#confirm_trade_entry" title="Permanent link">¶</a></h3>
|
|
<p>New string argument <code>side</code> - which can be either <code>"long"</code> or <code>"short"</code>.</p>
|
|
<div class="highlight"><pre><span></span><code><span class="k">class</span> <span class="nc">AwesomeStrategy</span><span class="p">(</span><span class="n">IStrategy</span><span class="p">):</span>
|
|
<span class="k">def</span> <span class="nf">confirm_trade_entry</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pair</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">order_type</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">amount</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">rate</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<span class="n">time_in_force</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">current_time</span><span class="p">:</span> <span class="n">datetime</span><span class="p">,</span> <span class="n">entry_tag</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span>
|
|
<span class="hll"> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span>
|
|
</span> <span class="k">return</span> <span class="kc">True</span>
|
|
</code></pre></div>
|
|
<p>After: </p>
|
|
<div class="highlight"><pre><span></span><code><span class="k">class</span> <span class="nc">AwesomeStrategy</span><span class="p">(</span><span class="n">IStrategy</span><span class="p">):</span>
|
|
<span class="k">def</span> <span class="nf">confirm_trade_entry</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pair</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">order_type</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">amount</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">rate</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<span class="n">time_in_force</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">current_time</span><span class="p">:</span> <span class="n">datetime</span><span class="p">,</span> <span class="n">entry_tag</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span>
|
|
<span class="hll"> <span class="n">side</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span>
|
|
</span> <span class="k">return</span> <span class="kc">True</span>
|
|
</code></pre></div>
|
|
<h3 id="confirm_trade_exit"><code>confirm_trade_exit</code><a class="headerlink" href="#confirm_trade_exit" title="Permanent link">¶</a></h3>
|
|
<p>Changed argument <code>sell_reason</code> to <code>exit_reason</code>.
|
|
For compatibility, <code>sell_reason</code> will still be provided for a limited time.</p>
|
|
<div class="highlight"><pre><span></span><code><span class="k">class</span> <span class="nc">AwesomeStrategy</span><span class="p">(</span><span class="n">IStrategy</span><span class="p">):</span>
|
|
<span class="k">def</span> <span class="nf">confirm_trade_exit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pair</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">trade</span><span class="p">:</span> <span class="n">Trade</span><span class="p">,</span> <span class="n">order_type</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">amount</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<span class="hll"> <span class="n">rate</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">time_in_force</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">sell_reason</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
|
|
</span> <span class="n">current_time</span><span class="p">:</span> <span class="n">datetime</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span>
|
|
<span class="k">return</span> <span class="kc">True</span>
|
|
</code></pre></div>
|
|
<p>After:</p>
|
|
<div class="highlight"><pre><span></span><code><span class="k">class</span> <span class="nc">AwesomeStrategy</span><span class="p">(</span><span class="n">IStrategy</span><span class="p">):</span>
|
|
<span class="k">def</span> <span class="nf">confirm_trade_exit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pair</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">trade</span><span class="p">:</span> <span class="n">Trade</span><span class="p">,</span> <span class="n">order_type</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">amount</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<span class="hll"> <span class="n">rate</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">time_in_force</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">exit_reason</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
|
|
</span> <span class="n">current_time</span><span class="p">:</span> <span class="n">datetime</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span>
|
|
<span class="k">return</span> <span class="kc">True</span>
|
|
</code></pre></div>
|
|
<h3 id="custom_entry_price"><code>custom_entry_price</code><a class="headerlink" href="#custom_entry_price" title="Permanent link">¶</a></h3>
|
|
<p>New string argument <code>side</code> - which can be either <code>"long"</code> or <code>"short"</code>.</p>
|
|
<div class="highlight"><pre><span></span><code><span class="k">class</span> <span class="nc">AwesomeStrategy</span><span class="p">(</span><span class="n">IStrategy</span><span class="p">):</span>
|
|
<span class="k">def</span> <span class="nf">custom_entry_price</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pair</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">current_time</span><span class="p">:</span> <span class="n">datetime</span><span class="p">,</span> <span class="n">proposed_rate</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<span class="hll"> <span class="n">entry_tag</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="nb">float</span><span class="p">:</span>
|
|
</span> <span class="k">return</span> <span class="n">proposed_rate</span>
|
|
</code></pre></div>
|
|
<p>After:</p>
|
|
<div class="highlight"><pre><span></span><code><span class="k">class</span> <span class="nc">AwesomeStrategy</span><span class="p">(</span><span class="n">IStrategy</span><span class="p">):</span>
|
|
<span class="k">def</span> <span class="nf">custom_entry_price</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pair</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">current_time</span><span class="p">:</span> <span class="n">datetime</span><span class="p">,</span> <span class="n">proposed_rate</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<span class="hll"> <span class="n">entry_tag</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span> <span class="n">side</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="nb">float</span><span class="p">:</span>
|
|
</span> <span class="k">return</span> <span class="n">proposed_rate</span>
|
|
</code></pre></div>
|
|
<h3 id="adjust-trade-position-changes">Adjust trade position changes<a class="headerlink" href="#adjust-trade-position-changes" title="Permanent link">¶</a></h3>
|
|
<p>While adjust-trade-position itself did not change, you should no longer use <code>trade.nr_of_successful_buys</code> - and instead use <code>trade.nr_of_successful_entries</code>, which will also include short entries.</p>
|
|
<h3 id="helper-methods">Helper methods<a class="headerlink" href="#helper-methods" title="Permanent link">¶</a></h3>
|
|
<p>Added argument "is_short" to <code>stoploss_from_open</code> and <code>stoploss_from_absolute</code>.
|
|
This should be given the value of <code>trade.is_short</code>.</p>
|
|
<div class="highlight"><pre><span></span><code> <span class="k">def</span> <span class="nf">custom_stoploss</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pair</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">trade</span><span class="p">:</span> <span class="s1">'Trade'</span><span class="p">,</span> <span class="n">current_time</span><span class="p">:</span> <span class="n">datetime</span><span class="p">,</span>
|
|
<span class="n">current_rate</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">current_profit</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="nb">float</span><span class="p">:</span>
|
|
<span class="c1"># once the profit has risen above 10%, keep the stoploss at 7% above the open price</span>
|
|
<span class="k">if</span> <span class="n">current_profit</span> <span class="o">></span> <span class="mf">0.10</span><span class="p">:</span>
|
|
<span class="hll"> <span class="k">return</span> <span class="n">stoploss_from_open</span><span class="p">(</span><span class="mf">0.07</span><span class="p">,</span> <span class="n">current_profit</span><span class="p">)</span>
|
|
</span>
|
|
<span class="hll"> <span class="k">return</span> <span class="n">stoploss_from_absolute</span><span class="p">(</span><span class="n">current_rate</span> <span class="o">-</span> <span class="p">(</span><span class="n">candle</span><span class="p">[</span><span class="s1">'atr'</span><span class="p">]</span> <span class="o">*</span> <span class="mi">2</span><span class="p">),</span> <span class="n">current_rate</span><span class="p">)</span>
|
|
</span>
|
|
<span class="k">return</span> <span class="mi">1</span>
|
|
</code></pre></div>
|
|
<p>After:</p>
|
|
<div class="highlight"><pre><span></span><code> <span class="k">def</span> <span class="nf">custom_stoploss</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pair</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">trade</span><span class="p">:</span> <span class="s1">'Trade'</span><span class="p">,</span> <span class="n">current_time</span><span class="p">:</span> <span class="n">datetime</span><span class="p">,</span>
|
|
<span class="n">current_rate</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">current_profit</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="nb">float</span><span class="p">:</span>
|
|
<span class="c1"># once the profit has risen above 10%, keep the stoploss at 7% above the open price</span>
|
|
<span class="k">if</span> <span class="n">current_profit</span> <span class="o">></span> <span class="mf">0.10</span><span class="p">:</span>
|
|
<span class="hll"> <span class="k">return</span> <span class="n">stoploss_from_open</span><span class="p">(</span><span class="mf">0.07</span><span class="p">,</span> <span class="n">current_profit</span><span class="p">,</span> <span class="n">is_short</span><span class="o">=</span><span class="n">trade</span><span class="o">.</span><span class="n">is_short</span><span class="p">)</span>
|
|
</span>
|
|
<span class="hll"> <span class="k">return</span> <span class="n">stoploss_from_absolute</span><span class="p">(</span><span class="n">current_rate</span> <span class="o">-</span> <span class="p">(</span><span class="n">candle</span><span class="p">[</span><span class="s1">'atr'</span><span class="p">]</span> <span class="o">*</span> <span class="mi">2</span><span class="p">),</span> <span class="n">current_rate</span><span class="p">,</span> <span class="n">is_short</span><span class="o">=</span><span class="n">trade</span><span class="o">.</span><span class="n">is_short</span><span class="p">)</span>
|
|
</span></code></pre></div>
|
|
<h3 id="strategyconfiguration-settings">Strategy/Configuration settings<a class="headerlink" href="#strategyconfiguration-settings" title="Permanent link">¶</a></h3>
|
|
<h4 id="order_time_in_force"><code>order_time_in_force</code><a class="headerlink" href="#order_time_in_force" title="Permanent link">¶</a></h4>
|
|
<p><code>order_time_in_force</code> attributes changed from <code>"buy"</code> to <code>"entry"</code> and <code>"sell"</code> to <code>"exit"</code>.</p>
|
|
<div class="highlight"><pre><span></span><code> <span class="n">order_time_in_force</span><span class="p">:</span> <span class="n">Dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s2">"buy"</span><span class="p">:</span> <span class="s2">"gtc"</span><span class="p">,</span>
|
|
<span class="s2">"sell"</span><span class="p">:</span> <span class="s2">"gtc"</span><span class="p">,</span>
|
|
<span class="p">}</span>
|
|
</code></pre></div>
|
|
<p>After:</p>
|
|
<div class="highlight"><pre><span></span><code> <span class="n">order_time_in_force</span><span class="p">:</span> <span class="n">Dict</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="hll"> <span class="s2">"entry"</span><span class="p">:</span> <span class="s2">"gtc"</span><span class="p">,</span>
|
|
</span><span class="hll"> <span class="s2">"exit"</span><span class="p">:</span> <span class="s2">"gtc"</span><span class="p">,</span>
|
|
</span> <span class="p">}</span>
|
|
</code></pre></div>
|
|
<h4 id="order_types"><code>order_types</code><a class="headerlink" href="#order_types" title="Permanent link">¶</a></h4>
|
|
<p><code>order_types</code> have changed all wordings from <code>buy</code> to <code>entry</code> - and <code>sell</code> to <code>exit</code>.
|
|
And two words are joined with <code>_</code>. </p>
|
|
<div class="highlight"><pre><span></span><code> <span class="n">order_types</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="hll"> <span class="s2">"buy"</span><span class="p">:</span> <span class="s2">"limit"</span><span class="p">,</span>
|
|
</span><span class="hll"> <span class="s2">"sell"</span><span class="p">:</span> <span class="s2">"limit"</span><span class="p">,</span>
|
|
</span><span class="hll"> <span class="s2">"emergencysell"</span><span class="p">:</span> <span class="s2">"market"</span><span class="p">,</span>
|
|
</span><span class="hll"> <span class="s2">"forcesell"</span><span class="p">:</span> <span class="s2">"market"</span><span class="p">,</span>
|
|
</span><span class="hll"> <span class="s2">"forcebuy"</span><span class="p">:</span> <span class="s2">"market"</span><span class="p">,</span>
|
|
</span> <span class="s2">"stoploss"</span><span class="p">:</span> <span class="s2">"market"</span><span class="p">,</span>
|
|
<span class="s2">"stoploss_on_exchange"</span><span class="p">:</span> <span class="n">false</span><span class="p">,</span>
|
|
<span class="s2">"stoploss_on_exchange_interval"</span><span class="p">:</span> <span class="mi">60</span>
|
|
<span class="p">}</span>
|
|
</code></pre></div>
|
|
<p>After:</p>
|
|
<div class="highlight"><pre><span></span><code> <span class="n">order_types</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="hll"> <span class="s2">"entry"</span><span class="p">:</span> <span class="s2">"limit"</span><span class="p">,</span>
|
|
</span><span class="hll"> <span class="s2">"exit"</span><span class="p">:</span> <span class="s2">"limit"</span><span class="p">,</span>
|
|
</span><span class="hll"> <span class="s2">"emergency_exit"</span><span class="p">:</span> <span class="s2">"market"</span><span class="p">,</span>
|
|
</span><span class="hll"> <span class="s2">"force_exit"</span><span class="p">:</span> <span class="s2">"market"</span><span class="p">,</span>
|
|
</span><span class="hll"> <span class="s2">"force_entry"</span><span class="p">:</span> <span class="s2">"market"</span><span class="p">,</span>
|
|
</span> <span class="s2">"stoploss"</span><span class="p">:</span> <span class="s2">"market"</span><span class="p">,</span>
|
|
<span class="s2">"stoploss_on_exchange"</span><span class="p">:</span> <span class="n">false</span><span class="p">,</span>
|
|
<span class="s2">"stoploss_on_exchange_interval"</span><span class="p">:</span> <span class="mi">60</span>
|
|
<span class="p">}</span>
|
|
</code></pre></div>
|
|
<h4 id="strategy-level-settings">Strategy level settings<a class="headerlink" href="#strategy-level-settings" title="Permanent link">¶</a></h4>
|
|
<ul>
|
|
<li><code>use_sell_signal</code> -> <code>use_exit_signal</code></li>
|
|
<li><code>sell_profit_only</code> -> <code>exit_profit_only</code></li>
|
|
<li><code>sell_profit_offset</code> -> <code>exit_profit_offset</code></li>
|
|
<li><code>ignore_roi_if_buy_signal</code> -> <code>ignore_roi_if_entry_signal</code></li>
|
|
</ul>
|
|
<div class="highlight"><pre><span></span><code> <span class="c1"># These values can be overridden in the config.</span>
|
|
<span class="hll"> <span class="n">use_sell_signal</span> <span class="o">=</span> <span class="kc">True</span>
|
|
</span><span class="hll"> <span class="n">sell_profit_only</span> <span class="o">=</span> <span class="kc">True</span>
|
|
</span><span class="hll"> <span class="n">sell_profit_offset</span><span class="p">:</span> <span class="mf">0.01</span>
|
|
</span><span class="hll"> <span class="n">ignore_roi_if_buy_signal</span> <span class="o">=</span> <span class="kc">False</span>
|
|
</span></code></pre></div>
|
|
<p>After:</p>
|
|
<div class="highlight"><pre><span></span><code> <span class="c1"># These values can be overridden in the config.</span>
|
|
<span class="hll"> <span class="n">use_exit_signal</span> <span class="o">=</span> <span class="kc">True</span>
|
|
</span><span class="hll"> <span class="n">exit_profit_only</span> <span class="o">=</span> <span class="kc">True</span>
|
|
</span><span class="hll"> <span class="n">exit_profit_offset</span><span class="p">:</span> <span class="mf">0.01</span>
|
|
</span><span class="hll"> <span class="n">ignore_roi_if_entry_signal</span> <span class="o">=</span> <span class="kc">False</span>
|
|
</span></code></pre></div>
|
|
<h4 id="unfilledtimeout"><code>unfilledtimeout</code><a class="headerlink" href="#unfilledtimeout" title="Permanent link">¶</a></h4>
|
|
<p><code>unfilledtimeout</code> have changed all wordings from <code>buy</code> to <code>entry</code> - and <code>sell</code> to <code>exit</code>.</p>
|
|
<div class="highlight"><pre><span></span><code><span class="n">unfilledtimeout</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="hll"> <span class="s2">"buy"</span><span class="p">:</span> <span class="mi">10</span><span class="p">,</span>
|
|
</span><span class="hll"> <span class="s2">"sell"</span><span class="p">:</span> <span class="mi">10</span><span class="p">,</span>
|
|
</span> <span class="s2">"exit_timeout_count"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
|
<span class="s2">"unit"</span><span class="p">:</span> <span class="s2">"minutes"</span>
|
|
<span class="p">}</span>
|
|
</code></pre></div>
|
|
<p>After:</p>
|
|
<div class="highlight"><pre><span></span><code><span class="n">unfilledtimeout</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="hll"> <span class="s2">"entry"</span><span class="p">:</span> <span class="mi">10</span><span class="p">,</span>
|
|
</span><span class="hll"> <span class="s2">"exit"</span><span class="p">:</span> <span class="mi">10</span><span class="p">,</span>
|
|
</span> <span class="s2">"exit_timeout_count"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
|
<span class="s2">"unit"</span><span class="p">:</span> <span class="s2">"minutes"</span>
|
|
<span class="p">}</span>
|
|
</code></pre></div>
|
|
<h4 id="order-pricing"><code>order pricing</code><a class="headerlink" href="#order-pricing" title="Permanent link">¶</a></h4>
|
|
<p>Order pricing changed in 2 ways. <code>bid_strategy</code> was renamed to <code>entry_pricing</code> and <code>ask_strategy</code> was renamed to <code>exit_pricing</code>.
|
|
The attributes <code>ask_last_balance</code> -> <code>price_last_balance</code> and <code>bid_last_balance</code> -> <code>price_last_balance</code> were renamed as well.
|
|
Also, price-side can now be defined as <code>ask</code>, <code>bid</code>, <code>same</code> or <code>other</code>.
|
|
Please refer to the <a href="../configuration/#prices-used-for-orders">pricing documentation</a> for more information.</p>
|
|
<div class="highlight"><pre><span></span><code><span class="p">{</span>
|
|
<span class="hll"><span class="w"> </span><span class="nt">"bid_strategy"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
|
|
</span><span class="hll"><span class="w"> </span><span class="nt">"price_side"</span><span class="p">:</span><span class="w"> </span><span class="s2">"bid"</span><span class="p">,</span>
|
|
</span><span class="w"> </span><span class="nt">"use_order_book"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="nt">"order_book_top"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span>
|
|
<span class="hll"><span class="w"> </span><span class="nt">"ask_last_balance"</span><span class="p">:</span><span class="w"> </span><span class="mf">0.0</span><span class="p">,</span>
|
|
</span><span class="w"> </span><span class="nt">"check_depth_of_market"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
|
|
<span class="w"> </span><span class="nt">"enabled"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="nt">"bids_to_ask_delta"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span>
|
|
<span class="w"> </span><span class="p">}</span>
|
|
<span class="w"> </span><span class="p">},</span>
|
|
<span class="hll"><span class="w"> </span><span class="nt">"ask_strategy"</span><span class="p">:{</span>
|
|
</span><span class="hll"><span class="w"> </span><span class="nt">"price_side"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ask"</span><span class="p">,</span>
|
|
</span><span class="w"> </span><span class="nt">"use_order_book"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="nt">"order_book_top"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span>
|
|
<span class="hll"><span class="w"> </span><span class="nt">"bid_last_balance"</span><span class="p">:</span><span class="w"> </span><span class="mf">0.0</span>
|
|
</span><span class="w"> </span><span class="p">}</span>
|
|
<span class="p">}</span>
|
|
</code></pre></div>
|
|
<p>after:</p>
|
|
<div class="highlight"><pre><span></span><code><span class="p">{</span>
|
|
<span class="hll"><span class="w"> </span><span class="nt">"entry_pricing"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
|
|
</span><span class="hll"><span class="w"> </span><span class="nt">"price_side"</span><span class="p">:</span><span class="w"> </span><span class="s2">"same"</span><span class="p">,</span>
|
|
</span><span class="w"> </span><span class="nt">"use_order_book"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="nt">"order_book_top"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span>
|
|
<span class="hll"><span class="w"> </span><span class="nt">"price_last_balance"</span><span class="p">:</span><span class="w"> </span><span class="mf">0.0</span><span class="p">,</span>
|
|
</span><span class="w"> </span><span class="nt">"check_depth_of_market"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
|
|
<span class="w"> </span><span class="nt">"enabled"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="nt">"bids_to_ask_delta"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span>
|
|
<span class="w"> </span><span class="p">}</span>
|
|
<span class="w"> </span><span class="p">},</span>
|
|
<span class="hll"><span class="w"> </span><span class="nt">"exit_pricing"</span><span class="p">:{</span>
|
|
</span><span class="hll"><span class="w"> </span><span class="nt">"price_side"</span><span class="p">:</span><span class="w"> </span><span class="s2">"same"</span><span class="p">,</span>
|
|
</span><span class="w"> </span><span class="nt">"use_order_book"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="nt">"order_book_top"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span>
|
|
<span class="hll"><span class="w"> </span><span class="nt">"price_last_balance"</span><span class="p">:</span><span class="w"> </span><span class="mf">0.0</span>
|
|
</span><span class="w"> </span><span class="p">}</span>
|
|
<span class="p">}</span>
|
|
</code></pre></div>
|
|
|
|
|
|
</article>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</main>
|
|
|
|
|
|
<footer class="md-footer">
|
|
|
|
|
|
<nav class="md-footer__inner md-grid" aria-label="Footer" >
|
|
|
|
|
|
<a href="../sql_cheatsheet/" class="md-footer__link md-footer__link--prev" aria-label="Previous: SQL Cheat-sheet" rel="prev">
|
|
<div class="md-footer__button md-icon">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
|
|
</div>
|
|
<div class="md-footer__title">
|
|
<div class="md-ellipsis">
|
|
<span class="md-footer__direction">
|
|
Previous
|
|
</span>
|
|
SQL Cheat-sheet
|
|
</div>
|
|
</div>
|
|
</a>
|
|
|
|
|
|
|
|
<a href="../updating/" class="md-footer__link md-footer__link--next" aria-label="Next: Updating Freqtrade" rel="next">
|
|
<div class="md-footer__title">
|
|
<div class="md-ellipsis">
|
|
<span class="md-footer__direction">
|
|
Next
|
|
</span>
|
|
Updating Freqtrade
|
|
</div>
|
|
</div>
|
|
<div class="md-footer__button md-icon">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4Z"/></svg>
|
|
</div>
|
|
</a>
|
|
|
|
</nav>
|
|
|
|
<div class="md-footer-meta md-typeset">
|
|
<div class="md-footer-meta__inner md-grid">
|
|
<div class="md-copyright">
|
|
|
|
|
|
Made with
|
|
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
|
|
Material for MkDocs
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
|
|
|
|
<!-- Place this tag in your head or just before your close body tag. -->
|
|
<script async defer src="https://buttons.github.io/buttons.js"></script>
|
|
<script src="https://code.jquery.com/jquery-3.4.1.min.js"
|
|
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
|
|
|
|
<!-- Load binance SDK -->
|
|
<script async defer src="https://public.bnbstatic.com/static/js/broker-sdk/broker-sdk@1.0.0.min.js"></script>
|
|
|
|
<script>
|
|
window.onload = function () {
|
|
var sidebar = document.getElementById('widget-wrapper')
|
|
var newDiv = document.createElement("div");
|
|
newDiv.id = "widget";
|
|
try {
|
|
sidebar.prepend(newDiv);
|
|
|
|
window.binanceBrokerPortalSdk.initBrokerSDK('#widget', {
|
|
apiHost: 'https://www.binance.com',
|
|
brokerId: 'R4BD3S82',
|
|
slideTime: 4e4,
|
|
});
|
|
} catch(err) {
|
|
console.log(err)
|
|
}
|
|
}
|
|
</script>
|
|
|
|
</div>
|
|
<div class="md-dialog" data-md-component="dialog">
|
|
<div class="md-dialog__inner md-typeset"></div>
|
|
</div>
|
|
<script id="__config" type="application/json">{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.b97dbffb.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version.title": "Select version"}, "version": {"provider": "mike"}}</script>
|
|
|
|
|
|
<script src="../assets/javascripts/bundle.6c7ad80a.min.js"></script>
|
|
|
|
<script src="../javascripts/config.js"></script>
|
|
|
|
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
|
|
|
|
|
</body>
|
|
</html> |