mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-15 04:33:57 +00:00
1593 lines
52 KiB
HTML
1593 lines
52 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="icon" href="../images/logo.png">
|
|
<meta name="generator" content="mkdocs-1.3.1, mkdocs-material-7.1.3">
|
|
|
|
|
|
|
|
<title>Contributors Guide - Freqtrade</title>
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../assets/stylesheets/main.e35208c4.min.css">
|
|
|
|
|
|
<link rel="stylesheet" href="../assets/stylesheets/palette.ef6f36e2.min.css">
|
|
|
|
|
|
|
|
<meta name="theme-color" content="#546d78">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
|
|
<style>:root{--md-text-font-family:"Roboto";--md-code-font-family:"Roboto Mono"}</style>
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../stylesheets/ft.extra.css">
|
|
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<body dir="ltr" data-md-color-scheme="" data-md-color-primary="blue-grey" data-md-color-accent="tear">
|
|
|
|
|
|
<script>function __prefix(e){return new URL("..",location).pathname+"."+e}function __get(e,t=localStorage){return JSON.parse(t.getItem(__prefix(e)))}</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="#development-help" class="md-skip">
|
|
Skip to content
|
|
</a>
|
|
|
|
</div>
|
|
<div data-md-component="announce">
|
|
|
|
</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">
|
|
|
|
<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">
|
|
|
|
Contributors Guide
|
|
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="md-header__options">
|
|
|
|
</div>
|
|
|
|
<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" data-md-state="active" 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>
|
|
<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>
|
|
</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"><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>
|
|
<!-- 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>
|
|
</header>
|
|
|
|
<div class="md-container" data-md-component="container">
|
|
|
|
|
|
|
|
|
|
<main class="md-main" data-md-component="main">
|
|
<div class="md-main__inner md-grid">
|
|
|
|
|
|
|
|
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
|
|
<div class="md-sidebar__scrollwrap">
|
|
<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"><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="../plugins/" class="md-nav__link">
|
|
Plugins
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../stoploss/" class="md-nav__link">
|
|
Stoploss
|
|
</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_10" type="checkbox" id="__nav_10" >
|
|
|
|
<label class="md-nav__link" for="__nav_10">
|
|
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_10">
|
|
<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="../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 md-nav__item--nested">
|
|
|
|
|
|
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_16" type="checkbox" id="__nav_16" >
|
|
|
|
<label class="md-nav__link" for="__nav_16">
|
|
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_16">
|
|
<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>
|
|
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
</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_18" type="checkbox" id="__nav_18" >
|
|
|
|
<label class="md-nav__link" for="__nav_18">
|
|
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_18">
|
|
<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">
|
|
<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 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">
|
|
Contributors Guide
|
|
<span class="md-nav__icon md-icon"></span>
|
|
</label>
|
|
|
|
<a href="./" class="md-nav__link md-nav__link--active">
|
|
Contributors Guide
|
|
</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="#documentation" class="md-nav__link">
|
|
Documentation
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#developer-setup" class="md-nav__link">
|
|
Developer setup
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Developer setup">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#devcontainer-setup" class="md-nav__link">
|
|
Devcontainer setup
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Devcontainer setup">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#devcontainer-dependencies" class="md-nav__link">
|
|
Devcontainer dependencies
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#tests" class="md-nav__link">
|
|
Tests
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Tests">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#checking-log-content-in-tests" class="md-nav__link">
|
|
Checking log content in tests
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#errorhandling" class="md-nav__link">
|
|
ErrorHandling
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#plugins" class="md-nav__link">
|
|
Plugins
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Plugins">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#pairlists" class="md-nav__link">
|
|
Pairlists
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Pairlists">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#pairlist-configuration" class="md-nav__link">
|
|
Pairlist configuration
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#short_desc" class="md-nav__link">
|
|
short_desc
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#gen_pairlist" class="md-nav__link">
|
|
gen_pairlist
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#filter_pairlist" class="md-nav__link">
|
|
filter_pairlist
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="filter_pairlist">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#sample" class="md-nav__link">
|
|
sample
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#protections" class="md-nav__link">
|
|
Protections
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Protections">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#implementation-of-a-new-protection" class="md-nav__link">
|
|
Implementation of a new protection
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#global-vs-local-stops" class="md-nav__link">
|
|
Global vs. local stops
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Global vs. local stops">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#protections-per-pair" class="md-nav__link">
|
|
Protections - per pair
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#protections-global-protection" class="md-nav__link">
|
|
Protections - global protection
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#protections-calculating-lock-end-time" class="md-nav__link">
|
|
Protections - calculating lock end time
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#implement-a-new-exchange-wip" class="md-nav__link">
|
|
Implement a new Exchange (WIP)
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Implement a new Exchange (WIP)">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#stoploss-on-exchange" class="md-nav__link">
|
|
Stoploss On Exchange
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#incomplete-candles" class="md-nav__link">
|
|
Incomplete candles
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<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="#documentation" class="md-nav__link">
|
|
Documentation
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#developer-setup" class="md-nav__link">
|
|
Developer setup
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Developer setup">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#devcontainer-setup" class="md-nav__link">
|
|
Devcontainer setup
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Devcontainer setup">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#devcontainer-dependencies" class="md-nav__link">
|
|
Devcontainer dependencies
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#tests" class="md-nav__link">
|
|
Tests
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Tests">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#checking-log-content-in-tests" class="md-nav__link">
|
|
Checking log content in tests
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#errorhandling" class="md-nav__link">
|
|
ErrorHandling
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#plugins" class="md-nav__link">
|
|
Plugins
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Plugins">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#pairlists" class="md-nav__link">
|
|
Pairlists
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Pairlists">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#pairlist-configuration" class="md-nav__link">
|
|
Pairlist configuration
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#short_desc" class="md-nav__link">
|
|
short_desc
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#gen_pairlist" class="md-nav__link">
|
|
gen_pairlist
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#filter_pairlist" class="md-nav__link">
|
|
filter_pairlist
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="filter_pairlist">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#sample" class="md-nav__link">
|
|
sample
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#protections" class="md-nav__link">
|
|
Protections
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Protections">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#implementation-of-a-new-protection" class="md-nav__link">
|
|
Implementation of a new protection
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#global-vs-local-stops" class="md-nav__link">
|
|
Global vs. local stops
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Global vs. local stops">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#protections-per-pair" class="md-nav__link">
|
|
Protections - per pair
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#protections-global-protection" class="md-nav__link">
|
|
Protections - global protection
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#protections-calculating-lock-end-time" class="md-nav__link">
|
|
Protections - calculating lock end time
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#implement-a-new-exchange-wip" class="md-nav__link">
|
|
Implement a new Exchange (WIP)
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Implement a new Exchange (WIP)">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#stoploss-on-exchange" class="md-nav__link">
|
|
Stoploss On Exchange
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#incomplete-candles" class="md-nav__link">
|
|
Incomplete candles
|
|
</a>
|
|
|
|
</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/developer.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="development-help">Development Help<a class="headerlink" href="#development-help" title="Permanent link">¶</a></h1>
|
|
<p>This page is intended for developers of Freqtrade, people who want to contribute to the Freqtrade codebase or documentation, or people who want to understand the source code of the application they're running.</p>
|
|
<p>All contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas are welcome. We <a href="https://github.com/freqtrade/freqtrade/issues">track issues</a> on <a href="https://github.com">GitHub</a> and also have a dev channel on <a href="https://discord.gg/MA9v74M">discord</a> or <a href="https://join.slack.com/t/highfrequencybot/shared_invite/zt-mm786y93-Fxo37glxMY9g8OQC5AoOIw">slack</a> where you can ask questions.</p>
|
|
<h2 id="documentation">Documentation<a class="headerlink" href="#documentation" title="Permanent link">¶</a></h2>
|
|
<p>Documentation is available at <a href="https://www.freqtrade.io/">https://freqtrade.io</a> and needs to be provided with every new feature PR.</p>
|
|
<p>Special fields for the documentation (like Note boxes, ...) can be found <a href="https://squidfunk.github.io/mkdocs-material/extensions/admonition/">here</a>.</p>
|
|
<p>To test the documentation locally use the following commands.</p>
|
|
<p><code>bash
|
|
pip install -r docs/requirements-docs.txt
|
|
mkdocs serve</code></p>
|
|
<p>This will spin up a local server (usually on port 8000) so you can see if everything looks as you'd like it to.</p>
|
|
<h2 id="developer-setup">Developer setup<a class="headerlink" href="#developer-setup" title="Permanent link">¶</a></h2>
|
|
<p>To configure a development environment, you can either use the provided <a href="#devcontainer-setup">DevContainer</a>, or use the <code>setup.sh</code> script and answer "y" when asked "Do you want to install dependencies for dev [y/N]? ".
|
|
Alternatively (e.g. if your system is not supported by the setup.sh script), follow the manual installation process and run <code>pip3 install -e .[all]</code>.</p>
|
|
<p>This will install all required tools for development, including <code>pytest</code>, <code>flake8</code>, <code>mypy</code>, and <code>coveralls</code>.</p>
|
|
<h3 id="devcontainer-setup">Devcontainer setup<a class="headerlink" href="#devcontainer-setup" title="Permanent link">¶</a></h3>
|
|
<p>The fastest and easiest way to get started is to use <a href="https://code.visualstudio.com/">VSCode</a> with the Remote container extension.
|
|
This gives developers the ability to start the bot with all required dependencies <em>without</em> needing to install any freqtrade specific dependencies on your local machine.</p>
|
|
<h4 id="devcontainer-dependencies">Devcontainer dependencies<a class="headerlink" href="#devcontainer-dependencies" title="Permanent link">¶</a></h4>
|
|
<ul>
|
|
<li><a href="https://code.visualstudio.com/">VSCode</a></li>
|
|
<li><a href="https://docs.docker.com/install/">docker</a></li>
|
|
<li><a href="https://code.visualstudio.com/docs/remote">Remote container extension documentation</a></li>
|
|
</ul>
|
|
<p>For more information about the <a href="https://code.visualstudio.com/docs/remote">Remote container extension</a>, best consult the documentation.</p>
|
|
<h3 id="tests">Tests<a class="headerlink" href="#tests" title="Permanent link">¶</a></h3>
|
|
<p>New code should be covered by basic unittests. Depending on the complexity of the feature, Reviewers may request more in-depth unittests.
|
|
If necessary, the Freqtrade team can assist and give guidance with writing good tests (however please don't expect anyone to write the tests for you).</p>
|
|
<h4 id="checking-log-content-in-tests">Checking log content in tests<a class="headerlink" href="#checking-log-content-in-tests" title="Permanent link">¶</a></h4>
|
|
<p>Freqtrade uses 2 main methods to check log content in tests, <code>log_has()</code> and <code>log_has_re()</code> (to check using regex, in case of dynamic log-messages).
|
|
These are available from <code>conftest.py</code> and can be imported in any test module.</p>
|
|
<p>A sample check looks as follows:</p>
|
|
<p>``` python
|
|
from tests.conftest import log_has, log_has_re</p>
|
|
<p>def test_method_to_test(caplog):
|
|
method_to_test()</p>
|
|
<div class="codehilite"><pre><span></span><code>assert log_has("This event happened", caplog)
|
|
# Check regex with trailing number ...
|
|
assert log_has_re(r"This dynamic event happened and produced \d+", caplog)
|
|
</code></pre></div>
|
|
|
|
<p>```</p>
|
|
<h2 id="errorhandling">ErrorHandling<a class="headerlink" href="#errorhandling" title="Permanent link">¶</a></h2>
|
|
<p>Freqtrade Exceptions all inherit from <code>FreqtradeException</code>.
|
|
This general class of error should however not be used directly. Instead, multiple specialized sub-Exceptions exist.</p>
|
|
<p>Below is an outline of exception inheritance hierarchy:</p>
|
|
<p><code>+ FreqtradeException
|
|
|
|
|
+---+ OperationalException
|
|
|
|
|
+---+ DependencyException
|
|
| |
|
|
| +---+ PricingError
|
|
| |
|
|
| +---+ ExchangeError
|
|
| |
|
|
| +---+ TemporaryError
|
|
| |
|
|
| +---+ DDosProtection
|
|
| |
|
|
| +---+ InvalidOrderException
|
|
| |
|
|
| +---+ RetryableOrderError
|
|
| |
|
|
| +---+ InsufficientFundsError
|
|
|
|
|
+---+ StrategyError</code></p>
|
|
<hr />
|
|
<h2 id="plugins">Plugins<a class="headerlink" href="#plugins" title="Permanent link">¶</a></h2>
|
|
<h3 id="pairlists">Pairlists<a class="headerlink" href="#pairlists" title="Permanent link">¶</a></h3>
|
|
<p>You have a great idea for a new pair selection algorithm you would like to try out? Great.
|
|
Hopefully you also want to contribute this back upstream.</p>
|
|
<p>Whatever your motivations are - This should get you off the ground in trying to develop a new Pairlist Handler.</p>
|
|
<p>First of all, have a look at the <a href="https://github.com/freqtrade/freqtrade/blob/develop/freqtrade/pairlist/VolumePairList.py">VolumePairList</a> Handler, and best copy this file with a name of your new Pairlist Handler.</p>
|
|
<p>This is a simple Handler, which however serves as a good example on how to start developing.</p>
|
|
<p>Next, modify the class-name of the Handler (ideally align this with the module filename).</p>
|
|
<p>The base-class provides an instance of the exchange (<code>self._exchange</code>) the pairlist manager (<code>self._pairlistmanager</code>), as well as the main configuration (<code>self._config</code>), the pairlist dedicated configuration (<code>self._pairlistconfig</code>) and the absolute position within the list of pairlists.</p>
|
|
<p><code>python
|
|
self._exchange = exchange
|
|
self._pairlistmanager = pairlistmanager
|
|
self._config = config
|
|
self._pairlistconfig = pairlistconfig
|
|
self._pairlist_pos = pairlist_pos</code></p>
|
|
<div class="admonition tip">
|
|
<p class="admonition-title">Tip</p>
|
|
<p>Don't forget to register your pairlist in <code>constants.py</code> under the variable <code>AVAILABLE_PAIRLISTS</code> - otherwise it will not be selectable.</p>
|
|
</div>
|
|
<p>Now, let's step through the methods which require actions:</p>
|
|
<h4 id="pairlist-configuration">Pairlist configuration<a class="headerlink" href="#pairlist-configuration" title="Permanent link">¶</a></h4>
|
|
<p>Configuration for the chain of Pairlist Handlers is done in the bot configuration file in the element <code>"pairlists"</code>, an array of configuration parameters for each Pairlist Handlers in the chain.</p>
|
|
<p>By convention, <code>"number_assets"</code> is used to specify the maximum number of pairs to keep in the pairlist. Please follow this to ensure a consistent user experience.</p>
|
|
<p>Additional parameters can be configured as needed. For instance, <code>VolumePairList</code> uses <code>"sort_key"</code> to specify the sorting value - however feel free to specify whatever is necessary for your great algorithm to be successful and dynamic.</p>
|
|
<h4 id="short_desc">short_desc<a class="headerlink" href="#short_desc" title="Permanent link">¶</a></h4>
|
|
<p>Returns a description used for Telegram messages.</p>
|
|
<p>This should contain the name of the Pairlist Handler, as well as a short description containing the number of assets. Please follow the format <code>"PairlistName - top/bottom X pairs"</code>.</p>
|
|
<h4 id="gen_pairlist">gen_pairlist<a class="headerlink" href="#gen_pairlist" title="Permanent link">¶</a></h4>
|
|
<p>Override this method if the Pairlist Handler can be used as the leading Pairlist Handler in the chain, defining the initial pairlist which is then handled by all Pairlist Handlers in the chain. Examples are <code>StaticPairList</code> and <code>VolumePairList</code>.</p>
|
|
<p>This is called with each iteration of the bot (only if the Pairlist Handler is at the first location) - so consider implementing caching for compute/network heavy calculations.</p>
|
|
<p>It must return the resulting pairlist (which may then be passed into the chain of Pairlist Handlers).</p>
|
|
<p>Validations are optional, the parent class exposes a <code>_verify_blacklist(pairlist)</code> and <code>_whitelist_for_active_markets(pairlist)</code> to do default filtering. Use this if you limit your result to a certain number of pairs - so the end-result is not shorter than expected.</p>
|
|
<h4 id="filter_pairlist">filter_pairlist<a class="headerlink" href="#filter_pairlist" title="Permanent link">¶</a></h4>
|
|
<p>This method is called for each Pairlist Handler in the chain by the pairlist manager.</p>
|
|
<p>This is called with each iteration of the bot - so consider implementing caching for compute/network heavy calculations.</p>
|
|
<p>It gets passed a pairlist (which can be the result of previous pairlists) as well as <code>tickers</code>, a pre-fetched version of <code>get_tickers()</code>.</p>
|
|
<p>The default implementation in the base class simply calls the <code>_validate_pair()</code> method for each pair in the pairlist, but you may override it. So you should either implement the <code>_validate_pair()</code> in your Pairlist Handler or override <code>filter_pairlist()</code> to do something else.</p>
|
|
<p>If overridden, it must return the resulting pairlist (which may then be passed into the next Pairlist Handler in the chain).</p>
|
|
<p>Validations are optional, the parent class exposes a <code>_verify_blacklist(pairlist)</code> and <code>_whitelist_for_active_markets(pairlist)</code> to do default filters. Use this if you limit your result to a certain number of pairs - so the end result is not shorter than expected.</p>
|
|
<p>In <code>VolumePairList</code>, this implements different methods of sorting, does early validation so only the expected number of pairs is returned.</p>
|
|
<h5 id="sample">sample<a class="headerlink" href="#sample" title="Permanent link">¶</a></h5>
|
|
<p><code>python
|
|
def filter_pairlist(self, pairlist: List[str], tickers: Dict) -> List[str]:
|
|
# Generate dynamic whitelist
|
|
pairs = self._calculate_pairlist(pairlist, tickers)
|
|
return pairs</code></p>
|
|
<h3 id="protections">Protections<a class="headerlink" href="#protections" title="Permanent link">¶</a></h3>
|
|
<p>Best read the <a href="../plugins/#protections">Protection documentation</a> to understand protections.
|
|
This Guide is directed towards Developers who want to develop a new protection.</p>
|
|
<p>No protection should use datetime directly, but use the provided <code>date_now</code> variable for date calculations. This preserves the ability to backtest protections.</p>
|
|
<div class="admonition tip">
|
|
<p class="admonition-title">Writing a new Protection</p>
|
|
<p>Best copy one of the existing Protections to have a good example.
|
|
Don't forget to register your protection in <code>constants.py</code> under the variable <code>AVAILABLE_PROTECTIONS</code> - otherwise it will not be selectable.</p>
|
|
</div>
|
|
<h4 id="implementation-of-a-new-protection">Implementation of a new protection<a class="headerlink" href="#implementation-of-a-new-protection" title="Permanent link">¶</a></h4>
|
|
<p>All Protection implementations must have <code>IProtection</code> as parent class.
|
|
For that reason, they must implement the following methods:</p>
|
|
<ul>
|
|
<li><code>short_desc()</code></li>
|
|
<li><code>global_stop()</code></li>
|
|
<li><code>stop_per_pair()</code>.</li>
|
|
</ul>
|
|
<p><code>global_stop()</code> and <code>stop_per_pair()</code> must return a ProtectionReturn tuple, which consists of:</p>
|
|
<ul>
|
|
<li>lock pair - boolean</li>
|
|
<li>lock until - datetime - until when should the pair be locked (will be rounded up to the next new candle)</li>
|
|
<li>reason - string, used for logging and storage in the database</li>
|
|
</ul>
|
|
<p>The <code>until</code> portion should be calculated using the provided <code>calculate_lock_end()</code> method.</p>
|
|
<p>All Protections should use <code>"stop_duration"</code> / <code>"stop_duration_candles"</code> to define how long a a pair (or all pairs) should be locked.
|
|
The content of this is made available as <code>self._stop_duration</code> to the each Protection.</p>
|
|
<p>If your protection requires a look-back period, please use <code>"lookback_period"</code> / <code>"lockback_period_candles"</code> to keep all protections aligned.</p>
|
|
<h4 id="global-vs-local-stops">Global vs. local stops<a class="headerlink" href="#global-vs-local-stops" title="Permanent link">¶</a></h4>
|
|
<p>Protections can have 2 different ways to stop trading for a limited :</p>
|
|
<ul>
|
|
<li>Per pair (local)</li>
|
|
<li>For all Pairs (globally)</li>
|
|
</ul>
|
|
<h5 id="protections-per-pair">Protections - per pair<a class="headerlink" href="#protections-per-pair" title="Permanent link">¶</a></h5>
|
|
<p>Protections that implement the per pair approach must set <code>has_local_stop=True</code>.
|
|
The method <code>stop_per_pair()</code> will be called whenever a trade closed (sell order completed).</p>
|
|
<h5 id="protections-global-protection">Protections - global protection<a class="headerlink" href="#protections-global-protection" title="Permanent link">¶</a></h5>
|
|
<p>These Protections should do their evaluation across all pairs, and consequently will also lock all pairs from trading (called a global PairLock).
|
|
Global protection must set <code>has_global_stop=True</code> to be evaluated for global stops.
|
|
The method <code>global_stop()</code> will be called whenever a trade closed (sell order completed).</p>
|
|
<h5 id="protections-calculating-lock-end-time">Protections - calculating lock end time<a class="headerlink" href="#protections-calculating-lock-end-time" title="Permanent link">¶</a></h5>
|
|
<p>Protections should calculate the lock end time based on the last trade it considers.
|
|
This avoids re-locking should the lookback-period be longer than the actual lock period.</p>
|
|
<p>The <code>IProtection</code> parent class provides a helper method for this in <code>calculate_lock_end()</code>.</p>
|
|
<hr />
|
|
<h2 id="implement-a-new-exchange-wip">Implement a new Exchange (WIP)<a class="headerlink" href="#implement-a-new-exchange-wip" title="Permanent link">¶</a></h2>
|
|
<div class="admonition note">
|
|
<p class="admonition-title">Note</p>
|
|
<p>This section is a Work in Progress and is not a complete guide on how to test a new exchange with Freqtrade.</p>
|
|
</div>
|
|
<p>Most exchanges supported by CCXT should work out of the box.</p>
|
|
<p>To quickly test the public endpoints of an exchange, add a configuration for your exchange to <code>test_ccxt_compat.py</code> and run these tests with <code>pytest --longrun tests/exchange/test_ccxt_compat.py</code>.
|
|
Completing these tests successfully a good basis point (it's a requirement, actually), however these won't guarantee correct exchange functioning, as this only tests public endpoints, but no private endpoint (like generate order or similar).</p>
|
|
<h3 id="stoploss-on-exchange">Stoploss On Exchange<a class="headerlink" href="#stoploss-on-exchange" title="Permanent link">¶</a></h3>
|
|
<p>Check if the new exchange supports Stoploss on Exchange orders through their API.</p>
|
|
<p>Since CCXT does not provide unification for Stoploss On Exchange yet, we'll need to implement the exchange-specific parameters ourselves. Best look at <code>binance.py</code> for an example implementation of this. You'll need to dig through the documentation of the Exchange's API on how exactly this can be done. <a href="https://github.com/ccxt/ccxt/issues">CCXT Issues</a> may also provide great help, since others may have implemented something similar for their projects.</p>
|
|
<h3 id="incomplete-candles">Incomplete candles<a class="headerlink" href="#incomplete-candles" title="Permanent link">¶</a></h3>
|
|
<p>While fetching candle (OHLCV) data, we may end up getting incomplete candles (depending on the exchange).
|
|
To demonstrate this, we'll use daily candles (<code>"1d"</code>) to keep things simple.
|
|
We query the api (<code>ct.fetch_ohlcv()</code>) for the timeframe and look at the date of the last entry. If this entry changes or shows the date of a "incomplete" candle, then we should drop this since having incomplete candles is problematic because indicators assume that only complete candles are passed to them, and will generate a lot of false buy signals. By default, we're therefore removing the last candle assuming it's incomplete.</p>
|
|
<p>To check how the new exchange behaves, you can use the following snippet:</p>
|
|
<p>``` python
|
|
import ccxt
|
|
from datetime import datetime
|
|
from freqtrade.data.converter import ohlcv_to_dataframe
|
|
ct = ccxt.binance()
|
|
timeframe = "1d"
|
|
pair = "XLM/BTC" # Make sure to use a pair that exists on that exchange!
|
|
raw = ct.fetch_ohlcv(pair, timeframe=timeframe)</p>
|
|
<h1 id="convert-to-dataframe">convert to dataframe<a class="headerlink" href="#convert-to-dataframe" title="Permanent link">¶</a></h1>
|
|
<p>df1 = ohlcv_to_dataframe(raw, timeframe, pair=pair, drop_incomplete=False)</p>
|
|
<p>print(df1.tail(1))
|
|
print(datetime.utcnow())
|
|
```</p>
|
|
<p><code>output
|
|
date open high low close volume
|
|
499 2019-06-08 00:00:00+00:00 0.000007 0.000007 0.000007 0.000007 26264344.0
|
|
2019-06-09 12:30:27.873327</code></p>
|
|
<p>The output will show the last entry from the Exchange as well as the current UTC date.
|
|
If the day shows the same day, then the last candle can be assumed as incomplete and should be dropped (leave the setting <code>"ohlcv_partial_candle"</code> from the exchange-class untouched / True). Otherwise, set <code>"ohlcv_partial_candle"</code> to <code>False</code> to not drop Candles (shown in the example above).
|
|
Another way is to run this command multiple times in a row and observe if the volume is changing (while the date remains the same).</p>
|
|
<h2 id="updating-example-notebooks">Updating example notebooks<a class="headerlink" href="#updating-example-notebooks" title="Permanent link">¶</a></h2>
|
|
<p>To keep the jupyter notebooks aligned with the documentation, the following should be ran after updating a example notebook.</p>
|
|
<p><code>bash
|
|
jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace freqtrade/templates/strategy_analysis_example.ipynb
|
|
jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to markdown freqtrade/templates/strategy_analysis_example.ipynb --stdout > docs/strategy_analysis_example.md</code></p>
|
|
<h2 id="continuous-integration">Continuous integration<a class="headerlink" href="#continuous-integration" title="Permanent link">¶</a></h2>
|
|
<p>This documents some decisions taken for the CI Pipeline.</p>
|
|
<ul>
|
|
<li>CI runs on all OS variants, Linux (ubuntu), macOS and Windows.</li>
|
|
<li>Docker images are build for the branches <code>stable</code> and <code>develop</code>.</li>
|
|
<li>Docker images containing Plot dependencies are also available as <code>stable_plot</code> and <code>develop_plot</code>.</li>
|
|
<li>Raspberry PI Docker images are postfixed with <code>_pi</code> - so tags will be <code>:stable_pi</code> and <code>develop_pi</code>.</li>
|
|
<li>Docker images contain a file, <code>/freqtrade/freqtrade_commit</code> containing the commit this image is based of.</li>
|
|
<li>Full docker image rebuilds are run once a week via schedule.</li>
|
|
<li>Deployments run on ubuntu.</li>
|
|
<li>ta-lib binaries are contained in the build_helpers directory to avoid fails related to external unavailability.</li>
|
|
<li>All tests must pass for a PR to be merged to <code>stable</code> or <code>develop</code>.</li>
|
|
</ul>
|
|
<h2 id="creating-a-release">Creating a release<a class="headerlink" href="#creating-a-release" title="Permanent link">¶</a></h2>
|
|
<p>This part of the documentation is aimed at maintainers, and shows how to create a release.</p>
|
|
<h3 id="create-release-branch">Create release branch<a class="headerlink" href="#create-release-branch" title="Permanent link">¶</a></h3>
|
|
<p>First, pick a commit that's about one week old (to not include latest additions to releases).</p>
|
|
<p>``` bash</p>
|
|
<h1 id="create-new-branch">create new branch<a class="headerlink" href="#create-new-branch" title="Permanent link">¶</a></h1>
|
|
<p>git checkout -b new_release <commitid>
|
|
```</p>
|
|
<p>Determine if crucial bugfixes have been made between this commit and the current state, and eventually cherry-pick these.</p>
|
|
<ul>
|
|
<li>Merge the release branch (stable) into this branch.</li>
|
|
<li>Edit <code>freqtrade/__init__.py</code> and add the version matching the current date (for example <code>2019.7</code> for July 2019). Minor versions can be <code>2019.7.1</code> should we need to do a second release that month. Version numbers must follow allowed versions from PEP0440 to avoid failures pushing to pypi.</li>
|
|
<li>Commit this part</li>
|
|
<li>push that branch to the remote and create a PR against the stable branch</li>
|
|
</ul>
|
|
<h3 id="create-changelog-from-git-commits">Create changelog from git commits<a class="headerlink" href="#create-changelog-from-git-commits" title="Permanent link">¶</a></h3>
|
|
<div class="admonition note">
|
|
<p class="admonition-title">Note</p>
|
|
<p>Make sure that the <code>stable</code> branch is up-to-date!</p>
|
|
</div>
|
|
<p>``` bash</p>
|
|
<h1 id="needs-to-be-done-before-merging-pulling-that-branch">Needs to be done before merging / pulling that branch.<a class="headerlink" href="#needs-to-be-done-before-merging-pulling-that-branch" title="Permanent link">¶</a></h1>
|
|
<p>git log --oneline --no-decorate --no-merges stable..new_release
|
|
```</p>
|
|
<p>To keep the release-log short, best wrap the full git changelog into a collapsible details section.</p>
|
|
<p>```markdown</p>
|
|
<details>
|
|
<summary>Expand full changelog</summary>
|
|
|
|
... Full git changelog
|
|
|
|
</details>
|
|
<p>```</p>
|
|
<h3 id="create-github-release-tag">Create github release / tag<a class="headerlink" href="#create-github-release-tag" title="Permanent link">¶</a></h3>
|
|
<p>Once the PR against stable is merged (best right after merging):</p>
|
|
<ul>
|
|
<li>Use the button "Draft a new release" in the Github UI (subsection releases).</li>
|
|
<li>Use the version-number specified as tag.</li>
|
|
<li>Use "stable" as reference (this step comes after the above PR is merged).</li>
|
|
<li>Use the above changelog as release comment (as codeblock)</li>
|
|
</ul>
|
|
<h2 id="releases">Releases<a class="headerlink" href="#releases" title="Permanent link">¶</a></h2>
|
|
<h3 id="pypi">pypi<a class="headerlink" href="#pypi" title="Permanent link">¶</a></h3>
|
|
<div class="admonition note">
|
|
<p class="admonition-title">Note</p>
|
|
<p>This process is now automated as part of Github Actions.</p>
|
|
</div>
|
|
<p>To create a pypi release, please run the following commands:</p>
|
|
<p>Additional requirement: <code>wheel</code>, <code>twine</code> (for uploading), account on pypi with proper permissions.</p>
|
|
<p>``` bash
|
|
python setup.py sdist bdist_wheel</p>
|
|
<h1 id="for-pypi-test-to-check-if-some-change-to-the-installation-did-work">For pypi test (to check if some change to the installation did work)<a class="headerlink" href="#for-pypi-test-to-check-if-some-change-to-the-installation-did-work" title="Permanent link">¶</a></h1>
|
|
<p>twine upload --repository-url <a href="https://test.pypi.org/legacy/">https://test.pypi.org/legacy/</a> dist/*</p>
|
|
<h1 id="for-production">For production:<a class="headerlink" href="#for-production" title="Permanent link">¶</a></h1>
|
|
<p>twine upload dist/*
|
|
```</p>
|
|
<p>Please don't push non-releases to the productive / real pypi instance.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</article>
|
|
</div>
|
|
</div>
|
|
|
|
</main>
|
|
|
|
|
|
<footer class="md-footer">
|
|
|
|
<nav class="md-footer__inner md-grid" aria-label="Footer">
|
|
|
|
<a href="../deprecated/" class="md-footer__link md-footer__link--prev" 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>
|
|
Deprecated Features
|
|
</div>
|
|
</div>
|
|
</a>
|
|
|
|
|
|
</nav>
|
|
|
|
<div class="md-footer-meta md-typeset">
|
|
<div class="md-footer-meta__inner md-grid">
|
|
<div class="md-footer-copyright">
|
|
|
|
Made with
|
|
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
|
|
Material for MkDocs
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
|
|
</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.fe42c31b.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"}, "version": {"provider": "mike"}}</script>
|
|
|
|
|
|
<script src="../assets/javascripts/bundle.4ea5477f.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> |