mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
Compare commits
3280 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98a2811605 | ||
|
|
1f14c6bacd | ||
|
|
44e8184519 | ||
|
|
c14ff2bee1 | ||
|
|
17659001d8 | ||
|
|
45f4057d3c | ||
|
|
64c2b6c9a6 | ||
|
|
6a1b1eb75a | ||
|
|
bb27b236ce | ||
|
|
c56dd487f2 | ||
|
|
ff3e2641ae | ||
|
|
fe45b79beb | ||
|
|
d49488bf0e | ||
|
|
378f03a5b1 | ||
|
|
fa18274e9a | ||
|
|
66ca596e7c | ||
|
|
bb56d392a9 | ||
|
|
6b46a35b19 | ||
|
|
4b06c9e0ae | ||
|
|
d639290f7d | ||
|
|
87f6c7bbec | ||
|
|
6f52faf328 | ||
|
|
a9198c1f7e | ||
|
|
6e32ac5b3a | ||
|
|
be33556838 | ||
|
|
d1b3a16c13 | ||
|
|
4cb5c9c85f | ||
|
|
50aec1d6d3 | ||
|
|
7dadca421a | ||
|
|
261b267160 | ||
|
|
3c460d37b6 | ||
|
|
8ff1429e68 | ||
|
|
b02c0904b6 | ||
|
|
ab190f7a5b | ||
|
|
30c1253f75 | ||
|
|
f9efbed076 | ||
|
|
40132bbea4 | ||
|
|
85ab6e43ba | ||
|
|
129cbf5ef5 | ||
|
|
096079a595 | ||
|
|
4355f36cd6 | ||
|
|
0a7b6f73c9 | ||
|
|
cf85a178f3 | ||
|
|
20e5c1b388 | ||
|
|
7ead4f9fa3 | ||
|
|
8ff7ce8b17 | ||
|
|
b72cccae3c | ||
|
|
a8a9fb5c6a | ||
|
|
637fe35549 | ||
|
|
b3f0bfd77f | ||
|
|
2b1d0b4ab5 | ||
|
|
c349499985 | ||
|
|
80f6f6dcbc | ||
|
|
d5b2ffae7a | ||
|
|
f51f445011 | ||
|
|
a31de431ed | ||
|
|
8c9a600dec | ||
|
|
a95dbdbde4 | ||
|
|
2554dc48e4 | ||
|
|
413d7ddf70 | ||
|
|
e53b88bde3 | ||
|
|
2a7935e35e | ||
|
|
6674285b12 | ||
|
|
f0d7f18cf9 | ||
|
|
476319da45 | ||
|
|
934abb0094 | ||
|
|
a559611c15 | ||
|
|
bf95fe2e5c | ||
|
|
5daaed1449 | ||
|
|
1f086e1466 | ||
|
|
77d0189695 | ||
|
|
2f6b00555a | ||
|
|
35857b3dde | ||
|
|
bfd0e3553a | ||
|
|
254875e6b3 | ||
|
|
dd87938a5e | ||
|
|
ec01f20bf8 | ||
|
|
962fed24b0 | ||
|
|
b4443fdb1f | ||
|
|
49d0bd4832 | ||
|
|
6d30740b55 | ||
|
|
c510b6012d | ||
|
|
3aa34c411d | ||
|
|
78555adecd | ||
|
|
23c1ae5d4a | ||
|
|
9d3caae9e3 | ||
|
|
3c76945d5e | ||
|
|
60538368ac | ||
|
|
7e28896c5c | ||
|
|
07ccda9146 | ||
|
|
d65d886d7d | ||
|
|
ba8e93e2a1 | ||
|
|
dcedc1480f | ||
|
|
503d5db113 | ||
|
|
3f52b6d6d5 | ||
|
|
77c28187a6 | ||
|
|
977ccaac16 | ||
|
|
50f0483d9a | ||
|
|
13994fac92 | ||
|
|
a18305ffe7 | ||
|
|
90d97c536d | ||
|
|
0c9301e74a | ||
|
|
aa8832f70e | ||
|
|
41942e3af1 | ||
|
|
b8773de5b0 | ||
|
|
85d90645c7 | ||
|
|
4db8c779fc | ||
|
|
6a08fee25b | ||
|
|
23f569ea38 | ||
|
|
3c521f55b2 | ||
|
|
c3e0397743 | ||
|
|
6b22b4e4c7 | ||
|
|
beb8692231 | ||
|
|
511dc254ff | ||
|
|
d28d663175 | ||
|
|
4480b3b393 | ||
|
|
8c97b83b8c | ||
|
|
d8dae46544 | ||
|
|
986e767d6c | ||
|
|
4cf66e2fba | ||
|
|
083c358044 | ||
|
|
25938efee6 | ||
|
|
98840eef3c | ||
|
|
caf0476717 | ||
|
|
8af610b543 | ||
|
|
aa2d1e9cca | ||
|
|
3fe2ed0e18 | ||
|
|
f63a378967 | ||
|
|
4c34934258 | ||
|
|
384b966265 | ||
|
|
f20318fad1 | ||
|
|
eb06ffc908 | ||
|
|
d8fdbd656b | ||
|
|
ff0e73a9e5 | ||
|
|
534404c284 | ||
|
|
014fcb36f4 | ||
|
|
7852feab05 | ||
|
|
f3e0370d4d | ||
|
|
6518e7a789 | ||
|
|
26a5cc5959 | ||
|
|
f113b45036 | ||
|
|
da0ceb7d87 | ||
|
|
cad0275b32 | ||
|
|
f6ebe51314 | ||
|
|
a0fd7f4644 | ||
|
|
5fba446e9a | ||
|
|
b4da36d6e9 | ||
|
|
7c1f111ddf | ||
|
|
cec98ad407 | ||
|
|
68d51a9787 | ||
|
|
a78d61150c | ||
|
|
b7662722ba | ||
|
|
b4c3529135 | ||
|
|
8c9297e1f0 | ||
|
|
c18441f36f | ||
|
|
71af64af94 | ||
|
|
cc684c5141 | ||
|
|
7bc8927914 | ||
|
|
bd4f3d838a | ||
|
|
3ecd23f853 | ||
|
|
848a94d62e | ||
|
|
bc5cc48f67 | ||
|
|
1406691945 | ||
|
|
32005b886a | ||
|
|
275d853432 | ||
|
|
34b27d2f96 | ||
|
|
29fe2ffff7 | ||
|
|
e6058b716b | ||
|
|
66505bd9bf | ||
|
|
f6a8dda8e5 | ||
|
|
714264701c | ||
|
|
47f0e69072 | ||
|
|
93d1ad5ed9 | ||
|
|
1f13a8b91d | ||
|
|
08e3546120 | ||
|
|
5f9c449d8e | ||
|
|
70eaf971cd | ||
|
|
69349a9d8d | ||
|
|
ec9b51d60a | ||
|
|
27362046d4 | ||
|
|
5c5cf782f5 | ||
|
|
47352e1721 | ||
|
|
295ecaa9b2 | ||
|
|
79ea8cf771 | ||
|
|
e268bd192e | ||
|
|
f54fecaeba | ||
|
|
10c5b230b4 | ||
|
|
dff0ac2768 | ||
|
|
43035a3f76 | ||
|
|
451a18c444 | ||
|
|
d444182829 | ||
|
|
3bc6cb36c6 | ||
|
|
d6d3a02a23 | ||
|
|
a4e3edbcc5 | ||
|
|
38c52c7eee | ||
|
|
24df8d6bf5 | ||
|
|
8b664644c0 | ||
|
|
feb3ae87f7 | ||
|
|
8bb3b6baf3 | ||
|
|
96f95c340d | ||
|
|
34e586243a | ||
|
|
aa839c3d2f | ||
|
|
fbd68dd190 | ||
|
|
c5b8993e9d | ||
|
|
8969ab4aa3 | ||
|
|
55a49bfc53 | ||
|
|
821af9be9e | ||
|
|
4adf012ee6 | ||
|
|
f83633ff4e | ||
|
|
7f74ff53b1 | ||
|
|
cb37166086 | ||
|
|
7cbe3cd452 | ||
|
|
3d39f05c8f | ||
|
|
77f2d46e29 | ||
|
|
b8aa07a6e8 | ||
|
|
842eff95eb | ||
|
|
284d39930f | ||
|
|
2ae04af694 | ||
|
|
a595d23bf1 | ||
|
|
289425a434 | ||
|
|
9c20d488a9 | ||
|
|
a9e7ee8113 | ||
|
|
dc6d71f651 | ||
|
|
cf719bc5d3 | ||
|
|
bf5a082358 | ||
|
|
b2373fccfd | ||
|
|
9c0a3fffd7 | ||
|
|
5e75caa917 | ||
|
|
85e71275d3 | ||
|
|
add78414e4 | ||
|
|
d161b94d72 | ||
|
|
309ea1246a | ||
|
|
d1fe3c1a3d | ||
|
|
9d4ecb625a | ||
|
|
21f4aba4e3 | ||
|
|
605ed90567 | ||
|
|
c6ead02da0 | ||
|
|
3bb69bc1bd | ||
|
|
fca11160e4 | ||
|
|
354a406248 | ||
|
|
b613fb7bc5 | ||
|
|
502e21b2cb | ||
|
|
c272944834 | ||
|
|
da097aea6a | ||
|
|
7ece7294b2 | ||
|
|
496a9cfb20 | ||
|
|
c3523daa09 | ||
|
|
c1b464f53c | ||
|
|
7953c69922 | ||
|
|
c83d6bd1e2 | ||
|
|
f22fc8ef3e | ||
|
|
0e20b8f530 | ||
|
|
74c97369d9 | ||
|
|
4c48fe96ed | ||
|
|
5799cc51f2 | ||
|
|
8b767eedfd | ||
|
|
26f45c8323 | ||
|
|
38809acde8 | ||
|
|
8478e083dc | ||
|
|
8940ba828f | ||
|
|
311b55fc24 | ||
|
|
a55dd8444d | ||
|
|
c3a367e4f0 | ||
|
|
ec94961437 | ||
|
|
9ba9f73706 | ||
|
|
4ecb67d1d1 | ||
|
|
92d8adf36c | ||
|
|
05ec56d906 | ||
|
|
73417f11f1 | ||
|
|
2701a7cb12 | ||
|
|
c2707bdd9b | ||
|
|
d8a6410fd1 | ||
|
|
674b510d23 | ||
|
|
3d7e800ff2 | ||
|
|
11e69bdd65 | ||
|
|
fd33282eb1 | ||
|
|
637147f89c | ||
|
|
3b4446339e | ||
|
|
f2b390a271 | ||
|
|
fc2104bfad | ||
|
|
39beb5c837 | ||
|
|
fc42d552ab | ||
|
|
2d6bcbb454 | ||
|
|
0e368b16ab | ||
|
|
3d93236709 | ||
|
|
301f74fd1b | ||
|
|
fa0c8fa0b3 | ||
|
|
357d7714ec | ||
|
|
3be14933d4 | ||
|
|
0b6014fae3 | ||
|
|
838985f6a0 | ||
|
|
c4e597977c | ||
|
|
4f1179d85c | ||
|
|
f5a9001dc0 | ||
|
|
bca24c8b6b | ||
|
|
55c6e56762 | ||
|
|
42273ae042 | ||
|
|
3d515ed5bf | ||
|
|
e206cc9c21 | ||
|
|
375e671aaf | ||
|
|
d8e1f97465 | ||
|
|
9982ad2f36 | ||
|
|
668d167adc | ||
|
|
4eb17b4daf | ||
|
|
aa866294cd | ||
|
|
ce15c55185 | ||
|
|
e0fa549bb4 | ||
|
|
53ea6e0a86 | ||
|
|
0f5dd6d0fa | ||
|
|
70e213751d | ||
|
|
161417b6f4 | ||
|
|
30a2df14cb | ||
|
|
c8ddd5654a | ||
|
|
988bff9eae | ||
|
|
7af7fb261b | ||
|
|
da6672841a | ||
|
|
a6dac9acf3 | ||
|
|
1f153f51ee | ||
|
|
d6ea442588 | ||
|
|
2a6faaae64 | ||
|
|
4619a50097 | ||
|
|
bd308889fc | ||
|
|
f8efb87a67 | ||
|
|
ddba999fe2 | ||
|
|
81a75c97cf | ||
|
|
5091767276 | ||
|
|
8b348fc247 | ||
|
|
67e9721274 | ||
|
|
4a0c988b67 | ||
|
|
e30a38932f | ||
|
|
902d40a32a | ||
|
|
4ade3daa1e | ||
|
|
1ce392f652 | ||
|
|
c60192e4bd | ||
|
|
bae8e5ed1a | ||
|
|
cffac3f7b6 | ||
|
|
b9e46a3c5a | ||
|
|
56ca37fd8b | ||
|
|
c2573c998b | ||
|
|
cc91d51389 | ||
|
|
142f87b68c | ||
|
|
1cb10d8f8e | ||
|
|
9dd2800b98 | ||
|
|
89b9a8cb1f | ||
|
|
f3d4b114bb | ||
|
|
1ffa3d1ae0 | ||
|
|
f5863a1c6f | ||
|
|
9659e516c8 | ||
|
|
c4f78203ab | ||
|
|
cdfcdb86c9 | ||
|
|
251eb5aa96 | ||
|
|
122c0e8ddc | ||
|
|
200de312fe | ||
|
|
9ad8e74247 | ||
|
|
5d691b5ee3 | ||
|
|
f3cedc849a | ||
|
|
a14ce9d7d9 | ||
|
|
47b215fe0a | ||
|
|
904c4ecc23 | ||
|
|
5f79caa307 | ||
|
|
b989ba0f82 | ||
|
|
48944fd4cb | ||
|
|
06125df10c | ||
|
|
d8fdd32b54 | ||
|
|
cfa352ecf2 | ||
|
|
b25267ad3d | ||
|
|
552aaf7945 | ||
|
|
22af82631a | ||
|
|
a6fc922f28 | ||
|
|
8458a380b8 | ||
|
|
95efc0d688 | ||
|
|
c4d7aff5c3 | ||
|
|
da2a515d0b | ||
|
|
1a305ea8b0 | ||
|
|
2ca6547baf | ||
|
|
4434a54d59 | ||
|
|
ebd755e36a | ||
|
|
0af9e913d4 | ||
|
|
73182bb2dd | ||
|
|
396e781bf4 | ||
|
|
4924d8487e | ||
|
|
ee7b235cdc | ||
|
|
420a8c2b1c | ||
|
|
a66a3d047f | ||
|
|
ed87abd93a | ||
|
|
171a52b21a | ||
|
|
7d03a067ee | ||
|
|
044df880e6 | ||
|
|
93717cfef1 | ||
|
|
b98107375e | ||
|
|
d76ee43246 | ||
|
|
22f6e884ed | ||
|
|
05bd099f51 | ||
|
|
4109b31dac | ||
|
|
067d1fd72a | ||
|
|
6b85b1a34d | ||
|
|
e45e41adb4 | ||
|
|
1dabade883 | ||
|
|
c6741ea6c3 | ||
|
|
5d61c56650 | ||
|
|
827c31d4bc | ||
|
|
3afd5b631e | ||
|
|
815d88fd4a | ||
|
|
9999d0ffb5 | ||
|
|
faa2bbb555 | ||
|
|
6dfa159a91 | ||
|
|
7cf3e15e54 | ||
|
|
1f1a819b29 | ||
|
|
2fed066e76 | ||
|
|
2dc36bb79e | ||
|
|
56655b97cf | ||
|
|
f51c03aa86 | ||
|
|
77541935a8 | ||
|
|
688d657fe2 | ||
|
|
dda78677a0 | ||
|
|
d77c53960d | ||
|
|
c9c43d2f0b | ||
|
|
064928a0eb | ||
|
|
52eae04945 | ||
|
|
0d96a311f7 | ||
|
|
1afe4df7be | ||
|
|
17613f203a | ||
|
|
2663aede24 | ||
|
|
b576e1d463 | ||
|
|
87e4a82041 | ||
|
|
fca41a44bb | ||
|
|
3670be5dd2 | ||
|
|
2afe1d5b11 | ||
|
|
09aa954b68 | ||
|
|
5e1032c4af | ||
|
|
dd430455e4 | ||
|
|
e2643103b6 | ||
|
|
f3ce54150e | ||
|
|
02810adcf7 | ||
|
|
eba73307e4 | ||
|
|
d01070dba8 | ||
|
|
995d3e1ed5 | ||
|
|
59370672b8 | ||
|
|
081625c5dc | ||
|
|
8b6d10daf1 | ||
|
|
5082acc33f | ||
|
|
767332405e | ||
|
|
8ed3b81c61 | ||
|
|
075c73b9e3 | ||
|
|
817f5289db | ||
|
|
9163c7f3d3 | ||
|
|
b954af33cf | ||
|
|
4b0164770c | ||
|
|
26c7341b7d | ||
|
|
215972c68f | ||
|
|
c0083c4244 | ||
|
|
b22fabe1f3 | ||
|
|
a3688b159f | ||
|
|
a33346c6b6 | ||
|
|
55233db07e | ||
|
|
54bee1d183 | ||
|
|
45256763ca | ||
|
|
b3f04d89d2 | ||
|
|
1855a444fa | ||
|
|
809b3ddafc | ||
|
|
5ff09a06c7 | ||
|
|
3915101d2d | ||
|
|
6c77feee85 | ||
|
|
99bfa839eb | ||
|
|
071e82043a | ||
|
|
7263f83f78 | ||
|
|
653bbc292b | ||
|
|
d1cbc567e4 | ||
|
|
14cb29aae1 | ||
|
|
f3af02c06f | ||
|
|
7318d02ebc | ||
|
|
aab5596fa6 | ||
|
|
977a6d4e9c | ||
|
|
454046f745 | ||
|
|
8d0f338bf2 | ||
|
|
9ed5fed887 | ||
|
|
902e8fa62f | ||
|
|
65755989b4 | ||
|
|
7a51bfbaba | ||
|
|
fe27d2c10d | ||
|
|
90034a8e5e | ||
|
|
1cfbbfb433 | ||
|
|
73042781f4 | ||
|
|
dbcccac6cd | ||
|
|
b4d22f1000 | ||
|
|
364295d2b3 | ||
|
|
63e7490a55 | ||
|
|
838743bf01 | ||
|
|
2ff03e173d | ||
|
|
d1d6f69e43 | ||
|
|
6ce4fd7aff | ||
|
|
bad89307dd | ||
|
|
119bf2a8ea | ||
|
|
db8f3a9e9b | ||
|
|
edb582e522 | ||
|
|
ae1c99bdd0 | ||
|
|
ed33d4781d | ||
|
|
d9b339ee18 | ||
|
|
0a28818b46 | ||
|
|
e26e658f99 | ||
|
|
6a0c84b649 | ||
|
|
861e7099cc | ||
|
|
3171ad33b7 | ||
|
|
0f08addfbe | ||
|
|
31df42e737 | ||
|
|
d4540c846a | ||
|
|
55591e287c | ||
|
|
0614e59966 | ||
|
|
e0c14e6214 | ||
|
|
fdc84eef59 | ||
|
|
8300eb59d4 | ||
|
|
0f18b2a0d4 | ||
|
|
0bad55637e | ||
|
|
a3daf8e41c | ||
|
|
0502fe0496 | ||
|
|
f48250b414 | ||
|
|
50767cd569 | ||
|
|
5c2481082e | ||
|
|
c78199d3d9 | ||
|
|
a1e292f56a | ||
|
|
daee414d7a | ||
|
|
5213abf510 | ||
|
|
f6bde8bd9c | ||
|
|
7e980037a4 | ||
|
|
f5f529cace | ||
|
|
b060164b1f | ||
|
|
2a5f8d8895 | ||
|
|
dbf4d1a694 | ||
|
|
6a10c715fa | ||
|
|
939f91734f | ||
|
|
d8fa17cee8 | ||
|
|
844ff1e068 | ||
|
|
7d6708fc6a | ||
|
|
21dcef1134 | ||
|
|
4774896169 | ||
|
|
4c97527b04 | ||
|
|
22c8f845ec | ||
|
|
b7c6f868b2 | ||
|
|
3955fc6190 | ||
|
|
811028ae92 | ||
|
|
eaa7370174 | ||
|
|
28f4a1101e | ||
|
|
263dcd221d | ||
|
|
772473e93e | ||
|
|
37a9edfa35 | ||
|
|
08fdd7d863 | ||
|
|
dd3a2675b5 | ||
|
|
3271c773a7 | ||
|
|
49395601e9 | ||
|
|
ea1ddeb87d | ||
|
|
d849b32a02 | ||
|
|
cd7ba99528 | ||
|
|
288a2bdbb0 | ||
|
|
eaf2b53d59 | ||
|
|
de46744aa9 | ||
|
|
98f2e79f27 | ||
|
|
3721736aaf | ||
|
|
c1c018d8fe | ||
|
|
eafab38db3 | ||
|
|
c826f7a707 | ||
|
|
18a5822a33 | ||
|
|
d13cb4c055 | ||
|
|
5cebc9f39d | ||
|
|
c1191400a4 | ||
|
|
1051ab917a | ||
|
|
82c68f07cd | ||
|
|
bdf611352e | ||
|
|
2417898d00 | ||
|
|
0f4fc67b83 | ||
|
|
0228b63418 | ||
|
|
0ca81480d4 | ||
|
|
ae55d54967 | ||
|
|
62c55b1863 | ||
|
|
43a1fe6d08 | ||
|
|
01f325a9e4 | ||
|
|
0b36693acc | ||
|
|
c2acf4bb82 | ||
|
|
89c634c70d | ||
|
|
e4b5bbe117 | ||
|
|
b0b76091c8 | ||
|
|
50573bd397 | ||
|
|
d1e4e463ae | ||
|
|
58eb26d73a | ||
|
|
79af6180bd | ||
|
|
6ee6e51ab4 | ||
|
|
3811f4692b | ||
|
|
ed2e35ba5d | ||
|
|
b035d9e267 | ||
|
|
33c3990972 | ||
|
|
5bb81abce2 | ||
|
|
02afde857d | ||
|
|
d4fc52d2d5 | ||
|
|
422825ea1b | ||
|
|
a4b0e8117a | ||
|
|
f0a1a1720f | ||
|
|
ecbca3fab0 | ||
|
|
588043af86 | ||
|
|
40bdc93653 | ||
|
|
14eab9be04 | ||
|
|
091285ba43 | ||
|
|
2e45859aef | ||
|
|
86cf6201c8 | ||
|
|
e0c767614f | ||
|
|
deb34d2879 | ||
|
|
779a8401a8 | ||
|
|
087a38ab78 | ||
|
|
93dd70c77d | ||
|
|
4c8bee1e5d | ||
|
|
f63045b0e9 | ||
|
|
839b3340e6 | ||
|
|
75318525a9 | ||
|
|
c4a9a79be0 | ||
|
|
1fc4451d2f | ||
|
|
ea5e47657a | ||
|
|
0d15a87af8 | ||
|
|
523437d970 | ||
|
|
987188e41f | ||
|
|
8e0ff4bd86 | ||
|
|
42868ad24a | ||
|
|
804c42933d | ||
|
|
d56f9655e2 | ||
|
|
619eb183fe | ||
|
|
16a842f9f6 | ||
|
|
d999fa2a7e | ||
|
|
7c5587aeaa | ||
|
|
2ed808da1f | ||
|
|
59e0ca0aaa | ||
|
|
59ac4b9c9a | ||
|
|
5b1a7ba00f | ||
|
|
f952f74bf1 | ||
|
|
573502d972 | ||
|
|
afefe92523 | ||
|
|
c13ec4a1d4 | ||
|
|
1339479882 | ||
|
|
04eaf2c39c | ||
|
|
7727292861 | ||
|
|
f368aabcc7 | ||
|
|
6e94734678 | ||
|
|
03ab61959b | ||
|
|
af9a9592b7 | ||
|
|
075eb0a161 | ||
|
|
dacb40a976 | ||
|
|
0fa56be9d2 | ||
|
|
04cbc2cde5 | ||
|
|
2881718733 | ||
|
|
b068e7c564 | ||
|
|
415853583b | ||
|
|
81c8e8677d | ||
|
|
480c5117f1 | ||
|
|
5fce7f3b22 | ||
|
|
cf044d166e | ||
|
|
fbddfaeacf | ||
|
|
cbcf3dbb43 | ||
|
|
6922fbc3aa | ||
|
|
455b26ea48 | ||
|
|
5a189ae202 | ||
|
|
da1b37b917 | ||
|
|
20e8a29262 | ||
|
|
23c0db925e | ||
|
|
f32e522bd7 | ||
|
|
39fa589735 | ||
|
|
db965332b9 | ||
|
|
99ac2659f3 | ||
|
|
81850b5fdf | ||
|
|
d9d999eaea | ||
|
|
61ae471eef | ||
|
|
d0d634260f | ||
|
|
2f759825e4 | ||
|
|
cf1bbb1afb | ||
|
|
cf26ab1dd8 | ||
|
|
c2a6f70b4c | ||
|
|
efd6e4a875 | ||
|
|
8a2f631ddd | ||
|
|
e41392a73f | ||
|
|
a6c0a488f5 | ||
|
|
02c0488d45 | ||
|
|
b95065d701 | ||
|
|
ff4ff22f87 | ||
|
|
a9064117a5 | ||
|
|
5bf6635b22 | ||
|
|
5d69ea5e6d | ||
|
|
8fb1683bdc | ||
|
|
0b5fa9f149 | ||
|
|
fc5c63de96 | ||
|
|
8dad665c98 | ||
|
|
c06b280288 | ||
|
|
449d462533 | ||
|
|
95c7ccbf19 | ||
|
|
b8452c36da | ||
|
|
0014958c05 | ||
|
|
9e1ce0c67a | ||
|
|
be2b326a6e | ||
|
|
4e5910afba | ||
|
|
e06b009214 | ||
|
|
fe0b17c70c | ||
|
|
4d9ecf137b | ||
|
|
c6124180fe | ||
|
|
6362bfc36e | ||
|
|
cbcbb4bdb5 | ||
|
|
92c70fb903 | ||
|
|
e040c518ca | ||
|
|
29d3ff1bc9 | ||
|
|
bf61bc9d83 | ||
|
|
e74d2af857 | ||
|
|
5bd4798ed0 | ||
|
|
2c45114a64 | ||
|
|
118f051171 | ||
|
|
e5676867a8 | ||
|
|
b938c536fa | ||
|
|
48289e8ca7 | ||
|
|
0642ab76bf | ||
|
|
e813573f27 | ||
|
|
baaf7f1c54 | ||
|
|
865b73a456 | ||
|
|
e11d22a6a2 | ||
|
|
185fab7b57 | ||
|
|
cc24f44636 | ||
|
|
da8e87660e | ||
|
|
6734269bfc | ||
|
|
c10545ef89 | ||
|
|
ab7f5a2bcf | ||
|
|
5423d8588e | ||
|
|
b77a105778 | ||
|
|
676006b99c | ||
|
|
3624aec059 | ||
|
|
0509b9a8fc | ||
|
|
112906458f | ||
|
|
7abd59e09e | ||
|
|
cfcda81fca | ||
|
|
f2807143c6 | ||
|
|
a7f5ab76c7 | ||
|
|
925d51ab54 | ||
|
|
b204e905c6 | ||
|
|
1854e30538 | ||
|
|
edc49e85ad | ||
|
|
8a3bc8fc9b | ||
|
|
00b9dfcb95 | ||
|
|
9af1dae53e | ||
|
|
926fd21caf | ||
|
|
6d82e41dd1 | ||
|
|
b29f12bfad | ||
|
|
dcc95d0933 | ||
|
|
432c1b54bf | ||
|
|
993333a61c | ||
|
|
dbf14ccf13 | ||
|
|
f976905728 | ||
|
|
45ffb26910 | ||
|
|
eef3c01da7 | ||
|
|
f1993fb2f4 | ||
|
|
48225e0d80 | ||
|
|
f2a778d294 | ||
|
|
8472fcfff9 | ||
|
|
ab9382434f | ||
|
|
e5f7610b5d | ||
|
|
8b186dbe0e | ||
|
|
1c1a7150ae | ||
|
|
7c3fb111f2 | ||
|
|
6d6e7196f4 | ||
|
|
84329ad2ca | ||
|
|
de676bcaba | ||
|
|
910100f1c8 | ||
|
|
dea7e3db01 | ||
|
|
c047e48a47 | ||
|
|
bc821c7c20 | ||
|
|
77056a3119 | ||
|
|
7da955556d | ||
|
|
8166b37253 | ||
|
|
55fa514ec9 | ||
|
|
273aaaff12 | ||
|
|
95f3ac08d4 | ||
|
|
9794914838 | ||
|
|
fd97ad9b76 | ||
|
|
79933060e5 | ||
|
|
9ab5d2b5dd | ||
|
|
0b8cac68be | ||
|
|
3d3e6e1b5a | ||
|
|
0fc7e76ea1 | ||
|
|
e2465f979b | ||
|
|
d4fb5af456 | ||
|
|
5e99be0a32 | ||
|
|
3517c86fa2 | ||
|
|
0b2982caed | ||
|
|
9dba2a34f9 | ||
|
|
9cc04c929f | ||
|
|
5e4dd44155 | ||
|
|
61ce18a4ab | ||
|
|
e24ffebe69 | ||
|
|
761407f74d | ||
|
|
fad4723eae | ||
|
|
df90d631fb | ||
|
|
811ef01fc0 | ||
|
|
af610a1720 | ||
|
|
17753f1afd | ||
|
|
f38f3643f5 | ||
|
|
d66050522c | ||
|
|
1853350c7d | ||
|
|
dfc44e5b32 | ||
|
|
a3506f4d8e | ||
|
|
d337fb6c6a | ||
|
|
837aedb0c7 | ||
|
|
f80b5f9410 | ||
|
|
534c242d1b | ||
|
|
f6f7c99b9c | ||
|
|
de36f3d850 | ||
|
|
4660909e95 | ||
|
|
1bf333d320 | ||
|
|
be03c22dba | ||
|
|
ea77edce05 | ||
|
|
d52198d15e | ||
|
|
3d9b107761 | ||
|
|
37bc2d28ad | ||
|
|
e5363185a5 | ||
|
|
9890e26aeb | ||
|
|
a0a00b74e2 | ||
|
|
9615614e48 | ||
|
|
12d3a234c1 | ||
|
|
ab2f5579d8 | ||
|
|
1e7826f392 | ||
|
|
c66ca957d9 | ||
|
|
06799b13cf | ||
|
|
a7cd68121b | ||
|
|
69ac5c1ac7 | ||
|
|
4f643f8481 | ||
|
|
8c9dea988c | ||
|
|
043397c5d7 | ||
|
|
04fa597695 | ||
|
|
ac92834693 | ||
|
|
9380cf484a | ||
|
|
a198b91b87 | ||
|
|
0067a3ab7c | ||
|
|
7d451638a8 | ||
|
|
6744f8f052 | ||
|
|
bd942992ef | ||
|
|
843119303b | ||
|
|
05deb5ba05 | ||
|
|
ab0003f565 | ||
|
|
10ed0d117e | ||
|
|
6029593c43 | ||
|
|
d77c9b9551 | ||
|
|
47deaaf495 | ||
|
|
c3df9063c3 | ||
|
|
3bbfeebcbd | ||
|
|
4b5aee7d1c | ||
|
|
03a64af7f2 | ||
|
|
81ed1d6f35 | ||
|
|
1c8243e9b3 | ||
|
|
9f482d598e | ||
|
|
bb07746bd5 | ||
|
|
143197c5d2 | ||
|
|
72ae4b1500 | ||
|
|
54226b45b1 | ||
|
|
a75b94f143 | ||
|
|
68395d2745 | ||
|
|
0f373e6bb9 | ||
|
|
3f9ab0846d | ||
|
|
04779411f5 | ||
|
|
070913f327 | ||
|
|
499c6772d1 | ||
|
|
a6f6724752 | ||
|
|
b291853ade | ||
|
|
db4576c50b | ||
|
|
9adb4d0084 | ||
|
|
6df981b5b6 | ||
|
|
8d8cf5a2fd | ||
|
|
ed1268cf39 | ||
|
|
6aed16c146 | ||
|
|
3bd38171f8 | ||
|
|
d20762aa01 | ||
|
|
172ca761f2 | ||
|
|
b2316cdd00 | ||
|
|
1a5cd85900 | ||
|
|
a86863c032 | ||
|
|
8fc2dc4409 | ||
|
|
8c32d691c7 | ||
|
|
5f9994c9ed | ||
|
|
f34bcc5fd3 | ||
|
|
6694ac5077 | ||
|
|
08b9abed3a | ||
|
|
4c6a7a354d | ||
|
|
080efd1102 | ||
|
|
ff289a7177 | ||
|
|
b27348490d | ||
|
|
6a88eb603b | ||
|
|
7bd55aa2f1 | ||
|
|
412b50dac5 | ||
|
|
5c5dc6fffe | ||
|
|
2f07d21629 | ||
|
|
6997524a04 | ||
|
|
0dc1a8e037 | ||
|
|
f0eb0bc350 | ||
|
|
77a62b845a | ||
|
|
1d9aeef792 | ||
|
|
b58fd179f2 | ||
|
|
11ebdefd09 | ||
|
|
3174f37b41 | ||
|
|
cf50c1cb7b | ||
|
|
f83c1c5abf | ||
|
|
d90d6ed5d0 | ||
|
|
a808fb3b10 | ||
|
|
68a59fd26d | ||
|
|
78dea19ffb | ||
|
|
04a2fb16aa | ||
|
|
ad61673d6f | ||
|
|
a2551daf12 | ||
|
|
ea954b4338 | ||
|
|
08049d23b4 | ||
|
|
b74a3addc6 | ||
|
|
b22e3a67d8 | ||
|
|
8550c3e43f | ||
|
|
48117666fe | ||
|
|
02fca141a0 | ||
|
|
1a5dba9a79 | ||
|
|
ca2352921f | ||
|
|
f4c2bb1346 | ||
|
|
85fedf95e8 | ||
|
|
edf8e39bc1 | ||
|
|
9995a5899f | ||
|
|
64881a94e2 | ||
|
|
4c82f127b3 | ||
|
|
2cc47f651d | ||
|
|
b106c88630 | ||
|
|
a8005819c9 | ||
|
|
8e1a664a48 | ||
|
|
33b7046260 | ||
|
|
febc95dcdf | ||
|
|
f9bb1a7f22 | ||
|
|
af0f29e6b7 | ||
|
|
09fe3c6f5e | ||
|
|
3e895ae74a | ||
|
|
947903a4ac | ||
|
|
aff80d7331 | ||
|
|
5435df84bd | ||
|
|
4c2228a2da | ||
|
|
7b9bb5ba3d | ||
|
|
2928687acf | ||
|
|
388573800c | ||
|
|
cadc50ce9b | ||
|
|
18913db992 | ||
|
|
950f358982 | ||
|
|
b2c241e607 | ||
|
|
898def7f6c | ||
|
|
009ea0639f | ||
|
|
b2025597aa | ||
|
|
67a3c32373 | ||
|
|
3139343946 | ||
|
|
f6f75072ba | ||
|
|
c35f9f8d39 | ||
|
|
65c5bba189 | ||
|
|
7e10ebc848 | ||
|
|
e4ace5ac1b | ||
|
|
0ed47abe5a | ||
|
|
005addf0a5 | ||
|
|
74088ba438 | ||
|
|
b06c1daddb | ||
|
|
d2b7016dff | ||
|
|
6dec508c5e | ||
|
|
adde1cfee2 | ||
|
|
f6edb32a33 | ||
|
|
d9afef8fe1 | ||
|
|
ffa93377b4 | ||
|
|
091693308a | ||
|
|
ceaf32d304 | ||
|
|
f202e09b10 | ||
|
|
bf53d037b5 | ||
|
|
123a556ec8 | ||
|
|
4087161d2b | ||
|
|
dc7f0f1187 | ||
|
|
7ad1c7e817 | ||
|
|
84c50bf16c | ||
|
|
96aab86e45 | ||
|
|
a162b911b6 | ||
|
|
cc90e7b413 | ||
|
|
91f84f1a43 | ||
|
|
a0d6a72bc8 | ||
|
|
e03bde9109 | ||
|
|
e505a1b840 | ||
|
|
908449640a | ||
|
|
48915d7945 | ||
|
|
36c7089a03 | ||
|
|
fe40e8305d | ||
|
|
376c536dd1 | ||
|
|
b1e6662c11 | ||
|
|
a9c57e5147 | ||
|
|
97905f86be | ||
|
|
28b35178e9 | ||
|
|
57e951dbce | ||
|
|
a867fa669c | ||
|
|
6f870e980d | ||
|
|
76ce2c6653 | ||
|
|
f187753f8f | ||
|
|
6b5947392e | ||
|
|
7ea59b6d8e | ||
|
|
f3824d970b | ||
|
|
95780cb4a1 | ||
|
|
3e5eef1c0d | ||
|
|
2ed10aeb9b | ||
|
|
ea5daee505 | ||
|
|
9f8b21de4a | ||
|
|
a4cf9ba85b | ||
|
|
43225cfdcf | ||
|
|
46456516bb | ||
|
|
1d6e3fea85 | ||
|
|
6261aef314 | ||
|
|
909b812550 | ||
|
|
003724e400 | ||
|
|
7df786994d | ||
|
|
7399c7e70c | ||
|
|
0e8f95effd | ||
|
|
62ac5a9914 | ||
|
|
0234e4d293 | ||
|
|
cb40e850e9 | ||
|
|
04eb11bb5d | ||
|
|
18a5787a2c | ||
|
|
b2125bd6ee | ||
|
|
e0dc7fedf5 | ||
|
|
a0556689ea | ||
|
|
f4af4cc2b2 | ||
|
|
8c87fcdae3 | ||
|
|
16cd1f06b2 | ||
|
|
d09a347853 | ||
|
|
7a7b26e840 | ||
|
|
76e4e5897f | ||
|
|
bdf795b8b0 | ||
|
|
3e3cce4559 | ||
|
|
448546b0a4 | ||
|
|
e370d635bf | ||
|
|
2f596f739d | ||
|
|
27e0c2604c | ||
|
|
500ce50153 | ||
|
|
7f5feab5cf | ||
|
|
571d61de84 | ||
|
|
4fbd2deb37 | ||
|
|
a7c0e86bfd | ||
|
|
9f573481a8 | ||
|
|
18d2587800 | ||
|
|
a484124272 | ||
|
|
c3206d72cb | ||
|
|
abf79e4ab4 | ||
|
|
6a9a8f927e | ||
|
|
462c35cf75 | ||
|
|
46f1470e28 | ||
|
|
027ea64d48 | ||
|
|
db257e9f7f | ||
|
|
18a2dad684 | ||
|
|
0917b17efd | ||
|
|
9c76450f59 | ||
|
|
5c5dce5260 | ||
|
|
8742126e99 | ||
|
|
b587b58852 | ||
|
|
9a97bd3327 | ||
|
|
c22b790a36 | ||
|
|
1c9103a13e | ||
|
|
781de767ed | ||
|
|
6eba718680 | ||
|
|
e1362755d2 | ||
|
|
876a9e4f44 | ||
|
|
d17300fd84 | ||
|
|
9d1ad70bb7 | ||
|
|
8217d92ab3 | ||
|
|
e138f9b23c | ||
|
|
aa004fa842 | ||
|
|
c5480c2514 | ||
|
|
bbd7579aa8 | ||
|
|
811e23e3da | ||
|
|
859b619a0b | ||
|
|
110b5a2521 | ||
|
|
73914169e4 | ||
|
|
b50d072d82 | ||
|
|
046202fdda | ||
|
|
f1ab1835f1 | ||
|
|
0e416dc4f5 | ||
|
|
8e89802b2d | ||
|
|
073d9d3853 | ||
|
|
98db1d52c6 | ||
|
|
43e2bce6f8 | ||
|
|
1663a67959 | ||
|
|
33b270b81f | ||
|
|
fcae48d5a0 | ||
|
|
74056e768a | ||
|
|
ea13071308 | ||
|
|
cd0bf96c0e | ||
|
|
d31a091d12 | ||
|
|
1f386c570d | ||
|
|
1a984ac677 | ||
|
|
7bf5e5ba6d | ||
|
|
22bcb58716 | ||
|
|
ff7bcb5aae | ||
|
|
3b5ccf2efe | ||
|
|
a11651ae67 | ||
|
|
bfa55f31c0 | ||
|
|
8bf38443c2 | ||
|
|
4f0d928145 | ||
|
|
7e43574382 | ||
|
|
cd3900549c | ||
|
|
2fbd31f5e0 | ||
|
|
3c86043235 | ||
|
|
2498fa5a47 | ||
|
|
696c7e87f2 | ||
|
|
e96e28df07 | ||
|
|
a8b1dcf3c8 | ||
|
|
7b2bb73a12 | ||
|
|
d438af342c | ||
|
|
43862d30b9 | ||
|
|
4c4fb0c9be | ||
|
|
d8352bd632 | ||
|
|
30d1a85895 | ||
|
|
e1e8293a67 | ||
|
|
63b6f171f9 | ||
|
|
76bd97d510 | ||
|
|
2c6c287c4b | ||
|
|
115586a50f | ||
|
|
839ca28604 | ||
|
|
0070bc6666 | ||
|
|
6951b20aa0 | ||
|
|
8bdd5e7121 | ||
|
|
0c8aff98e0 | ||
|
|
a0c9f7bac8 | ||
|
|
5858f3a845 | ||
|
|
1ed40b77dc | ||
|
|
6fa8750fea | ||
|
|
ba26f3a73a | ||
|
|
627c5059f0 | ||
|
|
f54dc7affd | ||
|
|
20d75e4a8d | ||
|
|
cc28aae5cb | ||
|
|
3e3a0164bf | ||
|
|
5a9a31351a | ||
|
|
d57ef6a2a6 | ||
|
|
601cbd1231 | ||
|
|
849d3cfd0c | ||
|
|
ff8e85f2f5 | ||
|
|
7d80f8d25c | ||
|
|
37a10d1d30 | ||
|
|
a447efbe57 | ||
|
|
37fd675aac | ||
|
|
51c0639e6d | ||
|
|
18e38a3fe3 | ||
|
|
503a8a8243 | ||
|
|
287e8bafce | ||
|
|
4bfab5e222 | ||
|
|
fd7fa3116a | ||
|
|
889d07900a | ||
|
|
64b8d8c7bd | ||
|
|
9d63fada24 | ||
|
|
943a2a08f8 | ||
|
|
16622bbfad | ||
|
|
ae69d31095 | ||
|
|
97c50f86e9 | ||
|
|
285bc2511e | ||
|
|
2074d986a6 | ||
|
|
dd55d2eea3 | ||
|
|
1e76bff1bd | ||
|
|
ce185a3b19 | ||
|
|
d457542d96 | ||
|
|
318e435a8f | ||
|
|
15ef6df950 | ||
|
|
baf5f4f29c | ||
|
|
5f2a871637 | ||
|
|
fed75d8718 | ||
|
|
7a11219b61 | ||
|
|
2a1fcc0f06 | ||
|
|
22a08768f7 | ||
|
|
e7c11ed2cf | ||
|
|
facaaabc1e | ||
|
|
f8b01f5a43 | ||
|
|
035a12ce61 | ||
|
|
bf25746965 | ||
|
|
c3f3242f28 | ||
|
|
1b3864ebf8 | ||
|
|
9d6a41aa7a | ||
|
|
61f6acb5c9 | ||
|
|
72165a1926 | ||
|
|
ac076ee0af | ||
|
|
d84cb3be77 | ||
|
|
06b12c0a70 | ||
|
|
323b491962 | ||
|
|
788d75572b | ||
|
|
33091f95c2 | ||
|
|
ba68c42aae | ||
|
|
a7b469e83d | ||
|
|
92b6d3e2fa | ||
|
|
143e6f52af | ||
|
|
cbb2ce3708 | ||
|
|
2aa80f915d | ||
|
|
794ed304b1 | ||
|
|
afa7a5846b | ||
|
|
f0c3a0d2f8 | ||
|
|
2924b70fd7 | ||
|
|
481f9ba6d6 | ||
|
|
8e4ffea52b | ||
|
|
cc3c141f89 | ||
|
|
fb92300cfa | ||
|
|
78b81bac48 | ||
|
|
38fd361c68 | ||
|
|
aae096c6ae | ||
|
|
3079e18239 | ||
|
|
d957f3dd2d | ||
|
|
ced812660b | ||
|
|
255ff6cd06 | ||
|
|
b4d2433fc1 | ||
|
|
60f26ba501 | ||
|
|
5f0d5a302d | ||
|
|
b3dd0a68d5 | ||
|
|
7307ebd1f4 | ||
|
|
6ff457e391 | ||
|
|
6e86a47764 | ||
|
|
d86855f2f3 | ||
|
|
fe3ea8e7ec | ||
|
|
0c3bdd66ac | ||
|
|
87d9388a9c | ||
|
|
63dfe3669f | ||
|
|
ed7209f910 | ||
|
|
4c9131bd64 | ||
|
|
f1367b38a4 | ||
|
|
77c9334c50 | ||
|
|
e2b9c24856 | ||
|
|
aa25461e88 | ||
|
|
e864db1843 | ||
|
|
1aa1fada6a | ||
|
|
258071928f | ||
|
|
caac562b6b | ||
|
|
7e9998083f | ||
|
|
c8f3ef884b | ||
|
|
41bd2c815d | ||
|
|
9fbe135790 | ||
|
|
a5bfa5515c | ||
|
|
bc9efc31ad | ||
|
|
a8f523adae | ||
|
|
20c3d6644c | ||
|
|
a379e68cf4 | ||
|
|
c351b7848e | ||
|
|
e0ea37829b | ||
|
|
265838403e | ||
|
|
e1d3cafd80 | ||
|
|
96710d42f5 | ||
|
|
e38581c19f | ||
|
|
43ab814f30 | ||
|
|
3849b68b8f | ||
|
|
306eae6da3 | ||
|
|
bbb609c927 | ||
|
|
9eca268a49 | ||
|
|
d291ca0071 | ||
|
|
21c2af2b92 | ||
|
|
c3f0b5d4eb | ||
|
|
f64209e426 | ||
|
|
b163bb7650 | ||
|
|
c2224ed6b7 | ||
|
|
73a1496318 | ||
|
|
2406e20be2 | ||
|
|
80faa5feb1 | ||
|
|
d9e4f41a35 | ||
|
|
a2ec18680e | ||
|
|
570c51b0b0 | ||
|
|
f246336943 | ||
|
|
51d2b817ae | ||
|
|
bc64619f30 | ||
|
|
8139058fcc | ||
|
|
0bd2fca40b | ||
|
|
b6a2c38941 | ||
|
|
7e08fa2631 | ||
|
|
b72997fc2b | ||
|
|
37439b836b | ||
|
|
d4362ed357 | ||
|
|
2307495f28 | ||
|
|
18ec65e05f | ||
|
|
80d367fa08 | ||
|
|
5272ec85ea | ||
|
|
c560de4111 | ||
|
|
5b92387732 | ||
|
|
1ba2df79c6 | ||
|
|
06313cdddf | ||
|
|
a62d7495ca | ||
|
|
593d13ebdd | ||
|
|
e4023a6567 | ||
|
|
77d889beff | ||
|
|
ffef4bc474 | ||
|
|
1b448f57b9 | ||
|
|
0340d7bf37 | ||
|
|
d3a0ab8096 | ||
|
|
981976681a | ||
|
|
b4aeb93a18 | ||
|
|
f040c20688 | ||
|
|
648723fb83 | ||
|
|
06aee85398 | ||
|
|
3ad9df66ad | ||
|
|
e6c83b802f | ||
|
|
5dde6d3fac | ||
|
|
7ad6e03e5a | ||
|
|
a0fe49ede6 | ||
|
|
e5cc0640f6 | ||
|
|
f7020bdc10 | ||
|
|
32eb1c5705 | ||
|
|
611b9c88d1 | ||
|
|
2c352e6b82 | ||
|
|
68f0b105a9 | ||
|
|
a14e027ad4 | ||
|
|
f7a3bb82da | ||
|
|
b88724ed9e | ||
|
|
b38f9ed5e7 | ||
|
|
2a4c9bf3d3 | ||
|
|
889a153731 | ||
|
|
690bb7646a | ||
|
|
1c9c72937e | ||
|
|
e92d3867cf | ||
|
|
81397874eb | ||
|
|
72282a2239 | ||
|
|
58168336e1 | ||
|
|
38c4949360 | ||
|
|
7dcef58f15 | ||
|
|
1066a4504b | ||
|
|
56bb5f7a11 | ||
|
|
78b3d8487f | ||
|
|
021e2b58ca | ||
|
|
737fc6d198 | ||
|
|
71c90422ba | ||
|
|
6d620ba1f6 | ||
|
|
6b33d5af1e | ||
|
|
bd51cd332b | ||
|
|
0f50449196 | ||
|
|
509f38d3aa | ||
|
|
40d4949f06 | ||
|
|
7558e4bffe | ||
|
|
371100a97c | ||
|
|
a2ff632647 | ||
|
|
fdcc507f06 | ||
|
|
b93d33a93a | ||
|
|
db8fb39a38 | ||
|
|
59bafc8d02 | ||
|
|
45c97fde2d | ||
|
|
f8f794a803 | ||
|
|
63b55658ac | ||
|
|
e74ed0ba7b | ||
|
|
2e4dc6c253 | ||
|
|
a867d40eac | ||
|
|
d3b9f4d393 | ||
|
|
6d7a3a0cc9 | ||
|
|
b125dd3728 | ||
|
|
7936120afc | ||
|
|
dec1b10743 | ||
|
|
25d9001f88 | ||
|
|
38c6ba6c08 | ||
|
|
9152e76966 | ||
|
|
fb0dfee3eb | ||
|
|
69b44234a4 | ||
|
|
74281a16fd | ||
|
|
1a6ddfcaeb | ||
|
|
726e52aaa7 | ||
|
|
32eaca9970 | ||
|
|
c6787d7e9f | ||
|
|
c26835048c | ||
|
|
09e488a693 | ||
|
|
a01ed170f5 | ||
|
|
2a9653cd4e | ||
|
|
fa6fe618ac | ||
|
|
ce3fa533ae | ||
|
|
fedcf1db52 | ||
|
|
3754bf46ed | ||
|
|
9ebc997e9d | ||
|
|
5870d9dfc0 | ||
|
|
73185471df | ||
|
|
1d55514991 | ||
|
|
5b84e92b2e | ||
|
|
abbb3254b2 | ||
|
|
52c92a19e3 | ||
|
|
2122384ec1 | ||
|
|
77a2ff8917 | ||
|
|
9ed627091b | ||
|
|
fb8a85da01 | ||
|
|
e928c5fdaf | ||
|
|
485e324d36 | ||
|
|
255a43c98e | ||
|
|
927a7ee330 | ||
|
|
e1a347df90 | ||
|
|
deb14e0c85 | ||
|
|
9fa21628d7 | ||
|
|
d1a24db6b7 | ||
|
|
a3a045dbd4 | ||
|
|
e8530c36d3 | ||
|
|
57345476ab | ||
|
|
8987859044 | ||
|
|
1761f5af1a | ||
|
|
d9f255a6c0 | ||
|
|
c9711678fd | ||
|
|
181b12b3a8 | ||
|
|
72b088d85f | ||
|
|
6147498fd4 | ||
|
|
2fb3d94938 | ||
|
|
c230a94d55 | ||
|
|
2d994f6feb | ||
|
|
a19ea0f46f | ||
|
|
6e5f0869b3 | ||
|
|
5c012d79eb | ||
|
|
c5b204ea87 | ||
|
|
9627604ec3 | ||
|
|
f4995780e5 | ||
|
|
461b0ef738 | ||
|
|
e6d3e2e7d3 | ||
|
|
662ec1cd60 | ||
|
|
1057c4e4ba | ||
|
|
adf0bb69b8 | ||
|
|
5138b83afd | ||
|
|
6b53197dfc | ||
|
|
87f1060abc | ||
|
|
102c4cf261 | ||
|
|
6ea671ea0e | ||
|
|
9a34deb4ea | ||
|
|
cdb91f00ff | ||
|
|
f35c51f69c | ||
|
|
f1fb22202e | ||
|
|
a7249f3865 | ||
|
|
597f053ae3 | ||
|
|
84d09eb96d | ||
|
|
d395d7ac7d | ||
|
|
4742fc6657 | ||
|
|
76dd388b3c | ||
|
|
431b244f43 | ||
|
|
4bbade245c | ||
|
|
def8635b6d | ||
|
|
a6bdf686ae | ||
|
|
c775d65126 | ||
|
|
2f60d9cad4 | ||
|
|
e3e38ba68f | ||
|
|
506781f410 | ||
|
|
0273539f06 | ||
|
|
55af8bf26f | ||
|
|
1069cb3616 | ||
|
|
5e3e0e819f | ||
|
|
800891a475 | ||
|
|
fc684b0091 | ||
|
|
7aba9bc62a | ||
|
|
68be239a0e | ||
|
|
1f70fcfa2d | ||
|
|
9364a9c4c4 | ||
|
|
df79011aba | ||
|
|
d36e2cf6ab | ||
|
|
b07d61f3d9 | ||
|
|
05c9a9b530 | ||
|
|
9e69287740 | ||
|
|
16a810a0f6 | ||
|
|
8314759228 | ||
|
|
8b6a7e685e | ||
|
|
99f3e9ed77 | ||
|
|
33b6c7de5b | ||
|
|
36e714a7b2 | ||
|
|
ac008a4758 | ||
|
|
2b7376f6f3 | ||
|
|
1b2bf2c9b6 | ||
|
|
ceca0a659c | ||
|
|
13ee7a55c4 | ||
|
|
5d876ca0a3 | ||
|
|
7c15375f5d | ||
|
|
cfe1e4876a | ||
|
|
c8ccdbcb9a | ||
|
|
f2b1802666 | ||
|
|
55a052bcf6 | ||
|
|
ddf37ef059 | ||
|
|
4d80f52db4 | ||
|
|
9239c00866 | ||
|
|
a1d2124e45 | ||
|
|
e333716635 | ||
|
|
3d74bdf039 | ||
|
|
afc48782b7 | ||
|
|
a166fc887f | ||
|
|
fb0d76b94a | ||
|
|
e4ec0a9e0c | ||
|
|
8885a3b866 | ||
|
|
cfcce0e657 | ||
|
|
350b4d5e7d | ||
|
|
eac4dbcd28 | ||
|
|
4ee0cbb575 | ||
|
|
952d2f7513 | ||
|
|
18a6c98a82 | ||
|
|
2c1c1c7f16 | ||
|
|
d9e54ab7a4 | ||
|
|
c03f637f5b | ||
|
|
f39706cabd | ||
|
|
cbf5bf6735 | ||
|
|
346e09fed1 | ||
|
|
4707484a4c | ||
|
|
5cff72a42e | ||
|
|
68a5e0c51b | ||
|
|
02192f28cd | ||
|
|
cdc774549e | ||
|
|
492c2799dc | ||
|
|
296c616ce7 | ||
|
|
bdc85ec89b | ||
|
|
132f5f73f5 | ||
|
|
c95906cfcf | ||
|
|
9387585756 | ||
|
|
200111fef6 | ||
|
|
2444fb9cd6 | ||
|
|
20abb379aa | ||
|
|
c1f9595086 | ||
|
|
d5609d4997 | ||
|
|
4a85422ce0 | ||
|
|
56d22675bc | ||
|
|
f72db44bd7 | ||
|
|
815660c070 | ||
|
|
be76e3c554 | ||
|
|
914303a7c5 | ||
|
|
27a6787a77 | ||
|
|
0b30cb7f8f | ||
|
|
144d252e19 | ||
|
|
5de7ee3bdb | ||
|
|
a1e81a51ef | ||
|
|
6256025c73 | ||
|
|
8555c5b211 | ||
|
|
15c45b984d | ||
|
|
0a14d5ec46 | ||
|
|
41d5c40f10 | ||
|
|
4e907e2304 | ||
|
|
e204170eb6 | ||
|
|
a99c53f1ec | ||
|
|
d4dde01140 | ||
|
|
c465552df4 | ||
|
|
de47186263 | ||
|
|
3fcd531eac | ||
|
|
cf6e6488c7 | ||
|
|
46f1d1f39f | ||
|
|
9d7ad23d42 | ||
|
|
eab6c9c5f2 | ||
|
|
0d51383b57 | ||
|
|
5739ee6e15 | ||
|
|
437d4cda5d | ||
|
|
ba03d96961 | ||
|
|
ff9caf790b | ||
|
|
0506caf986 | ||
|
|
59f1a061f7 | ||
|
|
b95e9fe351 | ||
|
|
bac0eaab03 | ||
|
|
d76bb1ccf4 | ||
|
|
1659ddcc5d | ||
|
|
8bfbbac748 | ||
|
|
2915917680 | ||
|
|
45fb4d25ab | ||
|
|
92bd550851 | ||
|
|
54d20cb81c | ||
|
|
9e1f7cb71c | ||
|
|
f93cc52dcc | ||
|
|
372f7f3e88 | ||
|
|
e0861b9381 | ||
|
|
d8d6fe3574 | ||
|
|
2de10d4c56 | ||
|
|
7e60e0549a | ||
|
|
7e1719cfc7 | ||
|
|
3a7199834d | ||
|
|
f1b92e2569 | ||
|
|
a5d00ce717 | ||
|
|
83cc121b70 | ||
|
|
cd2e738e35 | ||
|
|
0887a0212c | ||
|
|
78aa658255 | ||
|
|
9abfdaaaa2 | ||
|
|
da191e4ac8 | ||
|
|
75de96ae6d | ||
|
|
ef4426a65c | ||
|
|
3ef568029f | ||
|
|
39ea126698 | ||
|
|
95011919d3 | ||
|
|
3c1b155e9f | ||
|
|
1e2fadbc02 | ||
|
|
f04f606b70 | ||
|
|
19e5dbddc6 | ||
|
|
f3103be15c | ||
|
|
700cedc573 | ||
|
|
7c47c6e3bd | ||
|
|
270ac2e8c1 | ||
|
|
9c351007f5 | ||
|
|
1817e6fbdf | ||
|
|
91b058cf11 | ||
|
|
53efc56b8a | ||
|
|
6f687c97ce | ||
|
|
be5b68627c | ||
|
|
dfac7448d1 | ||
|
|
4ea6f9d7eb | ||
|
|
d9a5e1cd48 | ||
|
|
65f19fde40 | ||
|
|
be41981ef0 | ||
|
|
0f53e646fd | ||
|
|
0a87fe76a3 | ||
|
|
030c487d6b | ||
|
|
51edddcaf6 | ||
|
|
cb1bc5d5ab | ||
|
|
9b43d9d75e | ||
|
|
c3787afa2e | ||
|
|
98dc4b4ca3 | ||
|
|
de91e169bc | ||
|
|
f4a69ba5a7 | ||
|
|
7143cac64f | ||
|
|
d581b7e2d7 | ||
|
|
8f7e113d79 | ||
|
|
6c55b40fe0 | ||
|
|
45aaa8c09d | ||
|
|
acd402187a | ||
|
|
e079d36f84 | ||
|
|
f14c496ce9 | ||
|
|
efd94c84de | ||
|
|
2c434e9b11 | ||
|
|
bf96ef08e0 | ||
|
|
1976aaf13e | ||
|
|
e30faf8c8c | ||
|
|
fb4e9b3938 | ||
|
|
f320c0a410 | ||
|
|
942792f123 | ||
|
|
3e0ffdce75 | ||
|
|
5f9479b39f | ||
|
|
d1bfe12bde | ||
|
|
5e702f6891 | ||
|
|
ecf3a3e070 | ||
|
|
ac6eef6922 | ||
|
|
3e1bef888a | ||
|
|
0920d6fce4 | ||
|
|
05250ba661 | ||
|
|
961ad07dba | ||
|
|
4f46fb9bf5 | ||
|
|
50e348b81c | ||
|
|
84b27585e6 | ||
|
|
62d449251c | ||
|
|
7a7530d57d | ||
|
|
7fb266671d | ||
|
|
addb4b5f8f | ||
|
|
d2ab7633ef | ||
|
|
ba1bd2d5a4 | ||
|
|
3eee0c43a7 | ||
|
|
8cfff40fcf | ||
|
|
0b34175752 | ||
|
|
e8a92cb313 | ||
|
|
06198c0028 | ||
|
|
8c33e07dc6 | ||
|
|
0847652df0 | ||
|
|
3d4664c2a6 | ||
|
|
e1b08ad76c | ||
|
|
fe50a0f3a1 | ||
|
|
e95665ceca | ||
|
|
a13d581658 | ||
|
|
6106d59e1a | ||
|
|
328dbd3930 | ||
|
|
a1bbeaa668 | ||
|
|
57ff3ff450 | ||
|
|
3b89e7d393 | ||
|
|
0f1640bed4 | ||
|
|
2c0980aa3a | ||
|
|
cf7e80f45d | ||
|
|
27faf12fde | ||
|
|
5d1b1573b7 | ||
|
|
308d8fe2a9 | ||
|
|
c56cbc21b1 | ||
|
|
5bfbf92e69 | ||
|
|
59fadabb5b | ||
|
|
51f52c8609 | ||
|
|
a7ed51c642 | ||
|
|
ddfe5b5f1c | ||
|
|
b2952cd42a | ||
|
|
ebb0187f40 | ||
|
|
c6bb32d419 | ||
|
|
6f67b8d9b9 | ||
|
|
5737139979 | ||
|
|
1a59fc11be | ||
|
|
df1ae565dc | ||
|
|
9387ed923c | ||
|
|
40a413c524 | ||
|
|
755763ec42 | ||
|
|
81cbb92556 | ||
|
|
129a88d5da | ||
|
|
d752586b32 | ||
|
|
1395f65872 | ||
|
|
c442913feb | ||
|
|
ba596af636 | ||
|
|
65a305c9ef | ||
|
|
d25cf1395b | ||
|
|
2e679ee2eb | ||
|
|
dbe3c8654e | ||
|
|
7754742459 | ||
|
|
d667acb308 | ||
|
|
a82cdf0add | ||
|
|
a85d17327b | ||
|
|
d239e99904 | ||
|
|
4e45abbf13 | ||
|
|
54bde6ac11 | ||
|
|
ed5b0ee36b | ||
|
|
3a8b68c0fd | ||
|
|
2b1c146940 | ||
|
|
84f0bb9a5d | ||
|
|
14e7f0bb13 | ||
|
|
73c19da4b9 | ||
|
|
1b6e77649a | ||
|
|
81b6a950ac | ||
|
|
f7ad6c20c7 | ||
|
|
c49fefc94d | ||
|
|
a046c4829c | ||
|
|
52d89eadde | ||
|
|
f148b5f734 | ||
|
|
19a9782a40 | ||
|
|
42038da7f1 | ||
|
|
bd158eefd2 | ||
|
|
df2c8b5f32 | ||
|
|
2f5fc731bb | ||
|
|
3eaae4661d | ||
|
|
e0afbcd4af | ||
|
|
74a17c7b7b | ||
|
|
5da63d399b | ||
|
|
856ba203d9 | ||
|
|
c049651784 | ||
|
|
5cbf325fda | ||
|
|
bf2dc90c3c | ||
|
|
964d97da17 | ||
|
|
5c190f82e4 | ||
|
|
f125709954 | ||
|
|
a3b0b8a7c5 | ||
|
|
4cc0d3dbc4 | ||
|
|
23127b8da0 | ||
|
|
46763e148b | ||
|
|
09c25faa51 | ||
|
|
c7b2f173eb | ||
|
|
cb419614cd | ||
|
|
4ad93ed6bb | ||
|
|
3208faf7ed | ||
|
|
77944175e2 | ||
|
|
281cf577d1 | ||
|
|
d51bb9acfb | ||
|
|
1b3038390a | ||
|
|
acea49beaf | ||
|
|
df5adb6ca5 | ||
|
|
93fc14d726 | ||
|
|
847df7b70c | ||
|
|
bbdbc59fd1 | ||
|
|
7b0009b38d | ||
|
|
78908e2496 | ||
|
|
b8d05d8751 | ||
|
|
0587256733 | ||
|
|
4474482307 | ||
|
|
f0d56e23a3 | ||
|
|
91db75a707 | ||
|
|
459f1aa130 | ||
|
|
eee5727426 | ||
|
|
7a3660cd6b | ||
|
|
34093d1208 | ||
|
|
bcec46c2aa | ||
|
|
97b194a454 | ||
|
|
7606d814fa | ||
|
|
57523d58df | ||
|
|
090d1e8a70 | ||
|
|
33c1c8f726 | ||
|
|
dea4ef957e | ||
|
|
2f54aff0ce | ||
|
|
8de35e1c83 | ||
|
|
7652a2bb95 | ||
|
|
9d8970a76b | ||
|
|
53dcb5d5ed | ||
|
|
4513edf450 | ||
|
|
9bebc9ba76 | ||
|
|
720ed0eddd | ||
|
|
d9e83cc4e2 | ||
|
|
33a63562cb | ||
|
|
88e7cab5b9 | ||
|
|
e050511ddc | ||
|
|
3479f7d986 | ||
|
|
4aca8d7fcc | ||
|
|
399c419163 | ||
|
|
82bdd01843 | ||
|
|
52cd5f9127 | ||
|
|
45c9496792 | ||
|
|
a7d4755859 | ||
|
|
92425642da | ||
|
|
0e4862b0c8 | ||
|
|
7713cfeb79 | ||
|
|
6e2290c4f0 | ||
|
|
35ef065d7b | ||
|
|
dae04e2752 | ||
|
|
4605bdad29 | ||
|
|
a17f3fb8be | ||
|
|
485075b8f2 | ||
|
|
e204e3277b | ||
|
|
db1227f279 | ||
|
|
77b7f95efb | ||
|
|
8475baba4e | ||
|
|
e20b06408c | ||
|
|
f08c7eedf1 | ||
|
|
75b4f1a442 | ||
|
|
0f2d771634 | ||
|
|
4d8430c687 | ||
|
|
cd54875f03 | ||
|
|
791148176c | ||
|
|
7736f8d018 | ||
|
|
eda77aeec8 | ||
|
|
379275e2d6 | ||
|
|
267416eced | ||
|
|
e89fd33229 | ||
|
|
7a4edb1cd8 | ||
|
|
0a2f854302 | ||
|
|
23ae0653bd | ||
|
|
60f04cff4d | ||
|
|
54c07e5e62 | ||
|
|
8fce82b412 | ||
|
|
18d724f7a1 | ||
|
|
d7373be553 | ||
|
|
4c39f36084 | ||
|
|
415f1dc25b | ||
|
|
293d1fca5c | ||
|
|
848054d140 | ||
|
|
f25adf3b12 | ||
|
|
9336d8ee02 | ||
|
|
a6b48f7366 | ||
|
|
c6fd6a0fbf | ||
|
|
60579485e5 | ||
|
|
5277d71913 | ||
|
|
0528af1700 | ||
|
|
349aa2f957 | ||
|
|
bee8e92f02 | ||
|
|
e411717de9 | ||
|
|
ac7fa8252b | ||
|
|
866c51acc5 | ||
|
|
a55964a622 | ||
|
|
5a02026f82 | ||
|
|
c0001fcb8c | ||
|
|
c1c0b59223 | ||
|
|
15e59654d9 | ||
|
|
e5a9c81412 | ||
|
|
55d471190a | ||
|
|
90065843a5 | ||
|
|
8623300d15 | ||
|
|
bbb438bd40 | ||
|
|
e5ec97495d | ||
|
|
893d9cde8d | ||
|
|
b6839289ec | ||
|
|
0fea3a7ea7 | ||
|
|
3c5e716d8f | ||
|
|
8edc3eb5fb | ||
|
|
e1cb6f4ae3 | ||
|
|
e7b9891335 | ||
|
|
e4b2949188 | ||
|
|
5f71232038 | ||
|
|
de48a697b0 | ||
|
|
f91d7beaa1 | ||
|
|
30b0911645 | ||
|
|
e6d003f8f2 | ||
|
|
297e63de0a | ||
|
|
8ae0f99a96 | ||
|
|
a29653b510 | ||
|
|
f38accb77b | ||
|
|
4e218be51d | ||
|
|
1021ffa1c3 | ||
|
|
1e869b86f2 | ||
|
|
af4469f073 | ||
|
|
df49b98c25 | ||
|
|
c9b6bb1229 | ||
|
|
5a900858d8 | ||
|
|
ce2e039e5f | ||
|
|
76c449c0c2 | ||
|
|
7d7318a3ea | ||
|
|
a030ce9348 | ||
|
|
d44f6651c4 | ||
|
|
cfc22577be | ||
|
|
47e46bf205 | ||
|
|
31ac4598ba | ||
|
|
d34515a5de | ||
|
|
e8eaa8920e | ||
|
|
e9448dc5e2 | ||
|
|
cd7efde6c0 | ||
|
|
61037ab7b8 | ||
|
|
3e4f663418 | ||
|
|
6581ba56ca | ||
|
|
2f349e0504 | ||
|
|
23b47b66ec | ||
|
|
23bf135b8a | ||
|
|
6c8b5ea38c | ||
|
|
4d040f3123 | ||
|
|
88121760e4 | ||
|
|
ae7a12200c | ||
|
|
d63aaf3bfd | ||
|
|
ff69b511e3 | ||
|
|
4054dec7a0 | ||
|
|
353f722dc5 | ||
|
|
83959f0e56 | ||
|
|
c657a1df2b | ||
|
|
7eb62ed32e | ||
|
|
e545ef563c | ||
|
|
0eeafcd157 | ||
|
|
f25d6224dd | ||
|
|
e37f055dad | ||
|
|
9301f81fc8 | ||
|
|
634e7cc34a | ||
|
|
e04c2dda2c | ||
|
|
d2181bdd94 | ||
|
|
5ac6244465 | ||
|
|
2957756275 | ||
|
|
b49b9b515e | ||
|
|
259dc75a30 | ||
|
|
ca8e52dc2c | ||
|
|
91ee48f3fb | ||
|
|
e2e6b940a3 | ||
|
|
c651e0ac82 | ||
|
|
430f53ca11 | ||
|
|
3186add87b | ||
|
|
7ecc56fa44 | ||
|
|
8cd77b2e27 | ||
|
|
365fdf4c37 | ||
|
|
4a188525ec | ||
|
|
2fe7b683cb | ||
|
|
77ef3240cd | ||
|
|
97e6e5e976 | ||
|
|
f5b4a6d3d7 | ||
|
|
63502ed976 | ||
|
|
bc30162a31 | ||
|
|
135d9ddf7a | ||
|
|
bf556c8678 | ||
|
|
6c01542fed | ||
|
|
8c1a933221 | ||
|
|
d9ecf3e4bf | ||
|
|
d2e20d86bb | ||
|
|
269a669af8 | ||
|
|
881f602f91 | ||
|
|
e0800b7c29 | ||
|
|
04aa74e5ad | ||
|
|
09226fd5d5 | ||
|
|
e7b12704de | ||
|
|
43add0b159 | ||
|
|
945ff09e27 | ||
|
|
78ee36a8c6 | ||
|
|
bee28a1061 | ||
|
|
10668bb249 | ||
|
|
56a06cbd33 | ||
|
|
bca5f804a8 | ||
|
|
09a1c9eed6 | ||
|
|
5adbe3c2d3 | ||
|
|
751e2b2359 | ||
|
|
a7342bd910 | ||
|
|
f2f2c281c0 | ||
|
|
d22384c7fb | ||
|
|
29b369c65e | ||
|
|
2d2fd968c8 | ||
|
|
882d0a5933 | ||
|
|
09d89fbfb3 | ||
|
|
41b4fa3b7f | ||
|
|
3fb6818bd8 | ||
|
|
df26c357d2 | ||
|
|
585545405d | ||
|
|
2058b492eb | ||
|
|
d91b9d1253 | ||
|
|
1634297685 | ||
|
|
16cbd441ce | ||
|
|
e6dd463ca3 | ||
|
|
1172c95817 | ||
|
|
0b33b798e4 | ||
|
|
4c41da2ea4 | ||
|
|
9b58b4c54d | ||
|
|
a8e0526d87 | ||
|
|
90fbf70bcc | ||
|
|
582b59044c | ||
|
|
df955b8104 | ||
|
|
e7d687ee11 | ||
|
|
0fd3d74fc4 | ||
|
|
9435950fc9 | ||
|
|
500e1c77de | ||
|
|
c6a3038f52 | ||
|
|
212d20ed08 | ||
|
|
bec86b1325 | ||
|
|
6335d81ceb | ||
|
|
7b9bd70d97 | ||
|
|
674898bd32 | ||
|
|
3787ac7b98 | ||
|
|
42dfda9231 | ||
|
|
fbe5cc44da | ||
|
|
1e84b2770c | ||
|
|
161dd1a3e6 | ||
|
|
36670fb5d9 | ||
|
|
180939a962 | ||
|
|
6e71f2f166 | ||
|
|
44ac2409ff | ||
|
|
6139239b86 | ||
|
|
9d09a67dea | ||
|
|
87b506972f | ||
|
|
c453969235 | ||
|
|
fdd362299f | ||
|
|
42a5d78e60 | ||
|
|
ddea4b9300 | ||
|
|
e8c0a0bcd3 | ||
|
|
1cf19133f4 | ||
|
|
29d9b6a46a | ||
|
|
93f9ff1b63 | ||
|
|
06b84b4086 | ||
|
|
bba7a38144 | ||
|
|
47a91c9d8e | ||
|
|
e598c769d4 | ||
|
|
f024cc40d3 | ||
|
|
ecca7164d9 | ||
|
|
d5a298bbb7 | ||
|
|
5efbdd25a7 | ||
|
|
ab27d2c720 | ||
|
|
c92e1d97d6 | ||
|
|
1bc26fd07a | ||
|
|
be4a9b5f4b | ||
|
|
9dafc2f3c8 | ||
|
|
a2d7f8a70d | ||
|
|
9cbf8c5f00 | ||
|
|
3312fd34f3 | ||
|
|
ee92e8dbf4 | ||
|
|
ec5d2d78dd | ||
|
|
20c21b42d5 | ||
|
|
36ef5c6bdf | ||
|
|
2dea362eda | ||
|
|
749463e4b7 | ||
|
|
a0a14a1078 | ||
|
|
4cdcf00ddc | ||
|
|
0631fc937a | ||
|
|
02148a1df2 | ||
|
|
a93bc74eff | ||
|
|
ccc9239751 | ||
|
|
86592c3ba1 | ||
|
|
81f849811f | ||
|
|
3e6209def2 | ||
|
|
b2328cdf4f | ||
|
|
634bf2b15c | ||
|
|
007cc94474 | ||
|
|
f09af888b1 | ||
|
|
2e3b8cdba7 | ||
|
|
f6db784a85 | ||
|
|
47874a4527 | ||
|
|
2efa1c164f | ||
|
|
483cba453a | ||
|
|
d6b9397579 | ||
|
|
9a22ce69bd | ||
|
|
4f3376e2a1 | ||
|
|
e73dac8d91 | ||
|
|
539343b20d | ||
|
|
7be9f0067e | ||
|
|
64fb8e28ec | ||
|
|
c35fe2c386 | ||
|
|
d1c3eabb87 | ||
|
|
899de8b27c | ||
|
|
cde1b2b56c | ||
|
|
5f4c209fca | ||
|
|
4fedf1e564 | ||
|
|
5b4d8d69ef | ||
|
|
fc29564974 | ||
|
|
867b736b84 | ||
|
|
7f4b90c68f | ||
|
|
f99d1c3829 | ||
|
|
59a576ef3e | ||
|
|
81997cba8a | ||
|
|
57fcca9696 | ||
|
|
29f7c5071b | ||
|
|
62bcb3d766 | ||
|
|
2bcce33f23 | ||
|
|
f2520c11e7 | ||
|
|
c924e4d519 | ||
|
|
d442b31f84 | ||
|
|
df8a27fba6 | ||
|
|
05128d21a8 | ||
|
|
faf19eda86 | ||
|
|
d07c69809d | ||
|
|
da03c36875 | ||
|
|
0ac0ca74b5 | ||
|
|
d69ddd2ac3 | ||
|
|
1a544be828 | ||
|
|
bfccb2e96a | ||
|
|
7bb02d0cc6 | ||
|
|
f220e0f6ca | ||
|
|
83644ce5d8 | ||
|
|
550f9fc891 | ||
|
|
c7167c83cd | ||
|
|
6b4094fd92 | ||
|
|
88f2ad1eae | ||
|
|
90ee82ac43 | ||
|
|
db0475f9c3 | ||
|
|
4af25ec315 | ||
|
|
0ba8d13de9 | ||
|
|
f7c74e551f | ||
|
|
5bf4c5869b | ||
|
|
9ec9a7b124 | ||
|
|
cc3f65d069 | ||
|
|
c83da7cadb | ||
|
|
7c91c77fd9 | ||
|
|
40abdd2608 | ||
|
|
c89a32224c | ||
|
|
d65a06947d | ||
|
|
eb3783dc00 | ||
|
|
c648ec7c0c | ||
|
|
c7ba85c2e6 | ||
|
|
b536d50194 | ||
|
|
f41de38498 | ||
|
|
c96acd6ca0 | ||
|
|
2796d3d8a0 | ||
|
|
636bd5acb5 | ||
|
|
1a9787ac76 | ||
|
|
879b513822 | ||
|
|
4fad7a462c | ||
|
|
f3b1161640 | ||
|
|
c4031761fe | ||
|
|
34f04668c1 | ||
|
|
52f4187129 | ||
|
|
f508324fc8 | ||
|
|
a1fe3850e2 | ||
|
|
fff8ced3b0 | ||
|
|
67e66a6c4a | ||
|
|
5bae5a6a35 | ||
|
|
61ced5e926 | ||
|
|
28184201e4 | ||
|
|
a893f70e49 | ||
|
|
6990f6af25 | ||
|
|
c501fd0a70 | ||
|
|
abf10aec98 | ||
|
|
6b279f297c | ||
|
|
e8b9d88eb6 | ||
|
|
a46b7bcd6d | ||
|
|
951a19fb00 | ||
|
|
be34dc463b | ||
|
|
9bcc5d2eed | ||
|
|
728ab0ff21 | ||
|
|
b56a1f0603 | ||
|
|
deb0b7ad67 | ||
|
|
44d67389d2 | ||
|
|
aa2cb937b1 | ||
|
|
ff819386e1 | ||
|
|
49dcc561b7 | ||
|
|
2816b96650 | ||
|
|
f57bd6b616 | ||
|
|
418e7adac1 | ||
|
|
2034527faa | ||
|
|
412f5d68de | ||
|
|
2846f9454f | ||
|
|
739acaa475 | ||
|
|
97e48080e8 | ||
|
|
5b00eaa42d | ||
|
|
9639ffb140 | ||
|
|
586cbc750c | ||
|
|
b5ee4f17cb | ||
|
|
6866f6389d | ||
|
|
d2cac1d8fd | ||
|
|
aa54fd2251 | ||
|
|
f5fb129483 | ||
|
|
a707aeb3d0 | ||
|
|
f8bb6a3e06 | ||
|
|
91b4c9668c | ||
|
|
d457d43999 | ||
|
|
ffb53a6df5 | ||
|
|
82590657fb | ||
|
|
54303880d3 | ||
|
|
cbabc295c7 | ||
|
|
b8aaf744e8 | ||
|
|
64f04845b6 | ||
|
|
684cb54992 | ||
|
|
f6c09160ab | ||
|
|
221950cdc4 | ||
|
|
6e6c0757d6 | ||
|
|
2ee99bde29 | ||
|
|
d5f704009f | ||
|
|
3938418ad5 | ||
|
|
401748e9a7 | ||
|
|
bc2ae3e88d | ||
|
|
7b8e665323 | ||
|
|
df249c7c03 | ||
|
|
5c20311768 | ||
|
|
d0506a6435 | ||
|
|
c8960ab628 | ||
|
|
537596001e | ||
|
|
d8c053573a | ||
|
|
2b69e7830d | ||
|
|
e3cb5d26c0 | ||
|
|
84156879f6 | ||
|
|
d12e03e50d | ||
|
|
cd0534efcc | ||
|
|
505648fb66 | ||
|
|
857eb5ff69 | ||
|
|
3fe39a3e1b | ||
|
|
a5e670b402 | ||
|
|
e8c1abc509 | ||
|
|
6594679e52 | ||
|
|
c1897fbc48 | ||
|
|
aeabe1800b | ||
|
|
d64751687b | ||
|
|
3499f1b85c | ||
|
|
f3d500085c | ||
|
|
aa8731d0fc | ||
|
|
cbd2b265bb | ||
|
|
321bc336ea | ||
|
|
4459679c64 | ||
|
|
628b06927c | ||
|
|
12317b1c53 | ||
|
|
d1a3a2d000 | ||
|
|
cfa6a3e3d3 | ||
|
|
c224c66978 | ||
|
|
929bbe3058 | ||
|
|
8796ecb2a9 | ||
|
|
54512a66ef | ||
|
|
c40a4d77f8 | ||
|
|
d69ef4380b | ||
|
|
8371003c05 | ||
|
|
19d4e1435c | ||
|
|
4a80c47fd1 | ||
|
|
d038bcedb0 | ||
|
|
c396ad4daa | ||
|
|
cff8498b42 | ||
|
|
fdf6121b6e | ||
|
|
907a61152c | ||
|
|
e2b3907df5 | ||
|
|
4be3f053ca | ||
|
|
83baa6ee2e | ||
|
|
cebf99b5d8 | ||
|
|
acbf13e648 | ||
|
|
2f0775fa1b | ||
|
|
940bfbee96 | ||
|
|
e250c56829 | ||
|
|
49c9258a08 | ||
|
|
dd83cb1b95 | ||
|
|
2396f35586 | ||
|
|
68771a7861 | ||
|
|
e1356fb80e | ||
|
|
c80d8f432a | ||
|
|
122c916356 | ||
|
|
9f29128205 | ||
|
|
b384ca8fd2 | ||
|
|
a0b92fe0b1 | ||
|
|
328a9ffafd | ||
|
|
d40054b9d2 | ||
|
|
4c0e586354 | ||
|
|
3541f7bfce | ||
|
|
3a2443b5fa | ||
|
|
e488ce0d07 | ||
|
|
521e497ba3 | ||
|
|
c9ee678a52 | ||
|
|
078e25e383 | ||
|
|
a3b0f75289 | ||
|
|
66939bdcf6 | ||
|
|
184a6005a6 | ||
|
|
161c06fd4e | ||
|
|
5d7317ef77 | ||
|
|
aae14dd9fe | ||
|
|
30e3e434ab | ||
|
|
33645e45fd | ||
|
|
1ef148317d | ||
|
|
1b9af9d2d8 | ||
|
|
27d46ed06f | ||
|
|
02563019fc | ||
|
|
8c9119b471 | ||
|
|
2d02c3f2a4 | ||
|
|
a3e9d04383 | ||
|
|
7f851ad8d9 | ||
|
|
a1c684f67c | ||
|
|
f347e5934a | ||
|
|
e033df6a2f | ||
|
|
b254bdfea3 | ||
|
|
70a0346b0a | ||
|
|
7e23304187 | ||
|
|
926bf07df1 | ||
|
|
6e85280467 | ||
|
|
80ed1c3e14 | ||
|
|
1ae3fb4d2f | ||
|
|
3f2542fcbc | ||
|
|
f6278da23f | ||
|
|
a3ac05cc16 | ||
|
|
a97bb10877 | ||
|
|
bd4dd8403b | ||
|
|
52f0ed5310 | ||
|
|
f4c7edf551 | ||
|
|
f8db7f1709 | ||
|
|
72c273aaed | ||
|
|
70b9bd9c0e | ||
|
|
ea5ac1efb5 | ||
|
|
a83de241e4 | ||
|
|
f5a44e4fc4 | ||
|
|
1d141cd406 | ||
|
|
82797e768f | ||
|
|
9176064047 | ||
|
|
bc4c469797 | ||
|
|
aad10ceee3 | ||
|
|
58ceda4b90 | ||
|
|
f36bc80ad1 | ||
|
|
2b4d821d30 | ||
|
|
8a940eb0c1 | ||
|
|
9c2f21b07e | ||
|
|
055f3fd1fd | ||
|
|
40843566d0 | ||
|
|
e13045b599 | ||
|
|
7d2d0235a0 | ||
|
|
bff0a09537 | ||
|
|
c1c2717bc9 | ||
|
|
fc2970f41b | ||
|
|
66415d48d4 | ||
|
|
d54b1dade3 | ||
|
|
1bf475fa1a | ||
|
|
099bbc5c7f | ||
|
|
6e3336cb30 | ||
|
|
eb6c7f8595 | ||
|
|
10a706851a | ||
|
|
8d4515935a | ||
|
|
9474cb1792 | ||
|
|
10d9db72a8 | ||
|
|
cf9331919f | ||
|
|
7a22aaa111 | ||
|
|
f1629c907a | ||
|
|
e6f1912443 | ||
|
|
16b34e11ca | ||
|
|
256fc2e78c | ||
|
|
da0af489a2 | ||
|
|
8d2e0bfd62 | ||
|
|
2f82122fc4 | ||
|
|
889929f782 | ||
|
|
fa1e9dd70d | ||
|
|
29a5e4fba1 | ||
|
|
a20f502159 | ||
|
|
8bcfe4a6aa | ||
|
|
854bb0056b | ||
|
|
90ed4c665b | ||
|
|
d1bf388b0e | ||
|
|
6feb68b18d | ||
|
|
09621b3ef1 | ||
|
|
f73f0b1653 | ||
|
|
f7f56f5eda | ||
|
|
c8806a16a1 | ||
|
|
4013701bdb | ||
|
|
4c823f12e3 | ||
|
|
1e58cd70ad | ||
|
|
bea4ad8eff | ||
|
|
d7957bd791 | ||
|
|
425ec53b28 | ||
|
|
797dc8a4da | ||
|
|
d12a2a5888 | ||
|
|
845e27542a | ||
|
|
c67b253099 | ||
|
|
154fff7d02 | ||
|
|
82fd6e6fb3 | ||
|
|
b3938a86c3 | ||
|
|
2f8ed7ed19 | ||
|
|
af36635769 | ||
|
|
495728f502 | ||
|
|
5dccd01fb7 | ||
|
|
5fcab1eee8 | ||
|
|
b60d7ad42f | ||
|
|
fa1f9bcdbd | ||
|
|
53abfdbcbf | ||
|
|
3519cebf66 | ||
|
|
a7246ba1ec | ||
|
|
60b47b6eec | ||
|
|
ca2880537d | ||
|
|
13274964a9 | ||
|
|
235a10ab86 | ||
|
|
5faebad863 | ||
|
|
90a9052377 | ||
|
|
d3de398395 | ||
|
|
83b88e7916 | ||
|
|
3faa2d0eb9 | ||
|
|
fab19ae3a7 | ||
|
|
e94dfdeff2 | ||
|
|
9713dc8d94 | ||
|
|
b748ed3435 | ||
|
|
7c7f7b9ece | ||
|
|
785cd2a640 | ||
|
|
c475729c13 | ||
|
|
989ab646a9 | ||
|
|
7461b5dc02 | ||
|
|
135487b2c9 | ||
|
|
b25f28d1ad | ||
|
|
cee8f3349e | ||
|
|
9559cb988e | ||
|
|
db34cb1b75 | ||
|
|
c9b0b4c7a4 | ||
|
|
c3fd894a6c | ||
|
|
9f2d397e1f | ||
|
|
7719d8fbea | ||
|
|
3883d18b8a | ||
|
|
2b3f2e5fa8 | ||
|
|
5ae554bdff | ||
|
|
6ac7dcf5e9 | ||
|
|
6da97fafa8 | ||
|
|
6d4fe94285 | ||
|
|
b27f3b8f2c | ||
|
|
ed29232478 | ||
|
|
3c0d184097 | ||
|
|
d846114d3c | ||
|
|
aabeece4c0 | ||
|
|
b614964ba9 | ||
|
|
888ea58df2 | ||
|
|
d0ccfa1925 | ||
|
|
41945138ac | ||
|
|
ca054799d0 | ||
|
|
b37f34ff5b | ||
|
|
a75420f75f | ||
|
|
7daa5bc338 | ||
|
|
4eaaec9d1a | ||
|
|
bc6a10353b | ||
|
|
f82c4346b6 | ||
|
|
53499e01de | ||
|
|
bdda620397 | ||
|
|
2409261cb7 | ||
|
|
b5a806dec7 | ||
|
|
4628024de6 | ||
|
|
f04873b0b0 | ||
|
|
5853b9904c | ||
|
|
5d5074ac9c | ||
|
|
84ef588163 | ||
|
|
d1cda3991c | ||
|
|
24aa596e3c | ||
|
|
3798f94d4c | ||
|
|
75dcc369c0 | ||
|
|
e1f89e3ad3 | ||
|
|
7e7c82cf4a | ||
|
|
71dd038664 | ||
|
|
55041878ae | ||
|
|
0dd274917f | ||
|
|
f3beaa3374 | ||
|
|
6d01653bfe | ||
|
|
455838648d | ||
|
|
3c7981160c | ||
|
|
4ac1ac7ef5 | ||
|
|
776fc56265 | ||
|
|
a8d56b2850 | ||
|
|
11059e532b | ||
|
|
da1fea6582 | ||
|
|
3315f994b6 | ||
|
|
560aea876e | ||
|
|
b24d359a27 | ||
|
|
90744ff5ab | ||
|
|
b48bf035f6 | ||
|
|
c13c11cfa1 | ||
|
|
6e615998c0 | ||
|
|
94afb7cb1d | ||
|
|
bfef3cf497 | ||
|
|
cba156dfff | ||
|
|
64db1f6736 | ||
|
|
a47a25ca88 | ||
|
|
88efa4065b | ||
|
|
f15e5e9d57 | ||
|
|
2ccdb67e4d | ||
|
|
1b8943ac54 | ||
|
|
9382b38c41 | ||
|
|
22fcf7b4dc | ||
|
|
20fc3b7978 | ||
|
|
9325880fe5 | ||
|
|
cac0e37b06 | ||
|
|
2c8e8d8ef6 | ||
|
|
6fbdd6bee9 | ||
|
|
e89fa44680 | ||
|
|
a9fbad0741 | ||
|
|
8cc48cf4b0 | ||
|
|
10ee23622a | ||
|
|
904e1647e1 | ||
|
|
caec345c0b | ||
|
|
18a53f4467 | ||
|
|
6dfde99cbe | ||
|
|
21418e2988 | ||
|
|
4475110df8 | ||
|
|
0ea44b0143 | ||
|
|
3327ebf2b1 | ||
|
|
26a2395aeb | ||
|
|
9d518b9d29 | ||
|
|
6ebb9017c7 | ||
|
|
a88464de3a | ||
|
|
fd7af587da | ||
|
|
84918ad424 | ||
|
|
699c0d6bc3 | ||
|
|
2537b8cb0c | ||
|
|
78883663a0 | ||
|
|
b00406a7eb | ||
|
|
4d56e3b36e | ||
|
|
8e9a3e8fc8 | ||
|
|
1ffda29fd2 | ||
|
|
024aa3ab6b | ||
|
|
20abf67779 | ||
|
|
fb3a53b8af | ||
|
|
4c9295fe2d | ||
|
|
6a7163d3a9 | ||
|
|
de23f3928d | ||
|
|
8975e38b1d | ||
|
|
20a132651f | ||
|
|
88ba7e467d | ||
|
|
df7ceb4ccb | ||
|
|
47bb8ad0d4 | ||
|
|
304d15e236 | ||
|
|
d1c45cf3f8 | ||
|
|
04f28ed9bc | ||
|
|
ce84f74528 | ||
|
|
762604300f | ||
|
|
433fd2a7c3 | ||
|
|
814cc20c6b | ||
|
|
f4a532ef6d | ||
|
|
6b5983339d | ||
|
|
ae1b28aab7 | ||
|
|
09b77d9f14 | ||
|
|
5c39ebd0a0 | ||
|
|
e2a00c03d6 | ||
|
|
66d18575a7 | ||
|
|
9e4fc00a0f | ||
|
|
70f3ff0461 | ||
|
|
e7054adc49 | ||
|
|
28787a001c | ||
|
|
525550e4c7 | ||
|
|
6860491189 | ||
|
|
b37b5c3d90 | ||
|
|
9c5b94adf5 | ||
|
|
65f539e9d8 | ||
|
|
d65c1eea7a | ||
|
|
8a030e7fc0 | ||
|
|
a3144cb2f0 | ||
|
|
baa942ff98 | ||
|
|
32c2ce146e | ||
|
|
4b277afc52 | ||
|
|
5479c67178 | ||
|
|
80dbba1280 | ||
|
|
aa39f2160b | ||
|
|
a2567bea64 | ||
|
|
d1b52809ac | ||
|
|
d06777b8ce | ||
|
|
7a6476c9ba | ||
|
|
e4f185f357 | ||
|
|
df085a6f15 | ||
|
|
c648d973c1 | ||
|
|
ec8fb5f308 | ||
|
|
b83487a70d | ||
|
|
dbe8f727cb | ||
|
|
91c70a0e9c | ||
|
|
37c5b68987 | ||
|
|
e861f05b75 | ||
|
|
552c93abf0 | ||
|
|
b7c1d55491 | ||
|
|
9876d126ca | ||
|
|
9547d47ae2 | ||
|
|
5fca17d7e1 | ||
|
|
416517b0c9 | ||
|
|
9d8ea2f13b | ||
|
|
88fa7fc24c | ||
|
|
53ee636fa0 | ||
|
|
873f5dbe6b | ||
|
|
db520a09ee | ||
|
|
866908d2ca | ||
|
|
377d59abe7 | ||
|
|
d9e7d64f33 | ||
|
|
1b90ec58b9 | ||
|
|
d923bab828 | ||
|
|
48728e2d66 | ||
|
|
e529a4c261 | ||
|
|
eff5cc0568 | ||
|
|
c6d6dbfdb1 | ||
|
|
8f214aec89 | ||
|
|
abc6b9459a | ||
|
|
d804372d74 | ||
|
|
018e270336 | ||
|
|
2a728ee68f | ||
|
|
3d4f62081e | ||
|
|
ef0fcb0e0f | ||
|
|
f8b8b9ac63 | ||
|
|
2a6b542b09 | ||
|
|
c3064dfd2b | ||
|
|
cd4466a626 | ||
|
|
e5a61667dd | ||
|
|
2496aa8e3f | ||
|
|
004993583b | ||
|
|
443fd8f7dd | ||
|
|
b2fb28453f | ||
|
|
fc98cf0037 | ||
|
|
6db75bc244 | ||
|
|
d6ca562b03 | ||
|
|
3dbd83e35a | ||
|
|
8eeabd2372 | ||
|
|
ed9cb4219d | ||
|
|
ef92fd775c | ||
|
|
abaeab89aa | ||
|
|
243bcb2368 | ||
|
|
86f2693040 | ||
|
|
b6d1c5b17a | ||
|
|
039dfc302c | ||
|
|
56fd714de2 | ||
|
|
e51ac2c973 | ||
|
|
cadde3ab6d | ||
|
|
9987e64e8c | ||
|
|
98647b490c | ||
|
|
32118cc1cb | ||
|
|
63f41cf1c6 | ||
|
|
e5aed098b5 | ||
|
|
5e6e625694 | ||
|
|
a95454d338 | ||
|
|
ad75048678 | ||
|
|
402c761a23 | ||
|
|
66f9ece061 | ||
|
|
27b8617077 | ||
|
|
2ab989e274 | ||
|
|
5a11ca86bb | ||
|
|
25e6d6a7bf | ||
|
|
eb1040ddb7 | ||
|
|
a68445692b | ||
|
|
48935d2932 | ||
|
|
83ed0b38c1 | ||
|
|
90670e7401 | ||
|
|
a105e5664a | ||
|
|
b8442d536a | ||
|
|
6688a2c112 | ||
|
|
33cfeaf9b0 | ||
|
|
f487dac047 | ||
|
|
690eb2a52b | ||
|
|
20b52fcef9 | ||
|
|
0ac5e5035c | ||
|
|
c6b9c8eca0 | ||
|
|
ecbb77c17f | ||
|
|
bb8acc61db | ||
|
|
90cabd7c21 | ||
|
|
c6d2233978 | ||
|
|
6d5aca4f32 | ||
|
|
248ef5a0ea | ||
|
|
560acb7cea | ||
|
|
5fefa9e97c | ||
|
|
1c5f8070e5 | ||
|
|
506907ddc9 | ||
|
|
84f0f451a0 | ||
|
|
fa466a54cd | ||
|
|
3c668c2f8e | ||
|
|
779278ed50 | ||
|
|
96f70118ca | ||
|
|
4e62b62add | ||
|
|
9cfbe98a23 | ||
|
|
31a7e9feed | ||
|
|
20ad8a379d | ||
|
|
8f17b81329 | ||
|
|
76a93fabc7 | ||
|
|
98eed4f2ed | ||
|
|
2195ae59d6 | ||
|
|
4f88857442 | ||
|
|
01d53c0160 | ||
|
|
d98cd6f135 | ||
|
|
dc567f99d6 | ||
|
|
ffd7034c00 | ||
|
|
43c25c8a32 | ||
|
|
a71deeda94 | ||
|
|
89b4f45fe3 | ||
|
|
9835312033 | ||
|
|
1ff0d0f1fa | ||
|
|
1a73159200 | ||
|
|
c417877eb8 | ||
|
|
9ec4368c6f | ||
|
|
3f44d51355 | ||
|
|
95bd9e8e0b | ||
|
|
bc92503c92 | ||
|
|
5ba106d96b | ||
|
|
fc5764f9df | ||
|
|
342f3f450b | ||
|
|
0c6b5e01fb | ||
|
|
6507a26cc1 | ||
|
|
e72c6a0d94 | ||
|
|
834a0ed620 | ||
|
|
1af962899d | ||
|
|
11e787c884 | ||
|
|
1c19856d26 | ||
|
|
d73ba71ec6 | ||
|
|
dc07037edf | ||
|
|
21622ac313 | ||
|
|
ce190a7485 | ||
|
|
cf4c3642ce | ||
|
|
021fa1ca1a | ||
|
|
3a542bce62 | ||
|
|
c5e6a34f25 | ||
|
|
1537389617 | ||
|
|
b07d29b1af | ||
|
|
b2796f99b6 | ||
|
|
bbb05b5286 | ||
|
|
60f89c8c01 | ||
|
|
8513a5e2d6 | ||
|
|
69f8738d00 | ||
|
|
c32507252e | ||
|
|
2e2f084f66 | ||
|
|
e1c0c6af7d | ||
|
|
86de88ed48 | ||
|
|
1042f9847a | ||
|
|
a2964afd42 | ||
|
|
539b5627fd | ||
|
|
cbd10309f5 | ||
|
|
362a40db6f | ||
|
|
861a7834fc | ||
|
|
307ade6251 | ||
|
|
0b5354f13d | ||
|
|
707c5668a5 | ||
|
|
0277cd82ea | ||
|
|
9cea5cd442 | ||
|
|
a6fc743d85 | ||
|
|
fa968996ed | ||
|
|
4cd45b6535 | ||
|
|
2af9ffa7f2 | ||
|
|
39197458f4 | ||
|
|
35bbe12065 | ||
|
|
9add86144c | ||
|
|
03c8d65d07 | ||
|
|
75e6acd6ed | ||
|
|
95b4189d69 | ||
|
|
22dd91fc21 | ||
|
|
700370ac5c | ||
|
|
05de60a7fe | ||
|
|
cc41cdbf22 | ||
|
|
c05af1b63c | ||
|
|
33db37a915 | ||
|
|
e398c37526 | ||
|
|
655672c957 | ||
|
|
2282f4bd37 | ||
|
|
ce845ab092 | ||
|
|
b5b6458f12 | ||
|
|
56e13c8919 | ||
|
|
23d467eb0d | ||
|
|
c741b67c3c | ||
|
|
5a5741878c | ||
|
|
4463d58470 | ||
|
|
f0bbc75038 | ||
|
|
7c53dcb0af | ||
|
|
fda8f7e305 | ||
|
|
52b212db64 | ||
|
|
931d24b5a8 | ||
|
|
18dfa56752 | ||
|
|
26ab108890 | ||
|
|
1cc174c007 | ||
|
|
e26f563f4b | ||
|
|
ebd0a1722d | ||
|
|
f81c49ce6d | ||
|
|
ded2d3c293 | ||
|
|
2f7181e236 | ||
|
|
2275a1539e | ||
|
|
f2266ea9f4 | ||
|
|
82ff878e38 | ||
|
|
7200bc3fba | ||
|
|
a48c0ad868 | ||
|
|
e4cc5c479f | ||
|
|
014c18ead2 | ||
|
|
3bd873f3c6 | ||
|
|
6c4f424887 | ||
|
|
04257d8ecc | ||
|
|
b69f5afaaf | ||
|
|
5db883906a | ||
|
|
703924d6c4 | ||
|
|
330b8cf8a1 | ||
|
|
6e778ad710 | ||
|
|
f44e3dc319 | ||
|
|
d8b2d39f2f | ||
|
|
7c7ca1cb90 | ||
|
|
1058e5fb72 | ||
|
|
b2a9b87be3 | ||
|
|
3f9f29ba4e | ||
|
|
390db9503f | ||
|
|
3448f86263 | ||
|
|
3252654ed3 | ||
|
|
29745bb4ec | ||
|
|
641e3fdf7a | ||
|
|
2f76eaf358 | ||
|
|
0e4ef33d6a | ||
|
|
18c73ceb90 | ||
|
|
8431b54b21 | ||
|
|
5fc357ee10 | ||
|
|
de33ec4250 | ||
|
|
a9f7e9fb7a | ||
|
|
aa335d8485 | ||
|
|
82f7798f48 | ||
|
|
ce80bbe24c | ||
|
|
da195d0272 | ||
|
|
4eae02b723 | ||
|
|
081b21fe82 | ||
|
|
ed053d240e | ||
|
|
0ca3157a8b | ||
|
|
25447329a0 | ||
|
|
4934456751 | ||
|
|
0f4dcaa403 | ||
|
|
4b560880fd | ||
|
|
dc9fed4a5f | ||
|
|
88a24da272 | ||
|
|
e4655c9b07 | ||
|
|
1495c93083 | ||
|
|
21c6855705 | ||
|
|
a7d6dc9d3a | ||
|
|
ed7207d4c8 | ||
|
|
bb9235c715 | ||
|
|
45d12dbc83 | ||
|
|
189835b963 | ||
|
|
3163cbdf8a | ||
|
|
1e6f9f9fe2 | ||
|
|
3091869115 | ||
|
|
9e85376a2d | ||
|
|
a379c19e9a | ||
|
|
2bd4008cb2 | ||
|
|
d21ae4edd3 | ||
|
|
1da008b3af | ||
|
|
703458f365 | ||
|
|
4b0a4c936a | ||
|
|
216094a761 | ||
|
|
4efd8b96e5 | ||
|
|
b61f43835d | ||
|
|
017a94adc1 | ||
|
|
b20bea8492 | ||
|
|
54694dd3a4 | ||
|
|
8dd9b5c6fb | ||
|
|
16a50fbe4e | ||
|
|
32897ce769 | ||
|
|
51f074ba4b | ||
|
|
0ba804d051 | ||
|
|
611a594a46 | ||
|
|
8a7fe3f1d6 | ||
|
|
054484ad73 | ||
|
|
ac3e061508 | ||
|
|
ddf86d6342 | ||
|
|
ba29a2ffe4 | ||
|
|
b33e47a49e | ||
|
|
298e8b2332 | ||
|
|
78f8ba1226 | ||
|
|
17e03559dc | ||
|
|
2825206d37 | ||
|
|
cd20d5b5c5 | ||
|
|
ebf6dad3f6 | ||
|
|
683406b57d | ||
|
|
406dfe21f8 | ||
|
|
346d381ab8 | ||
|
|
d7980fa0b6 | ||
|
|
fc7b9846ae | ||
|
|
15e695a9bd | ||
|
|
110fbd3f06 | ||
|
|
f0428be91e | ||
|
|
0b03c6c786 | ||
|
|
150a497cb4 | ||
|
|
3d666ea68e | ||
|
|
ee733210ca | ||
|
|
86342efa7a | ||
|
|
05967442c3 | ||
|
|
d6b587678e | ||
|
|
668d42447f | ||
|
|
32c9b5f415 | ||
|
|
f42ce8fc2a | ||
|
|
6b142d716f | ||
|
|
26a7af85ea | ||
|
|
69b0767165 | ||
|
|
f862b4d0f0 | ||
|
|
a88bfa8ded | ||
|
|
fffd47e3d8 | ||
|
|
7a3c3c4ddf | ||
|
|
eafccb445c | ||
|
|
b040cbffdd | ||
|
|
153434561d | ||
|
|
36b2ed172c | ||
|
|
58d70b2079 | ||
|
|
e0e0bad7c1 | ||
|
|
0e9e6b3443 | ||
|
|
9199fd5964 | ||
|
|
8f9b5095b5 | ||
|
|
5b996920f2 | ||
|
|
bcec070ad7 | ||
|
|
c3d7411668 | ||
|
|
997c426228 | ||
|
|
7a52334c9f | ||
|
|
111f018c85 | ||
|
|
64da877161 | ||
|
|
f0e6a9e0e3 | ||
|
|
a373e48939 | ||
|
|
f2cd4fdafe | ||
|
|
9991c892ac | ||
|
|
8e7512161a | ||
|
|
5e09913e3d | ||
|
|
cceb00c406 | ||
|
|
585b8332ad | ||
|
|
066f324060 | ||
|
|
8e1e20bf0d | ||
|
|
0ac592ad40 | ||
|
|
17269c88be | ||
|
|
8204107315 | ||
|
|
9e7d367b5c | ||
|
|
12b9257c6d | ||
|
|
37f698d9c1 | ||
|
|
e7c17df844 | ||
|
|
28ec8b5bc2 | ||
|
|
200b8e48bf | ||
|
|
2a8ad9e35b | ||
|
|
be8ad0f022 | ||
|
|
a77efc3949 | ||
|
|
418ca00305 | ||
|
|
03f02294d1 | ||
|
|
0a7a1290e3 | ||
|
|
28f73ecb3d | ||
|
|
6ab7f93ce7 | ||
|
|
d1511a1085 | ||
|
|
0775ac081a | ||
|
|
646a9d12b2 | ||
|
|
e7be742c58 | ||
|
|
8d002a8f28 | ||
|
|
af3eea3805 | ||
|
|
4dc0631a4b | ||
|
|
a3415e52c0 | ||
|
|
1b337fe5e1 | ||
|
|
50350a09cd | ||
|
|
1bf8d8cff3 | ||
|
|
62d50f512d | ||
|
|
8c64be3cfd | ||
|
|
cc0a733f1f | ||
|
|
1b645d64c8 | ||
|
|
a374df7622 | ||
|
|
cbf710a4f8 | ||
|
|
f05818a86e | ||
|
|
cab748588c | ||
|
|
63ad95a474 | ||
|
|
e9da4d8505 | ||
|
|
26a2292f6d | ||
|
|
5fb14e769b | ||
|
|
c7c7a1c2aa | ||
|
|
1242263d25 | ||
|
|
31c598f88a | ||
|
|
6cb4830534 | ||
|
|
067267f4cf | ||
|
|
99db53417c | ||
|
|
737c07c5b6 | ||
|
|
097cdcb57a | ||
|
|
175591e524 | ||
|
|
e7ddd81251 | ||
|
|
a183162d8b | ||
|
|
a6bb7595e8 | ||
|
|
210d468a9b | ||
|
|
5f8fcebb88 | ||
|
|
f23f659ac5 | ||
|
|
99eeb2e605 | ||
|
|
f26171082c | ||
|
|
2acd2542ac | ||
|
|
f26c40082d | ||
|
|
b3dbb81838 | ||
|
|
5e5ef21f61 | ||
|
|
be4a4180ae | ||
|
|
f7322358cf | ||
|
|
671b98ecad | ||
|
|
ed04f7f39d | ||
|
|
cbb187e9b9 | ||
|
|
03cdfe8cae | ||
|
|
37f8139432 | ||
|
|
79891671e9 | ||
|
|
65489c894d | ||
|
|
b36a1d3260 | ||
|
|
8a1d02e185 | ||
|
|
8c2ff2f46e | ||
|
|
e492d47621 | ||
|
|
98baae9456 | ||
|
|
e3cf6188a1 | ||
|
|
8cf8ab089e | ||
|
|
ed1d450099 | ||
|
|
41494f28da | ||
|
|
19b1a6c638 | ||
|
|
471bd4d889 | ||
|
|
084efc98d7 | ||
|
|
1d2ef5c2ce | ||
|
|
fd45ebd0e9 | ||
|
|
258d4bd6ae | ||
|
|
b8aa727edf | ||
|
|
eac01960a7 | ||
|
|
a5bd4e329a | ||
|
|
5ce665f279 | ||
|
|
9aac080414 | ||
|
|
8b639b5026 | ||
|
|
7f119a28e7 | ||
|
|
5f88c4aad9 | ||
|
|
dfe3d78767 | ||
|
|
633996216a | ||
|
|
09b302abf7 | ||
|
|
c92f233c15 | ||
|
|
751157b4ea | ||
|
|
5f62a9e4d8 | ||
|
|
a8855bf795 | ||
|
|
c22b00b303 | ||
|
|
67c5115b41 | ||
|
|
ab4b1cc8fe | ||
|
|
716785c65f | ||
|
|
baa7fd6c79 | ||
|
|
9045f796e0 | ||
|
|
988c1744af | ||
|
|
cd6d276119 | ||
|
|
d085a2bd3e | ||
|
|
dddccf8f1a | ||
|
|
8b3fb3d6d5 | ||
|
|
80b450d4e6 | ||
|
|
0bc71403ff | ||
|
|
cb6b3e17a9 | ||
|
|
e7157faddd | ||
|
|
a33d408780 | ||
|
|
42474b7144 | ||
|
|
933564591d | ||
|
|
599e18b920 | ||
|
|
547d65b065 | ||
|
|
e4e8a611be | ||
|
|
2b190e5638 | ||
|
|
acab56793f | ||
|
|
2c976bdd24 | ||
|
|
3aee8d2b2a | ||
|
|
841c379797 | ||
|
|
b6a12044ba | ||
|
|
8e087cb639 | ||
|
|
bcb5913291 | ||
|
|
be53c0885d | ||
|
|
91047830fd | ||
|
|
6e0655b3b7 | ||
|
|
edc0d7f2c7 | ||
|
|
1d18e0a11a | ||
|
|
b167fb071a | ||
|
|
3b9899dfd4 | ||
|
|
f94d46316e | ||
|
|
569a547b3f | ||
|
|
6c306c0013 | ||
|
|
9b050523e9 | ||
|
|
f9a92c2879 | ||
|
|
ab194c7d75 | ||
|
|
904a9c5dc7 | ||
|
|
38243c52fd | ||
|
|
c8c48156dd | ||
|
|
f4d18034d9 | ||
|
|
17c11b2afa | ||
|
|
68904296e7 | ||
|
|
d4499338e0 | ||
|
|
6174a5dd55 | ||
|
|
e26bbc7de8 | ||
|
|
62c1ff776e | ||
|
|
baea06eac7 | ||
|
|
6ac73f7cde | ||
|
|
66619204ba | ||
|
|
1d7fb2ffac | ||
|
|
c42c5a1f85 | ||
|
|
5b62ad876e | ||
|
|
ec460ab9c9 | ||
|
|
2eb6513251 | ||
|
|
c449e39280 | ||
|
|
1c57a4ac35 | ||
|
|
334ac8b10c | ||
|
|
d801dec6aa | ||
|
|
08aedc18e1 | ||
|
|
e4bdb92521 | ||
|
|
11f7ab61b9 | ||
|
|
df9bfb6c2e | ||
|
|
ab9506df48 | ||
|
|
136ef077b2 | ||
|
|
e8a8f416f3 | ||
|
|
8c76f45030 | ||
|
|
96f550c6aa | ||
|
|
37ef5c38f0 | ||
|
|
66a273b31b | ||
|
|
52e24c3a25 | ||
|
|
7a2d917c66 | ||
|
|
025350ebff | ||
|
|
411e035005 | ||
|
|
800997437a | ||
|
|
75d5ff69ef | ||
|
|
a241c2af0d | ||
|
|
d1729a624d | ||
|
|
e51a720193 | ||
|
|
ff1d36434d | ||
|
|
904ae5af91 | ||
|
|
42e8e1c16a | ||
|
|
9fb493d2f4 | ||
|
|
031157f215 | ||
|
|
c65d217d1e | ||
|
|
0a13f7e1c7 | ||
|
|
173375de7c | ||
|
|
27d81bb68c | ||
|
|
044105e8e0 | ||
|
|
48f8a62335 | ||
|
|
71f99ba79c | ||
|
|
95492958f9 | ||
|
|
661c8251c5 | ||
|
|
83067c1edc | ||
|
|
c5ed004c9e | ||
|
|
04b51a982e | ||
|
|
e810597eec | ||
|
|
692d6afbd9 | ||
|
|
59fa02e11a | ||
|
|
6ef6a24841 | ||
|
|
eba55c2783 | ||
|
|
085aa3084e | ||
|
|
de2d04f06b | ||
|
|
12654cb810 | ||
|
|
4b15873ee1 | ||
|
|
748fe94603 | ||
|
|
86a5dfa62e | ||
|
|
0b4800835c | ||
|
|
5caeca7509 | ||
|
|
7ff61f12e9 | ||
|
|
ae35649366 | ||
|
|
a01b34a004 | ||
|
|
02b9da8aba | ||
|
|
ed0c7a6aaf | ||
|
|
25cb935eee | ||
|
|
c74d766275 | ||
|
|
37985310d5 | ||
|
|
c3b4a4dde1 | ||
|
|
d7262c0b4e | ||
|
|
870966dcd0 | ||
|
|
85beb3b6a9 | ||
|
|
bf69b055eb | ||
|
|
31c7189b8b | ||
|
|
eaf3fd80c5 | ||
|
|
1059586226 | ||
|
|
b610e8c7e6 | ||
|
|
e632720c02 | ||
|
|
1f042f5e32 | ||
|
|
54b63e89f8 | ||
|
|
3f65c31883 | ||
|
|
31ab32f0b9 | ||
|
|
bc5c91f681 | ||
|
|
076ef0407b | ||
|
|
b0150d548a | ||
|
|
60acbc97ab | ||
|
|
dd47bd04cd | ||
|
|
da57396d07 | ||
|
|
d3a3765819 | ||
|
|
f90676cfc5 | ||
|
|
ad2289c34c | ||
|
|
ca77dbe8da | ||
|
|
6c6efd7214 | ||
|
|
7f099d41fa | ||
|
|
60109aaa1f | ||
|
|
ef057c16cb | ||
|
|
39e728a7c2 | ||
|
|
28f0c00281 | ||
|
|
bc78316aa5 | ||
|
|
b8a6c55b10 | ||
|
|
6df1dd1ef2 | ||
|
|
c8638ce82f | ||
|
|
1a61d89bcc | ||
|
|
eb0b0350e0 | ||
|
|
4ec7fcd836 | ||
|
|
f6a66cd3de | ||
|
|
871019c8b9 | ||
|
|
581907305a | ||
|
|
54b0fbca59 | ||
|
|
1e44f93c31 | ||
|
|
3eca80217c | ||
|
|
6f01d7f8ea | ||
|
|
500d16620b | ||
|
|
6550e1fa99 | ||
|
|
80ad37ad93 | ||
|
|
3287cdd47a | ||
|
|
12e86ee4bd | ||
|
|
97d0f93d3c | ||
|
|
861f10dca6 | ||
|
|
2a1385f94b | ||
|
|
e9af6b393f | ||
|
|
2124661cee | ||
|
|
e8a08011be | ||
|
|
691cec7956 | ||
|
|
241d947564 | ||
|
|
880834b902 | ||
|
|
f435384bf0 | ||
|
|
3149c12a14 | ||
|
|
6a9a2e7f88 | ||
|
|
5b87393a95 | ||
|
|
5a27b10579 | ||
|
|
a80e49bd81 | ||
|
|
ffed13b979 | ||
|
|
9f0f1096e1 | ||
|
|
9a42afe0be | ||
|
|
b6616d7a13 | ||
|
|
7be378aaa9 | ||
|
|
734a9d5d87 | ||
|
|
ce6b869f84 | ||
|
|
dc5f1b2878 | ||
|
|
a041b8bf72 | ||
|
|
4fa12ffda0 | ||
|
|
5dcf28cafb | ||
|
|
365a408df5 | ||
|
|
9e988783de | ||
|
|
bba8e61409 | ||
|
|
dee9b84322 | ||
|
|
ad98d61939 | ||
|
|
14758dbe10 | ||
|
|
d89a7d5235 | ||
|
|
640423c362 | ||
|
|
fd9c02603c | ||
|
|
44289e4c58 | ||
|
|
6928c685a8 | ||
|
|
dd408aa5d6 | ||
|
|
dac88c6aed | ||
|
|
78fe5a46c1 | ||
|
|
7a96d3c9ae | ||
|
|
b7b1e66c6e | ||
|
|
5ed7771148 | ||
|
|
c2076d86a4 | ||
|
|
b37c5e4878 | ||
|
|
26a5800a7f | ||
|
|
01efebc42f | ||
|
|
ab117527c9 | ||
|
|
f20f5cebbe | ||
|
|
0c3a8ddfb9 | ||
|
|
669a6cf119 | ||
|
|
6fe7b13e37 | ||
|
|
9c180e587b | ||
|
|
a368646745 | ||
|
|
de2cc58b0c | ||
|
|
d803d86f4d | ||
|
|
5254059fe4 | ||
|
|
d706571e6f | ||
|
|
907baea8b2 | ||
|
|
062536438e | ||
|
|
4ff035537b | ||
|
|
466a3b87fc | ||
|
|
b947f3c2a5 | ||
|
|
069da224bc | ||
|
|
e82460bde6 | ||
|
|
61c037f2cf | ||
|
|
f98290ba6e | ||
|
|
73343b3387 | ||
|
|
3a6020dcd7 | ||
|
|
596a269dfd | ||
|
|
7329fce87c | ||
|
|
4059116787 | ||
|
|
1561322af2 | ||
|
|
44d0a6f2b8 | ||
|
|
60b99469b9 | ||
|
|
46b975a491 | ||
|
|
70ad909b16 | ||
|
|
2af3ce3ecc | ||
|
|
132a4da7cf | ||
|
|
73f5bff9c5 | ||
|
|
223f0cd4d3 | ||
|
|
c4cb098d14 | ||
|
|
2bc74882e9 | ||
|
|
2ba388074e | ||
|
|
33164ac78e | ||
|
|
86624411c6 | ||
|
|
5cdae17d19 | ||
|
|
bd4a23beeb | ||
|
|
5c2682e2c9 | ||
|
|
6382a4cd04 | ||
|
|
704121c197 | ||
|
|
9c7696a8ce | ||
|
|
9e7e051eb4 | ||
|
|
616fe08bce | ||
|
|
141c454187 | ||
|
|
17fce00a5e | ||
|
|
0b8d04d75e | ||
|
|
e5487441ba | ||
|
|
48d83715a5 | ||
|
|
8b4fea4b71 | ||
|
|
4c1f0c3c59 | ||
|
|
13ae339a2e | ||
|
|
73a03565e5 | ||
|
|
bf20f3b7d8 | ||
|
|
20dabd9c41 | ||
|
|
32df73c056 | ||
|
|
ef1885c38b | ||
|
|
f5351e60e7 | ||
|
|
bfec9d974b | ||
|
|
3a7553eef6 | ||
|
|
d0521d33ce | ||
|
|
9155598ca4 | ||
|
|
ea6b94fd0c | ||
|
|
2e896462c1 | ||
|
|
e63377980e | ||
|
|
41f97a73c9 | ||
|
|
45b83cc544 | ||
|
|
b3e028e853 | ||
|
|
13255b370c | ||
|
|
e1edf36307 | ||
|
|
4ce278a06e | ||
|
|
1c503f39b2 | ||
|
|
2d34c0f52d | ||
|
|
f3cfe147b5 | ||
|
|
df43b1f533 | ||
|
|
cb4d6efb29 | ||
|
|
f1cddfdc62 | ||
|
|
6fb96183c0 | ||
|
|
a5c83b66df | ||
|
|
89283ef486 | ||
|
|
2c200873c1 | ||
|
|
ff1fa17dc3 | ||
|
|
08e6d8a780 | ||
|
|
c4105436eb | ||
|
|
95299d94c4 | ||
|
|
543b19b376 | ||
|
|
b73426b91f | ||
|
|
52ff391c8a | ||
|
|
344a0a094f | ||
|
|
2710226326 | ||
|
|
381b0d3d07 | ||
|
|
52523bcd8b | ||
|
|
0d13e2cb2e | ||
|
|
014881e550 | ||
|
|
67b82638db | ||
|
|
09f18d07b0 | ||
|
|
9ef874e979 | ||
|
|
0aa73d5b35 | ||
|
|
ad2fa61765 | ||
|
|
e8106f3792 | ||
|
|
db3b974479 | ||
|
|
d62a4d3566 | ||
|
|
1b25b5f590 | ||
|
|
03add90c94 | ||
|
|
0f2e277f80 | ||
|
|
8664e7f7d3 | ||
|
|
cb37f43277 | ||
|
|
2a535b72ff | ||
|
|
cd2336887c |
@@ -1,6 +1,7 @@
|
|||||||
[run]
|
[run]
|
||||||
omit =
|
omit =
|
||||||
scripts/*
|
scripts/*
|
||||||
|
freqtrade/templates/*
|
||||||
freqtrade/vendor/*
|
freqtrade/vendor/*
|
||||||
freqtrade/__main__.py
|
freqtrade/__main__.py
|
||||||
tests/*
|
tests/*
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
version: 1
|
|
||||||
|
|
||||||
update_configs:
|
|
||||||
- package_manager: "python"
|
|
||||||
directory: "/"
|
|
||||||
update_schedule: "weekly"
|
|
||||||
allowed_updates:
|
|
||||||
- match:
|
|
||||||
update_type: "all"
|
|
||||||
target_branch: "develop"
|
|
||||||
|
|
||||||
- package_manager: "docker"
|
|
||||||
directory: "/"
|
|
||||||
update_schedule: "daily"
|
|
||||||
allowed_updates:
|
|
||||||
- match:
|
|
||||||
update_type: "all"
|
|
||||||
18
.devcontainer/Dockerfile
Normal file
18
.devcontainer/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
FROM freqtradeorg/freqtrade:develop
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
COPY requirements-dev.txt /freqtrade/
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get -y install git sudo vim \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& pip install autopep8 -r docs/requirements-docs.txt -r requirements-dev.txt --no-cache-dir \
|
||||||
|
&& useradd -u 1000 -U -m ftuser \
|
||||||
|
&& mkdir -p /home/ftuser/.vscode-server /home/ftuser/.vscode-server-insiders /home/ftuser/commandhistory \
|
||||||
|
&& echo "export PROMPT_COMMAND='history -a'" >> /home/ftuser/.bashrc \
|
||||||
|
&& echo "export HISTFILE=~/commandhistory/.bash_history" >> /home/ftuser/.bashrc \
|
||||||
|
&& chown ftuser: -R /home/ftuser/
|
||||||
|
|
||||||
|
USER ftuser
|
||||||
|
|
||||||
|
# Empty the ENTRYPOINT to allow all commands
|
||||||
|
ENTRYPOINT []
|
||||||
44
.devcontainer/devcontainer.json
Normal file
44
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
"name": "freqtrade Develop",
|
||||||
|
|
||||||
|
"dockerComposeFile": [
|
||||||
|
"docker-compose.yml"
|
||||||
|
],
|
||||||
|
|
||||||
|
"service": "ft_vscode",
|
||||||
|
|
||||||
|
"workspaceFolder": "/freqtrade/",
|
||||||
|
|
||||||
|
"settings": {
|
||||||
|
"terminal.integrated.shell.linux": "/bin/bash",
|
||||||
|
"editor.insertSpaces": true,
|
||||||
|
"files.trimTrailingWhitespace": true,
|
||||||
|
"[markdown]": {
|
||||||
|
"files.trimTrailingWhitespace": false,
|
||||||
|
},
|
||||||
|
"python.pythonPath": "/usr/local/bin/python",
|
||||||
|
},
|
||||||
|
|
||||||
|
// Add the IDs of extensions you want installed when the container is created.
|
||||||
|
"extensions": [
|
||||||
|
"ms-python.python",
|
||||||
|
"ms-python.vscode-pylance",
|
||||||
|
"davidanson.vscode-markdownlint",
|
||||||
|
"ms-azuretools.vscode-docker",
|
||||||
|
],
|
||||||
|
|
||||||
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
|
// "forwardPorts": [],
|
||||||
|
|
||||||
|
// Uncomment the next line if you want start specific services in your Docker Compose config.
|
||||||
|
// "runServices": [],
|
||||||
|
|
||||||
|
// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
|
||||||
|
// "shutdownAction": "none",
|
||||||
|
|
||||||
|
// Uncomment the next line to run commands after the container is created - for example installing curl.
|
||||||
|
// "postCreateCommand": "sudo apt-get update && apt-get install -y git",
|
||||||
|
|
||||||
|
// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
|
||||||
|
"remoteUser": "ftuser"
|
||||||
|
}
|
||||||
24
.devcontainer/docker-compose.yml
Normal file
24
.devcontainer/docker-compose.yml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
ft_vscode:
|
||||||
|
build:
|
||||||
|
context: ..
|
||||||
|
dockerfile: ".devcontainer/Dockerfile"
|
||||||
|
volumes:
|
||||||
|
# Allow git usage within container
|
||||||
|
- "/home/${USER}/.ssh:/home/ftuser/.ssh:ro"
|
||||||
|
- "/home/${USER}/.gitconfig:/home/ftuser/.gitconfig:ro"
|
||||||
|
- ..:/freqtrade:cached
|
||||||
|
# Persist bash-history
|
||||||
|
- freqtrade-vscode-server:/home/ftuser/.vscode-server
|
||||||
|
- freqtrade-bashhistory:/home/ftuser/commandhistory
|
||||||
|
# Expose API port
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:8080:8080"
|
||||||
|
command: /bin/sh -c "while sleep 1000; do :; done"
|
||||||
|
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
freqtrade-vscode-server:
|
||||||
|
freqtrade-bashhistory:
|
||||||
@@ -13,3 +13,4 @@ CONTRIBUTING.md
|
|||||||
MANIFEST.in
|
MANIFEST.in
|
||||||
README.md
|
README.md
|
||||||
freqtrade.service
|
freqtrade.service
|
||||||
|
user_data
|
||||||
|
|||||||
33
.github/ISSUE_TEMPLATE.md
vendored
33
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,33 +0,0 @@
|
|||||||
## Step 1: Have you search for this issue before posting it?
|
|
||||||
|
|
||||||
If you have discovered a bug in the bot, please [search our issue tracker](https://github.com/freqtrade/freqtrade/issues?q=is%3Aissue).
|
|
||||||
If it hasn't been reported, please create a new issue.
|
|
||||||
|
|
||||||
## Step 2: Describe your environment
|
|
||||||
|
|
||||||
* Operating system: ____
|
|
||||||
* Python Version: _____ (`python -V`)
|
|
||||||
* CCXT version: _____ (`pip freeze | grep ccxt`)
|
|
||||||
* Branch: Master | Develop
|
|
||||||
* Last Commit ID: _____ (`git log --format="%H" -n 1`)
|
|
||||||
|
|
||||||
## Step 3: Describe the problem:
|
|
||||||
|
|
||||||
*Explain the problem you have encountered*
|
|
||||||
|
|
||||||
### Steps to reproduce:
|
|
||||||
|
|
||||||
1. _____
|
|
||||||
2. _____
|
|
||||||
3. _____
|
|
||||||
|
|
||||||
### Observed Results:
|
|
||||||
|
|
||||||
* What happened?
|
|
||||||
* What did you expect to happen?
|
|
||||||
|
|
||||||
### Relevant code exceptions or logs:
|
|
||||||
|
|
||||||
```
|
|
||||||
// paste your log here
|
|
||||||
```
|
|
||||||
48
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
48
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: "Triage Needed"
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
<!--
|
||||||
|
Have you searched for similar issues before posting it?
|
||||||
|
|
||||||
|
If you have discovered a bug in the bot, please [search our issue tracker](https://github.com/freqtrade/freqtrade/issues?q=is%3Aissue).
|
||||||
|
If it hasn't been reported, please create a new issue.
|
||||||
|
|
||||||
|
Please do not use bug reports to request new features.
|
||||||
|
-->
|
||||||
|
|
||||||
|
## Describe your environment
|
||||||
|
|
||||||
|
* Operating system: ____
|
||||||
|
* Python Version: _____ (`python -V`)
|
||||||
|
* CCXT version: _____ (`pip freeze | grep ccxt`)
|
||||||
|
* Freqtrade Version: ____ (`freqtrade -V` or `docker-compose run --rm freqtrade -V` for Freqtrade running in docker)
|
||||||
|
|
||||||
|
Note: All issues other than enhancement requests will be closed without further comment if the above template is deleted or not filled out.
|
||||||
|
|
||||||
|
## Describe the problem:
|
||||||
|
|
||||||
|
*Explain the problem you have encountered*
|
||||||
|
|
||||||
|
### Steps to reproduce:
|
||||||
|
|
||||||
|
1. _____
|
||||||
|
2. _____
|
||||||
|
3. _____
|
||||||
|
|
||||||
|
### Observed Results:
|
||||||
|
|
||||||
|
* What happened?
|
||||||
|
* What did you expect to happen?
|
||||||
|
|
||||||
|
### Relevant code exceptions or logs
|
||||||
|
|
||||||
|
Note: Please copy/paste text of the messages, no screenshots of logs please.
|
||||||
|
|
||||||
|
```
|
||||||
|
// paste your log here
|
||||||
|
```
|
||||||
27
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
27
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Note: this section will not show up in the issue.
|
||||||
|
Have you search for this feature before requesting it? It's highly likely that a similar request was already filed.
|
||||||
|
-->
|
||||||
|
|
||||||
|
## Describe your environment
|
||||||
|
(if applicable)
|
||||||
|
|
||||||
|
* Operating system: ____
|
||||||
|
* Python Version: _____ (`python -V`)
|
||||||
|
* CCXT version: _____ (`pip freeze | grep ccxt`)
|
||||||
|
* Freqtrade Version: ____ (`freqtrade -V` or `docker-compose run --rm freqtrade -V` for Freqtrade running in docker)
|
||||||
|
|
||||||
|
|
||||||
|
## Describe the enhancement
|
||||||
|
|
||||||
|
*Explain the enhancement you would like*
|
||||||
|
|
||||||
25
.github/ISSUE_TEMPLATE/question.md
vendored
Normal file
25
.github/ISSUE_TEMPLATE/question.md
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
name: BQuestion
|
||||||
|
about: Ask a question you could not find an answer in the docs
|
||||||
|
title: ''
|
||||||
|
labels: "Question"
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
<!--
|
||||||
|
Have you searched for similar issues before posting it?
|
||||||
|
Did you have a VERY good look at the [documentation](https://www.freqtrade.io/en/latest/) and are sure that the question is not explained there
|
||||||
|
|
||||||
|
Please do not use the question template to report bugs or to request new features.
|
||||||
|
-->
|
||||||
|
|
||||||
|
## Describe your environment
|
||||||
|
|
||||||
|
* Operating system: ____
|
||||||
|
* Python Version: _____ (`python -V`)
|
||||||
|
* CCXT version: _____ (`pip freeze | grep ccxt`)
|
||||||
|
* Freqtrade Version: ____ (`freqtrade -V` or `docker-compose run --rm freqtrade -V` for Freqtrade running in docker)
|
||||||
|
|
||||||
|
## Your question
|
||||||
|
|
||||||
|
*Ask the question you have not been able to find an answer in our [Documentation](https://www.freqtrade.io/en/latest/)*
|
||||||
13
.github/dependabot.yml
vendored
Normal file
13
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: docker
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
open-pull-requests-limit: 10
|
||||||
|
- package-ecosystem: pip
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
open-pull-requests-limit: 10
|
||||||
|
target-branch: develop
|
||||||
302
.github/workflows/ci.yml
vendored
Normal file
302
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,302 @@
|
|||||||
|
name: Freqtrade CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- stable
|
||||||
|
- develop
|
||||||
|
tags:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
pull_request:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 5 * * 4'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ ubuntu-18.04, macos-latest ]
|
||||||
|
python-version: [3.7, 3.8]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
- name: Cache_dependencies
|
||||||
|
uses: actions/cache@v1
|
||||||
|
id: cache
|
||||||
|
with:
|
||||||
|
path: ~/dependencies/
|
||||||
|
key: ${{ runner.os }}-dependencies
|
||||||
|
|
||||||
|
- name: pip cache (linux)
|
||||||
|
uses: actions/cache@preview
|
||||||
|
if: startsWith(matrix.os, 'ubuntu')
|
||||||
|
with:
|
||||||
|
path: ~/.cache/pip
|
||||||
|
key: test-${{ matrix.os }}-${{ matrix.python-version }}-pip
|
||||||
|
|
||||||
|
- name: pip cache (macOS)
|
||||||
|
uses: actions/cache@preview
|
||||||
|
if: startsWith(matrix.os, 'macOS')
|
||||||
|
with:
|
||||||
|
path: ~/Library/Caches/pip
|
||||||
|
key: test-${{ matrix.os }}-${{ matrix.python-version }}-pip
|
||||||
|
|
||||||
|
- name: TA binary *nix
|
||||||
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
cd build_helpers && ./install_ta-lib.sh ${HOME}/dependencies/; cd ..
|
||||||
|
|
||||||
|
- name: Installation - *nix
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
export LD_LIBRARY_PATH=${HOME}/dependencies/lib:$LD_LIBRARY_PATH
|
||||||
|
export TA_LIBRARY_PATH=${HOME}/dependencies/lib
|
||||||
|
export TA_INCLUDE_PATH=${HOME}/dependencies/include
|
||||||
|
pip install -r requirements-dev.txt
|
||||||
|
pip install -e .
|
||||||
|
|
||||||
|
- name: Tests
|
||||||
|
run: |
|
||||||
|
pytest --random-order --cov=freqtrade --cov-config=.coveragerc
|
||||||
|
|
||||||
|
- name: Coveralls
|
||||||
|
if: (startsWith(matrix.os, 'ubuntu') && matrix.python-version == '3.8')
|
||||||
|
env:
|
||||||
|
# Coveralls token. Not used as secret due to github not providing secrets to forked repositories
|
||||||
|
COVERALLS_REPO_TOKEN: 6D1m0xupS3FgutfuGao8keFf9Hc0FpIXu
|
||||||
|
run: |
|
||||||
|
# Allow failure for coveralls
|
||||||
|
coveralls -v || true
|
||||||
|
|
||||||
|
- name: Backtesting
|
||||||
|
run: |
|
||||||
|
cp config.json.example config.json
|
||||||
|
freqtrade create-userdir --userdir user_data
|
||||||
|
freqtrade backtesting --datadir tests/testdata --strategy SampleStrategy
|
||||||
|
|
||||||
|
- name: Hyperopt
|
||||||
|
run: |
|
||||||
|
cp config.json.example config.json
|
||||||
|
freqtrade create-userdir --userdir user_data
|
||||||
|
freqtrade hyperopt --datadir tests/testdata -e 5 --strategy SampleStrategy --hyperopt SampleHyperOpt --print-all
|
||||||
|
|
||||||
|
- name: Flake8
|
||||||
|
run: |
|
||||||
|
flake8
|
||||||
|
|
||||||
|
- name: Mypy
|
||||||
|
run: |
|
||||||
|
mypy freqtrade scripts
|
||||||
|
|
||||||
|
- name: Slack Notification
|
||||||
|
uses: homoluctus/slatify@v1.8.0
|
||||||
|
if: failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
|
||||||
|
with:
|
||||||
|
type: ${{ job.status }}
|
||||||
|
job_name: '*Freqtrade CI ${{ matrix.os }}*'
|
||||||
|
mention: 'here'
|
||||||
|
mention_if: 'failure'
|
||||||
|
channel: '#notifications'
|
||||||
|
url: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
|
|
||||||
|
build_windows:
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ windows-latest ]
|
||||||
|
python-version: [3.7, 3.8]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
- name: Pip cache (Windows)
|
||||||
|
uses: actions/cache@preview
|
||||||
|
if: startsWith(runner.os, 'Windows')
|
||||||
|
with:
|
||||||
|
path: ~\AppData\Local\pip\Cache
|
||||||
|
key: ${{ matrix.os }}-${{ matrix.python-version }}-pip
|
||||||
|
|
||||||
|
- name: Installation
|
||||||
|
run: |
|
||||||
|
./build_helpers/install_windows.ps1
|
||||||
|
|
||||||
|
- name: Tests
|
||||||
|
run: |
|
||||||
|
pytest --random-order --cov=freqtrade --cov-config=.coveragerc
|
||||||
|
|
||||||
|
- name: Backtesting
|
||||||
|
run: |
|
||||||
|
cp config.json.example config.json
|
||||||
|
freqtrade create-userdir --userdir user_data
|
||||||
|
freqtrade backtesting --datadir tests/testdata --strategy SampleStrategy
|
||||||
|
|
||||||
|
- name: Hyperopt
|
||||||
|
run: |
|
||||||
|
cp config.json.example config.json
|
||||||
|
freqtrade create-userdir --userdir user_data
|
||||||
|
freqtrade hyperopt --datadir tests/testdata -e 5 --strategy SampleStrategy --hyperopt SampleHyperOpt --print-all
|
||||||
|
|
||||||
|
- name: Flake8
|
||||||
|
run: |
|
||||||
|
flake8
|
||||||
|
|
||||||
|
- name: Mypy
|
||||||
|
run: |
|
||||||
|
mypy freqtrade scripts
|
||||||
|
|
||||||
|
- name: Slack Notification
|
||||||
|
uses: homoluctus/slatify@v1.8.0
|
||||||
|
if: failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
|
||||||
|
with:
|
||||||
|
type: ${{ job.status }}
|
||||||
|
job_name: '*Freqtrade CI windows*'
|
||||||
|
mention: 'here'
|
||||||
|
mention_if: 'failure'
|
||||||
|
channel: '#notifications'
|
||||||
|
url: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
|
|
||||||
|
docs_check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Documentation syntax
|
||||||
|
run: |
|
||||||
|
./tests/test_docs.sh
|
||||||
|
|
||||||
|
- name: Slack Notification
|
||||||
|
uses: homoluctus/slatify@v1.8.0
|
||||||
|
if: failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
|
||||||
|
with:
|
||||||
|
type: ${{ job.status }}
|
||||||
|
job_name: '*Freqtrade Docs*'
|
||||||
|
channel: '#notifications'
|
||||||
|
url: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
|
|
||||||
|
cleanup-prior-runs:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Cleanup previous runs on this branch
|
||||||
|
uses: rokroskar/workflow-run-cleanup-action@v0.2.2
|
||||||
|
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/stable' && github.repository == 'freqtrade/freqtrade'"
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
|
||||||
|
# Notify on slack only once - when CI completes (and after deploy) in case it's successfull
|
||||||
|
notify-complete:
|
||||||
|
needs: [ build, build_windows, docs_check ]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Slack Notification
|
||||||
|
uses: homoluctus/slatify@v1.8.0
|
||||||
|
if: always() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
|
||||||
|
with:
|
||||||
|
type: ${{ job.status }}
|
||||||
|
job_name: '*Freqtrade CI*'
|
||||||
|
channel: '#notifications'
|
||||||
|
url: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
needs: [ build, build_windows, docs_check ]
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'release') && github.repository == 'freqtrade/freqtrade'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: 3.8
|
||||||
|
|
||||||
|
- name: Extract branch name
|
||||||
|
shell: bash
|
||||||
|
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
|
||||||
|
id: extract_branch
|
||||||
|
|
||||||
|
- name: Build distribution
|
||||||
|
run: |
|
||||||
|
pip install -U setuptools wheel
|
||||||
|
python setup.py sdist bdist_wheel
|
||||||
|
|
||||||
|
- name: Publish to PyPI (Test)
|
||||||
|
uses: pypa/gh-action-pypi-publish@master
|
||||||
|
if: (github.event_name == 'release')
|
||||||
|
with:
|
||||||
|
user: __token__
|
||||||
|
password: ${{ secrets.pypi_test_password }}
|
||||||
|
repository_url: https://test.pypi.org/legacy/
|
||||||
|
|
||||||
|
- name: Publish to PyPI
|
||||||
|
uses: pypa/gh-action-pypi-publish@master
|
||||||
|
if: (github.event_name == 'release')
|
||||||
|
with:
|
||||||
|
user: __token__
|
||||||
|
password: ${{ secrets.pypi_password }}
|
||||||
|
|
||||||
|
- name: Dockerhub login
|
||||||
|
env:
|
||||||
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
run: |
|
||||||
|
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
|
||||||
|
|
||||||
|
- name: Build and test and push docker image
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: freqtradeorg/freqtrade
|
||||||
|
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}
|
||||||
|
run: |
|
||||||
|
build_helpers/publish_docker.sh
|
||||||
|
|
||||||
|
# We need docker experimental to pull the ARM image.
|
||||||
|
- name: Switch docker to experimental
|
||||||
|
run: |
|
||||||
|
docker version -f '{{.Server.Experimental}}'
|
||||||
|
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
||||||
|
sudo systemctl restart docker
|
||||||
|
docker version -f '{{.Server.Experimental}}'
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: crazy-max/ghaction-docker-buildx@v1
|
||||||
|
with:
|
||||||
|
buildx-version: latest
|
||||||
|
qemu-version: latest
|
||||||
|
|
||||||
|
- name: Available platforms
|
||||||
|
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||||
|
|
||||||
|
- name: Build Raspberry docker image
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: freqtradeorg/freqtrade
|
||||||
|
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}_pi
|
||||||
|
run: |
|
||||||
|
build_helpers/publish_docker_pi.sh
|
||||||
|
|
||||||
|
|
||||||
|
- name: Slack Notification
|
||||||
|
uses: homoluctus/slatify@v1.8.0
|
||||||
|
if: always() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
|
||||||
|
with:
|
||||||
|
type: ${{ job.status }}
|
||||||
|
job_name: '*Freqtrade CI Deploy*'
|
||||||
|
mention: 'here'
|
||||||
|
mention_if: 'failure'
|
||||||
|
channel: '#notifications'
|
||||||
|
url: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
|
|
||||||
18
.github/workflows/docker_update_readme.yml
vendored
Normal file
18
.github/workflows/docker_update_readme.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
name: Update Docker Hub Description
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- stable
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
dockerHubDescription:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Docker Hub Description
|
||||||
|
uses: peter-evans/dockerhub-description@v2.1.0
|
||||||
|
env:
|
||||||
|
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
DOCKERHUB_REPOSITORY: freqtradeorg/freqtrade
|
||||||
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,7 +6,6 @@ user_data/*
|
|||||||
!user_data/strategy/sample_strategy.py
|
!user_data/strategy/sample_strategy.py
|
||||||
!user_data/notebooks
|
!user_data/notebooks
|
||||||
user_data/notebooks/*
|
user_data/notebooks/*
|
||||||
!user_data/notebooks/*example.ipynb
|
|
||||||
freqtrade-plot.html
|
freqtrade-plot.html
|
||||||
freqtrade-profit-plot.html
|
freqtrade-profit-plot.html
|
||||||
|
|
||||||
|
|||||||
26
.travis.yml
26
.travis.yml
@@ -1,4 +1,3 @@
|
|||||||
sudo: true
|
|
||||||
os:
|
os:
|
||||||
- linux
|
- linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
@@ -11,10 +10,10 @@ env:
|
|||||||
global:
|
global:
|
||||||
- IMAGE_NAME=freqtradeorg/freqtrade
|
- IMAGE_NAME=freqtradeorg/freqtrade
|
||||||
install:
|
install:
|
||||||
- cd build_helpers && ./install_ta-lib.sh ${HOME}/dependencies/; cd ..
|
- cd build_helpers && ./install_ta-lib.sh ${HOME}/dependencies; cd ..
|
||||||
- export LD_LIBRARY_PATH=${HOME}/dependencies/lib:$LD_LIBRARY_PATH
|
- export LD_LIBRARY_PATH=${HOME}/dependencies/lib:$LD_LIBRARY_PATH
|
||||||
- export TA_LIBRARY_PATH=${HOME}/dependencies/lib
|
- export TA_LIBRARY_PATH=${HOME}/dependencies/lib
|
||||||
- export TA_INCLUDE_PATH=${HOME}/dependencies/lib/include
|
- export TA_INCLUDE_PATH=${HOME}/dependencies/include
|
||||||
- pip install -r requirements-dev.txt
|
- pip install -r requirements-dev.txt
|
||||||
- pip install -e .
|
- pip install -e .
|
||||||
jobs:
|
jobs:
|
||||||
@@ -24,31 +23,34 @@ jobs:
|
|||||||
script:
|
script:
|
||||||
- pytest --random-order --cov=freqtrade --cov-config=.coveragerc
|
- pytest --random-order --cov=freqtrade --cov-config=.coveragerc
|
||||||
# Allow failure for coveralls
|
# Allow failure for coveralls
|
||||||
- coveralls || true
|
# - coveralls || true
|
||||||
name: pytest
|
name: pytest
|
||||||
- script:
|
- script:
|
||||||
- cp config.json.example config.json
|
- cp config.json.example config.json
|
||||||
- freqtrade --datadir tests/testdata backtesting
|
- freqtrade create-userdir --userdir user_data
|
||||||
|
- freqtrade backtesting --datadir tests/testdata --strategy SampleStrategy
|
||||||
name: backtest
|
name: backtest
|
||||||
- script:
|
- script:
|
||||||
- cp config.json.example config.json
|
- cp config.json.example config.json
|
||||||
- freqtrade --datadir tests/testdata hyperopt -e 5
|
- freqtrade create-userdir --userdir user_data
|
||||||
|
- freqtrade hyperopt --datadir tests/testdata -e 5 --strategy SampleStrategy --hyperopt SampleHyperOpt
|
||||||
name: hyperopt
|
name: hyperopt
|
||||||
- script: flake8
|
- script: flake8
|
||||||
name: flake8
|
name: flake8
|
||||||
- script:
|
- script:
|
||||||
# Test Documentation boxes -
|
# Test Documentation boxes -
|
||||||
# !!! <TYPE>: is not allowed!
|
# !!! <TYPE>: is not allowed!
|
||||||
- grep -Er '^!{3}\s\S+:' docs/*; test $? -ne 0
|
# !!! <TYPE> "title" - Title needs to be quoted!
|
||||||
|
- grep -Er '^!{3}\s\S+:|^!{3}\s\S+\s[^"]' docs/*; test $? -ne 0
|
||||||
name: doc syntax
|
name: doc syntax
|
||||||
- script: mypy freqtrade scripts
|
- script: mypy freqtrade scripts
|
||||||
name: mypy
|
name: mypy
|
||||||
|
|
||||||
- stage: docker
|
# - stage: docker
|
||||||
if: branch in (master, develop, feat/improve_travis) AND (type in (push, cron))
|
# if: branch in (master, develop, feat/improve_travis) AND (type in (push, cron))
|
||||||
script:
|
# script:
|
||||||
- build_helpers/publish_docker.sh
|
# - build_helpers/publish_docker.sh
|
||||||
name: "Build and test and push docker image"
|
# name: "Build and test and push docker image"
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
slack:
|
slack:
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ Issues labeled [good first issue](https://github.com/freqtrade/freqtrade/labels/
|
|||||||
|
|
||||||
Few pointers for contributions:
|
Few pointers for contributions:
|
||||||
|
|
||||||
- Create your PR against the `develop` branch, not `master`.
|
- Create your PR against the `develop` branch, not `stable`.
|
||||||
- New features need to contain unit tests and must be PEP8 conformant (max-line-length = 100).
|
- New features need to contain unit tests, must conform to PEP8 (max-line-length = 100) and should be documented with the introduction PR.
|
||||||
|
- PR's can be declared as `[WIP]` - which signify Work in Progress Pull Requests (which are not finished).
|
||||||
|
|
||||||
If you are unsure, discuss the feature on our [Slack](https://join.slack.com/t/highfrequencybot/shared_invite/enQtNjU5ODcwNjI1MDU3LTU1MTgxMjkzNmYxNWE1MDEzYzQ3YmU4N2MwZjUyNjJjODRkMDVkNjg4YTAyZGYzYzlhOTZiMTE4ZjQ4YzM0OGE)
|
If you are unsure, discuss the feature on our [Slack](https://join.slack.com/t/highfrequencybot/shared_invite/enQtNjU5ODcwNjI1MDU3LTU1MTgxMjkzNmYxNWE1MDEzYzQ3YmU4N2MwZjUyNjJjODRkMDVkNjg4YTAyZGYzYzlhOTZiMTE4ZjQ4YzM0OGE)
|
||||||
or in a [issue](https://github.com/freqtrade/freqtrade/issues) before a PR.
|
or in a [issue](https://github.com/freqtrade/freqtrade/issues) before a PR.
|
||||||
@@ -18,7 +19,7 @@ or in a [issue](https://github.com/freqtrade/freqtrade/issues) before a PR.
|
|||||||
|
|
||||||
Best start by reading the [documentation](https://www.freqtrade.io/) to get a feel for what is possible with the bot, or head straight to the [Developer-documentation](https://www.freqtrade.io/en/latest/developer/) (WIP) which should help you getting started.
|
Best start by reading the [documentation](https://www.freqtrade.io/) to get a feel for what is possible with the bot, or head straight to the [Developer-documentation](https://www.freqtrade.io/en/latest/developer/) (WIP) which should help you getting started.
|
||||||
|
|
||||||
## Before sending the PR:
|
## Before sending the PR
|
||||||
|
|
||||||
### 1. Run unit tests
|
### 1. Run unit tests
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ pytest tests/test_<file_name>.py::test_<method_name>
|
|||||||
#### Run Flake8
|
#### Run Flake8
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
flake8 freqtrade
|
flake8 freqtrade tests scripts
|
||||||
```
|
```
|
||||||
|
|
||||||
We receive a lot of code that fails the `flake8` checks.
|
We receive a lot of code that fails the `flake8` checks.
|
||||||
@@ -109,11 +110,11 @@ Exceptions:
|
|||||||
|
|
||||||
Contributors may be given commit privileges. Preference will be given to those with:
|
Contributors may be given commit privileges. Preference will be given to those with:
|
||||||
|
|
||||||
1. Past contributions to FreqTrade and other related open-source projects. Contributions to FreqTrade include both code (both accepted and pending) and friendly participation in the issue tracker and Pull request reviews. Quantity and quality are considered.
|
1. Past contributions to Freqtrade and other related open-source projects. Contributions to Freqtrade include both code (both accepted and pending) and friendly participation in the issue tracker and Pull request reviews. Quantity and quality are considered.
|
||||||
1. A coding style that the other core committers find simple, minimal, and clean.
|
1. A coding style that the other core committers find simple, minimal, and clean.
|
||||||
1. Access to resources for cross-platform development and testing.
|
1. Access to resources for cross-platform development and testing.
|
||||||
1. Time to devote to the project regularly.
|
1. Time to devote to the project regularly.
|
||||||
|
|
||||||
Being a Committer does not grant write permission on `develop` or `master` for security reasons (Users trust FreqTrade with their Exchange API keys).
|
Being a Committer does not grant write permission on `develop` or `stable` for security reasons (Users trust Freqtrade with their Exchange API keys).
|
||||||
|
|
||||||
After being Committer for some time, a Committer may be named Core Committer and given full repository access.
|
After being Committer for some time, a Committer may be named Core Committer and given full repository access.
|
||||||
|
|||||||
11
Dockerfile
11
Dockerfile
@@ -1,7 +1,7 @@
|
|||||||
FROM python:3.7.5-slim-stretch
|
FROM python:3.8.6-slim-buster
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get -y install curl build-essential libssl-dev \
|
&& apt-get -y install curl build-essential libssl-dev sqlite3 \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& pip install --upgrade pip
|
&& pip install --upgrade pip
|
||||||
|
|
||||||
@@ -16,11 +16,14 @@ RUN cd /tmp && /tmp/install_ta-lib.sh && rm -r /tmp/*ta-lib*
|
|||||||
ENV LD_LIBRARY_PATH /usr/local/lib
|
ENV LD_LIBRARY_PATH /usr/local/lib
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
COPY requirements.txt requirements-common.txt requirements-hyperopt.txt /freqtrade/
|
COPY requirements.txt requirements-hyperopt.txt /freqtrade/
|
||||||
RUN pip install numpy --no-cache-dir \
|
RUN pip install numpy --no-cache-dir \
|
||||||
&& pip install -r requirements-hyperopt.txt --no-cache-dir
|
&& pip install -r requirements-hyperopt.txt --no-cache-dir
|
||||||
|
|
||||||
# Install and execute
|
# Install and execute
|
||||||
COPY . /freqtrade/
|
COPY . /freqtrade/
|
||||||
RUN pip install -e . --no-cache-dir
|
RUN pip install -e . --no-cache-dir \
|
||||||
|
&& mkdir /freqtrade/user_data/
|
||||||
ENTRYPOINT ["freqtrade"]
|
ENTRYPOINT ["freqtrade"]
|
||||||
|
# Default to trade mode
|
||||||
|
CMD [ "trade" ]
|
||||||
|
|||||||
29
Dockerfile.armhf
Normal file
29
Dockerfile.armhf
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
FROM --platform=linux/arm/v7 python:3.7.7-slim-buster
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get -y install curl build-essential libssl-dev libffi-dev libatlas3-base libgfortran5 sqlite3 \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& pip install --upgrade pip \
|
||||||
|
&& echo "[global]\nextra-index-url=https://www.piwheels.org/simple" > /etc/pip.conf
|
||||||
|
|
||||||
|
# Prepare environment
|
||||||
|
RUN mkdir /freqtrade
|
||||||
|
WORKDIR /freqtrade
|
||||||
|
|
||||||
|
# Install TA-lib
|
||||||
|
COPY build_helpers/* /tmp/
|
||||||
|
RUN cd /tmp && /tmp/install_ta-lib.sh && rm -r /tmp/*ta-lib*
|
||||||
|
|
||||||
|
ENV LD_LIBRARY_PATH /usr/local/lib
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
COPY requirements.txt /freqtrade/
|
||||||
|
RUN pip install numpy --no-cache-dir \
|
||||||
|
&& pip install -r requirements.txt --no-cache-dir
|
||||||
|
|
||||||
|
# Install and execute
|
||||||
|
COPY . /freqtrade/
|
||||||
|
RUN pip install -e . --no-cache-dir
|
||||||
|
ENTRYPOINT ["freqtrade"]
|
||||||
|
# Default to trade mode
|
||||||
|
CMD [ "trade" ]
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
FROM balenalib/raspberrypi3-debian:stretch
|
|
||||||
|
|
||||||
RUN [ "cross-build-start" ]
|
|
||||||
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get -y install wget curl build-essential libssl-dev libffi-dev \
|
|
||||||
&& apt-get clean
|
|
||||||
|
|
||||||
# Prepare environment
|
|
||||||
RUN mkdir /freqtrade
|
|
||||||
WORKDIR /freqtrade
|
|
||||||
|
|
||||||
# Install TA-lib
|
|
||||||
COPY build_helpers/ta-lib-0.4.0-src.tar.gz /freqtrade/
|
|
||||||
RUN tar -xzf /freqtrade/ta-lib-0.4.0-src.tar.gz \
|
|
||||||
&& cd /freqtrade/ta-lib/ \
|
|
||||||
&& ./configure \
|
|
||||||
&& make \
|
|
||||||
&& make install \
|
|
||||||
&& rm /freqtrade/ta-lib-0.4.0-src.tar.gz
|
|
||||||
|
|
||||||
ENV LD_LIBRARY_PATH /usr/local/lib
|
|
||||||
|
|
||||||
# Install berryconda
|
|
||||||
RUN wget -q https://github.com/jjhelmus/berryconda/releases/download/v2.0.0/Berryconda3-2.0.0-Linux-armv7l.sh \
|
|
||||||
&& bash ./Berryconda3-2.0.0-Linux-armv7l.sh -b \
|
|
||||||
&& rm Berryconda3-2.0.0-Linux-armv7l.sh
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
COPY requirements-common.txt /freqtrade/
|
|
||||||
RUN ~/berryconda3/bin/conda install -y numpy pandas \
|
|
||||||
&& ~/berryconda3/bin/pip install -r requirements-common.txt --no-cache-dir
|
|
||||||
|
|
||||||
# Install and execute
|
|
||||||
COPY . /freqtrade/
|
|
||||||
RUN ~/berryconda3/bin/pip install -e . --no-cache-dir
|
|
||||||
|
|
||||||
RUN [ "cross-build-end" ]
|
|
||||||
|
|
||||||
ENTRYPOINT ["/root/berryconda3/bin/python","./freqtrade/main.py"]
|
|
||||||
@@ -2,3 +2,4 @@ include LICENSE
|
|||||||
include README.md
|
include README.md
|
||||||
include config.json.example
|
include config.json.example
|
||||||
recursive-include freqtrade *.py
|
recursive-include freqtrade *.py
|
||||||
|
recursive-include freqtrade/templates/ *.j2 *.ipynb
|
||||||
|
|||||||
73
README.md
73
README.md
@@ -1,6 +1,6 @@
|
|||||||
# Freqtrade
|
# Freqtrade
|
||||||
|
|
||||||
[](https://travis-ci.org/freqtrade/freqtrade)
|
[](https://github.com/freqtrade/freqtrade/actions/)
|
||||||
[](https://coveralls.io/github/freqtrade/freqtrade?branch=develop)
|
[](https://coveralls.io/github/freqtrade/freqtrade?branch=develop)
|
||||||
[](https://www.freqtrade.io)
|
[](https://www.freqtrade.io)
|
||||||
[](https://codeclimate.com/github/freqtrade/freqtrade/maintainability)
|
[](https://codeclimate.com/github/freqtrade/freqtrade/maintainability)
|
||||||
@@ -25,7 +25,8 @@ hesitate to read the source code and understand the mechanism of this bot.
|
|||||||
## Exchange marketplaces supported
|
## Exchange marketplaces supported
|
||||||
|
|
||||||
- [X] [Bittrex](https://bittrex.com/)
|
- [X] [Bittrex](https://bittrex.com/)
|
||||||
- [X] [Binance](https://www.binance.com/) ([*Note for binance users](#a-note-on-binance))
|
- [X] [Binance](https://www.binance.com/) ([*Note for binance users](docs/exchanges.md#blacklists))
|
||||||
|
- [X] [Kraken](https://kraken.com/)
|
||||||
- [ ] [113 others to tests](https://github.com/ccxt/ccxt/). _(We cannot guarantee they will work)_
|
- [ ] [113 others to tests](https://github.com/ccxt/ccxt/). _(We cannot guarantee they will work)_
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
@@ -62,51 +63,53 @@ git checkout develop
|
|||||||
|
|
||||||
For any other type of installation please refer to [Installation doc](https://www.freqtrade.io/en/latest/installation/).
|
For any other type of installation please refer to [Installation doc](https://www.freqtrade.io/en/latest/installation/).
|
||||||
|
|
||||||
|
|
||||||
## Basic Usage
|
## Basic Usage
|
||||||
|
|
||||||
### Bot commands
|
### Bot commands
|
||||||
|
|
||||||
```
|
```
|
||||||
usage: freqtrade [-h] [-v] [--logfile FILE] [--version] [-c PATH] [-d PATH]
|
usage: freqtrade [-h] [-V]
|
||||||
[-s NAME] [--strategy-path PATH] [--dynamic-whitelist [INT]]
|
{trade,create-userdir,new-config,new-hyperopt,new-strategy,download-data,convert-data,convert-trade-data,backtesting,edge,hyperopt,hyperopt-list,hyperopt-show,list-exchanges,list-hyperopts,list-markets,list-pairs,list-strategies,list-timeframes,show-trades,test-pairlist,plot-dataframe,plot-profit}
|
||||||
[--db-url PATH] [--sd-notify]
|
...
|
||||||
{backtesting,edge,hyperopt} ...
|
|
||||||
|
|
||||||
Free, open source crypto trading bot
|
Free, open source crypto trading bot
|
||||||
|
|
||||||
positional arguments:
|
positional arguments:
|
||||||
{backtesting,edge,hyperopt}
|
{trade,create-userdir,new-config,new-hyperopt,new-strategy,download-data,convert-data,convert-trade-data,backtesting,edge,hyperopt,hyperopt-list,hyperopt-show,list-exchanges,list-hyperopts,list-markets,list-pairs,list-strategies,list-timeframes,show-trades,test-pairlist,plot-dataframe,plot-profit}
|
||||||
|
trade Trade module.
|
||||||
|
create-userdir Create user-data directory.
|
||||||
|
new-config Create new config
|
||||||
|
new-hyperopt Create new hyperopt
|
||||||
|
new-strategy Create new strategy
|
||||||
|
download-data Download backtesting data.
|
||||||
|
convert-data Convert candle (OHLCV) data from one format to
|
||||||
|
another.
|
||||||
|
convert-trade-data Convert trade data from one format to another.
|
||||||
backtesting Backtesting module.
|
backtesting Backtesting module.
|
||||||
edge Edge module.
|
edge Edge module.
|
||||||
hyperopt Hyperopt module.
|
hyperopt Hyperopt module.
|
||||||
|
hyperopt-list List Hyperopt results
|
||||||
|
hyperopt-show Show details of Hyperopt results
|
||||||
|
list-exchanges Print available exchanges.
|
||||||
|
list-hyperopts Print available hyperopt classes.
|
||||||
|
list-markets Print markets on exchange.
|
||||||
|
list-pairs Print pairs on exchange.
|
||||||
|
list-strategies Print available strategies.
|
||||||
|
list-timeframes Print available timeframes for the exchange.
|
||||||
|
show-trades Show trades.
|
||||||
|
test-pairlist Test your pairlist configuration.
|
||||||
|
plot-dataframe Plot candles with indicators.
|
||||||
|
plot-profit Generate plot showing profits.
|
||||||
|
|
||||||
optional arguments:
|
optional arguments:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
-V, --version show program's version number and exit
|
||||||
--logfile FILE Log to the file specified
|
|
||||||
--version show program's version number and exit
|
|
||||||
-c PATH, --config PATH
|
|
||||||
Specify configuration file (default: None). Multiple
|
|
||||||
--config options may be used.
|
|
||||||
-d PATH, --datadir PATH
|
|
||||||
Path to backtest data.
|
|
||||||
-s NAME, --strategy NAME
|
|
||||||
Specify strategy class name (default:
|
|
||||||
DefaultStrategy).
|
|
||||||
--strategy-path PATH Specify additional strategy lookup path.
|
|
||||||
--dynamic-whitelist [INT]
|
|
||||||
Dynamically generate and update whitelist based on 24h
|
|
||||||
BaseVolume (default: 20). DEPRECATED.
|
|
||||||
--db-url PATH Override trades database URL, this is useful if
|
|
||||||
dry_run is enabled or in custom deployments (default:
|
|
||||||
None).
|
|
||||||
--sd-notify Notify systemd service manager.
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Telegram RPC commands
|
### Telegram RPC commands
|
||||||
|
|
||||||
Telegram is not mandatory. However, this is a great way to control your bot. More details on our [documentation](https://www.freqtrade.io/en/latest/telegram-usage/)
|
Telegram is not mandatory. However, this is a great way to control your bot. More details and the full command list on our [documentation](https://www.freqtrade.io/en/latest/telegram-usage/)
|
||||||
|
|
||||||
- `/start`: Starts the trader
|
- `/start`: Starts the trader
|
||||||
- `/stop`: Stops the trader
|
- `/stop`: Stops the trader
|
||||||
@@ -120,20 +123,14 @@ Telegram is not mandatory. However, this is a great way to control your bot. Mor
|
|||||||
- `/help`: Show help message
|
- `/help`: Show help message
|
||||||
- `/version`: Show version
|
- `/version`: Show version
|
||||||
|
|
||||||
|
|
||||||
## Development branches
|
## Development branches
|
||||||
|
|
||||||
The project is currently setup in two main branches:
|
The project is currently setup in two main branches:
|
||||||
|
|
||||||
- `develop` - This branch has often new features, but might also cause breaking changes.
|
- `develop` - This branch has often new features, but might also contain breaking changes. We try hard to keep this branch as stable as possible.
|
||||||
- `master` - This branch contains the latest stable release. The bot 'should' be stable on this branch, and is generally well tested.
|
- `stable` - This branch contains the latest stable release. This branch is generally well tested.
|
||||||
- `feat/*` - These are feature branches, which are being worked on heavily. Please don't use these unless you want to test a specific feature.
|
- `feat/*` - These are feature branches, which are being worked on heavily. Please don't use these unless you want to test a specific feature.
|
||||||
|
|
||||||
## A note on Binance
|
|
||||||
|
|
||||||
For Binance, please add `"BNB/<STAKE>"` to your blacklist to avoid issues.
|
|
||||||
Accounts having BNB accounts use this to pay for fees - if your first trade happens to be on `BNB`, further trades will consume this position and make the initial BNB order unsellable as the expected amount is not there anymore.
|
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
### Help / Slack
|
### Help / Slack
|
||||||
@@ -174,11 +171,11 @@ Issues labeled [good first issue](https://github.com/freqtrade/freqtrade/labels/
|
|||||||
|
|
||||||
**Note** before starting any major new feature work, *please open an issue describing what you are planning to do* or talk to us on [Slack](https://join.slack.com/t/highfrequencybot/shared_invite/enQtNjU5ODcwNjI1MDU3LTU1MTgxMjkzNmYxNWE1MDEzYzQ3YmU4N2MwZjUyNjJjODRkMDVkNjg4YTAyZGYzYzlhOTZiMTE4ZjQ4YzM0OGE). This will ensure that interested parties can give valuable feedback on the feature, and let others know that you are working on it.
|
**Note** before starting any major new feature work, *please open an issue describing what you are planning to do* or talk to us on [Slack](https://join.slack.com/t/highfrequencybot/shared_invite/enQtNjU5ODcwNjI1MDU3LTU1MTgxMjkzNmYxNWE1MDEzYzQ3YmU4N2MwZjUyNjJjODRkMDVkNjg4YTAyZGYzYzlhOTZiMTE4ZjQ4YzM0OGE). This will ensure that interested parties can give valuable feedback on the feature, and let others know that you are working on it.
|
||||||
|
|
||||||
**Important:** Always create your PR against the `develop` branch, not `master`.
|
**Important:** Always create your PR against the `develop` branch, not `stable`.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
### Uptodate clock
|
### Up-to-date clock
|
||||||
|
|
||||||
The clock must be accurate, syncronized to a NTP server very frequently to avoid problems with communication to the exchanges.
|
The clock must be accurate, syncronized to a NTP server very frequently to avoid problems with communication to the exchanges.
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import warnings
|
|
||||||
|
|
||||||
from freqtrade.main import main
|
|
||||||
|
|
||||||
warnings.warn(
|
|
||||||
"Deprecated - To continue to run the bot like this, please run `pip install -e .` again.",
|
|
||||||
DeprecationWarning)
|
|
||||||
main(sys.argv[1:])
|
|
||||||
BIN
build_helpers/TA_Lib-0.4.18-cp37-cp37m-win_amd64.whl
Normal file
BIN
build_helpers/TA_Lib-0.4.18-cp37-cp37m-win_amd64.whl
Normal file
Binary file not shown.
BIN
build_helpers/TA_Lib-0.4.18-cp38-cp38-win_amd64.whl
Normal file
BIN
build_helpers/TA_Lib-0.4.18-cp38-cp38-win_amd64.whl
Normal file
Binary file not shown.
17
build_helpers/install_windows.ps1
Normal file
17
build_helpers/install_windows.ps1
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Downloads don't work automatically, since the URL is regenerated via javascript.
|
||||||
|
# Downloaded from https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib
|
||||||
|
# Invoke-WebRequest -Uri "https://download.lfd.uci.edu/pythonlibs/xxxxxxx/TA_Lib-0.4.17-cp37-cp37m-win_amd64.whl" -OutFile "TA_Lib-0.4.17-cp37-cp37m-win_amd64.whl"
|
||||||
|
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
|
||||||
|
$pyv = python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')"
|
||||||
|
|
||||||
|
if ($pyv -eq '3.7') {
|
||||||
|
pip install build_helpers\TA_Lib-0.4.18-cp37-cp37m-win_amd64.whl
|
||||||
|
}
|
||||||
|
if ($pyv -eq '3.8') {
|
||||||
|
pip install build_helpers\TA_Lib-0.4.18-cp38-cp38-win_amd64.whl
|
||||||
|
}
|
||||||
|
|
||||||
|
pip install -r requirements-dev.txt
|
||||||
|
pip install -e .
|
||||||
@@ -1,21 +1,28 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# - export TAG=`if [ "$TRAVIS_BRANCH" == "develop" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
|
|
||||||
# Replace / with _ to create a valid tag
|
|
||||||
TAG=$(echo "${TRAVIS_BRANCH}" | sed -e "s/\//_/")
|
|
||||||
|
|
||||||
|
# Replace / with _ to create a valid tag
|
||||||
|
TAG=$(echo "${BRANCH_NAME}" | sed -e "s/\//_/g")
|
||||||
|
TAG_PLOT=${TAG}_plot
|
||||||
|
echo "Running for ${TAG}"
|
||||||
|
|
||||||
# Add commit and commit_message to docker container
|
# Add commit and commit_message to docker container
|
||||||
echo "${TRAVIS_COMMIT} ${TRAVIS_COMMIT_MESSAGE}" > freqtrade_commit
|
echo "${GITHUB_SHA}" > freqtrade_commit
|
||||||
|
|
||||||
if [ "${TRAVIS_EVENT_TYPE}" = "cron" ]; then
|
if [ "${GITHUB_EVENT_NAME}" = "schedule" ]; then
|
||||||
echo "event ${TRAVIS_EVENT_TYPE}: full rebuild - skipping cache"
|
echo "event ${GITHUB_EVENT_NAME}: full rebuild - skipping cache"
|
||||||
docker build -t freqtrade:${TAG} .
|
docker build -t freqtrade:${TAG} .
|
||||||
else
|
else
|
||||||
echo "event ${TRAVIS_EVENT_TYPE}: building with cache"
|
echo "event ${GITHUB_EVENT_NAME}: building with cache"
|
||||||
# Pull last build to avoid rebuilding the whole image
|
# Pull last build to avoid rebuilding the whole image
|
||||||
docker pull ${IMAGE_NAME}:${TAG}
|
docker pull ${IMAGE_NAME}:${TAG}
|
||||||
docker build --cache-from ${IMAGE_NAME}:${TAG} -t freqtrade:${TAG} .
|
docker build --cache-from ${IMAGE_NAME}:${TAG} -t freqtrade:${TAG} .
|
||||||
fi
|
fi
|
||||||
|
# Tag image for upload and next build step
|
||||||
|
docker tag freqtrade:$TAG ${IMAGE_NAME}:$TAG
|
||||||
|
|
||||||
|
docker build --cache-from freqtrade:${TAG} --build-arg sourceimage=${TAG} -t freqtrade:${TAG_PLOT} -f docker/Dockerfile.plot .
|
||||||
|
|
||||||
|
docker tag freqtrade:$TAG_PLOT ${IMAGE_NAME}:$TAG_PLOT
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "failed building image"
|
echo "failed building image"
|
||||||
@@ -23,33 +30,23 @@ if [ $? -ne 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Run backtest
|
# Run backtest
|
||||||
docker run --rm -it -v $(pwd)/config.json.example:/freqtrade/config.json:ro -v $(pwd)/tests:/tests freqtrade:${TAG} --datadir /tests/testdata backtesting
|
docker run --rm -v $(pwd)/config.json.example:/freqtrade/config.json:ro -v $(pwd)/tests:/tests freqtrade:${TAG} backtesting --datadir /tests/testdata --strategy-path /tests/strategy/strats/ --strategy DefaultStrategy
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "failed running backtest"
|
echo "failed running backtest"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Tag image for upload
|
|
||||||
docker tag freqtrade:$TAG ${IMAGE_NAME}:$TAG
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "failed tagging image"
|
echo "failed tagging image"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Tag as latest for develop builds
|
# Tag as latest for develop builds
|
||||||
if [ "${TRAVIS_BRANCH}" = "develop" ]; then
|
if [ "${TAG}" = "develop" ]; then
|
||||||
docker tag freqtrade:$TAG ${IMAGE_NAME}:latest
|
docker tag freqtrade:$TAG ${IMAGE_NAME}:latest
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Login
|
|
||||||
echo "$DOCKER_PASS" | docker login -u $DOCKER_USER --password-stdin
|
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "failed login"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Show all available images
|
# Show all available images
|
||||||
docker images
|
docker images
|
||||||
|
|
||||||
|
|||||||
36
build_helpers/publish_docker_pi.sh
Executable file
36
build_helpers/publish_docker_pi.sh
Executable file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# The below assumes a correctly setup docker buildx environment
|
||||||
|
|
||||||
|
# Replace / with _ to create a valid tag
|
||||||
|
TAG=$(echo "${BRANCH_NAME}" | sed -e "s/\//_/g")
|
||||||
|
PI_PLATFORM="linux/arm/v7"
|
||||||
|
echo "Running for ${TAG}"
|
||||||
|
CACHE_TAG=freqtradeorg/freqtrade_cache:${TAG}_cache
|
||||||
|
|
||||||
|
# Add commit and commit_message to docker container
|
||||||
|
echo "${GITHUB_SHA}" > freqtrade_commit
|
||||||
|
|
||||||
|
if [ "${GITHUB_EVENT_NAME}" = "schedule" ]; then
|
||||||
|
echo "event ${GITHUB_EVENT_NAME}: full rebuild - skipping cache"
|
||||||
|
docker buildx build \
|
||||||
|
--cache-to=type=registry,ref=${CACHE_TAG} \
|
||||||
|
-f Dockerfile.armhf \
|
||||||
|
--platform ${PI_PLATFORM} \
|
||||||
|
-t ${IMAGE_NAME}:${TAG} --push .
|
||||||
|
else
|
||||||
|
echo "event ${GITHUB_EVENT_NAME}: building with cache"
|
||||||
|
# Pull last build to avoid rebuilding the whole image
|
||||||
|
# docker pull --platform ${PI_PLATFORM} ${IMAGE_NAME}:${TAG}
|
||||||
|
docker buildx build \
|
||||||
|
--cache-from=type=registry,ref=${CACHE_TAG} \
|
||||||
|
--cache-to=type=registry,ref=${CACHE_TAG} \
|
||||||
|
-f Dockerfile.armhf \
|
||||||
|
--platform ${PI_PLATFORM} \
|
||||||
|
-t ${IMAGE_NAME}:${TAG} --push .
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "failed building image"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
@@ -2,10 +2,11 @@
|
|||||||
"max_open_trades": 3,
|
"max_open_trades": 3,
|
||||||
"stake_currency": "BTC",
|
"stake_currency": "BTC",
|
||||||
"stake_amount": 0.05,
|
"stake_amount": 0.05,
|
||||||
|
"tradable_balance_ratio": 0.99,
|
||||||
"fiat_display_currency": "USD",
|
"fiat_display_currency": "USD",
|
||||||
"ticker_interval" : "5m",
|
"timeframe": "5m",
|
||||||
"dry_run": false,
|
"dry_run": false,
|
||||||
"trailing_stop": false,
|
"cancel_open_orders_on_exit": false,
|
||||||
"unfilledtimeout": {
|
"unfilledtimeout": {
|
||||||
"buy": 10,
|
"buy": 10,
|
||||||
"sell": 30
|
"sell": 30
|
||||||
@@ -22,7 +23,7 @@
|
|||||||
"ask_strategy":{
|
"ask_strategy":{
|
||||||
"use_order_book": false,
|
"use_order_book": false,
|
||||||
"order_book_min": 1,
|
"order_book_min": 1,
|
||||||
"order_book_max": 9,
|
"order_book_max": 1,
|
||||||
"use_sell_signal": true,
|
"use_sell_signal": true,
|
||||||
"sell_profit_only": false,
|
"sell_profit_only": false,
|
||||||
"ignore_roi_if_buy_signal": false
|
"ignore_roi_if_buy_signal": false
|
||||||
@@ -43,7 +44,7 @@
|
|||||||
"DASH/BTC",
|
"DASH/BTC",
|
||||||
"ZEC/BTC",
|
"ZEC/BTC",
|
||||||
"XLM/BTC",
|
"XLM/BTC",
|
||||||
"NXT/BTC",
|
"XRP/BTC",
|
||||||
"TRX/BTC",
|
"TRX/BTC",
|
||||||
"ADA/BTC",
|
"ADA/BTC",
|
||||||
"XMR/BTC"
|
"XMR/BTC"
|
||||||
@@ -52,11 +53,13 @@
|
|||||||
"DOGE/BTC"
|
"DOGE/BTC"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"pairlists": [
|
||||||
|
{"method": "StaticPairList"}
|
||||||
|
],
|
||||||
"edge": {
|
"edge": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"process_throttle_secs": 3600,
|
"process_throttle_secs": 3600,
|
||||||
"calculate_since_number_of_days": 7,
|
"calculate_since_number_of_days": 7,
|
||||||
"capital_available_percentage": 0.5,
|
|
||||||
"allowed_risk": 0.01,
|
"allowed_risk": 0.01,
|
||||||
"stoploss_range_min": -0.01,
|
"stoploss_range_min": -0.01,
|
||||||
"stoploss_range_max": -0.1,
|
"stoploss_range_max": -0.1,
|
||||||
@@ -68,10 +71,20 @@
|
|||||||
"remove_pumps": false
|
"remove_pumps": false
|
||||||
},
|
},
|
||||||
"telegram": {
|
"telegram": {
|
||||||
"enabled": true,
|
"enabled": false,
|
||||||
"token": "your_telegram_token",
|
"token": "your_telegram_token",
|
||||||
"chat_id": "your_telegram_chat_id"
|
"chat_id": "your_telegram_chat_id"
|
||||||
},
|
},
|
||||||
|
"api_server": {
|
||||||
|
"enabled": false,
|
||||||
|
"listen_ip_address": "127.0.0.1",
|
||||||
|
"listen_port": 8080,
|
||||||
|
"verbosity": "info",
|
||||||
|
"jwt_secret_key": "somethingrandom",
|
||||||
|
"CORS_origins": [],
|
||||||
|
"username": "",
|
||||||
|
"password": ""
|
||||||
|
},
|
||||||
"initial_state": "running",
|
"initial_state": "running",
|
||||||
"forcebuy_enable": false,
|
"forcebuy_enable": false,
|
||||||
"internals": {
|
"internals": {
|
||||||
|
|||||||
@@ -2,10 +2,11 @@
|
|||||||
"max_open_trades": 3,
|
"max_open_trades": 3,
|
||||||
"stake_currency": "BTC",
|
"stake_currency": "BTC",
|
||||||
"stake_amount": 0.05,
|
"stake_amount": 0.05,
|
||||||
|
"tradable_balance_ratio": 0.99,
|
||||||
"fiat_display_currency": "USD",
|
"fiat_display_currency": "USD",
|
||||||
"ticker_interval" : "5m",
|
"timeframe": "5m",
|
||||||
"dry_run": true,
|
"dry_run": true,
|
||||||
"trailing_stop": false,
|
"cancel_open_orders_on_exit": false,
|
||||||
"unfilledtimeout": {
|
"unfilledtimeout": {
|
||||||
"buy": 10,
|
"buy": 10,
|
||||||
"sell": 30
|
"sell": 30
|
||||||
@@ -22,7 +23,7 @@
|
|||||||
"ask_strategy":{
|
"ask_strategy":{
|
||||||
"use_order_book": false,
|
"use_order_book": false,
|
||||||
"order_book_min": 1,
|
"order_book_min": 1,
|
||||||
"order_book_max": 9,
|
"order_book_max": 1,
|
||||||
"use_sell_signal": true,
|
"use_sell_signal": true,
|
||||||
"sell_profit_only": false,
|
"sell_profit_only": false,
|
||||||
"ignore_roi_if_buy_signal": false
|
"ignore_roi_if_buy_signal": false
|
||||||
@@ -37,28 +38,33 @@
|
|||||||
"rateLimit": 200
|
"rateLimit": 200
|
||||||
},
|
},
|
||||||
"pair_whitelist": [
|
"pair_whitelist": [
|
||||||
"AST/BTC",
|
"ALGO/BTC",
|
||||||
"ETC/BTC",
|
"ATOM/BTC",
|
||||||
"ETH/BTC",
|
"BAT/BTC",
|
||||||
|
"BCH/BTC",
|
||||||
|
"BRD/BTC",
|
||||||
"EOS/BTC",
|
"EOS/BTC",
|
||||||
|
"ETH/BTC",
|
||||||
"IOTA/BTC",
|
"IOTA/BTC",
|
||||||
|
"LINK/BTC",
|
||||||
"LTC/BTC",
|
"LTC/BTC",
|
||||||
"MTH/BTC",
|
"NEO/BTC",
|
||||||
"NCASH/BTC",
|
"NXS/BTC",
|
||||||
"TNT/BTC",
|
|
||||||
"XMR/BTC",
|
"XMR/BTC",
|
||||||
"XLM/BTC",
|
"XRP/BTC",
|
||||||
"XRP/BTC"
|
"XTZ/BTC"
|
||||||
],
|
],
|
||||||
"pair_blacklist": [
|
"pair_blacklist": [
|
||||||
"BNB/BTC"
|
"BNB/BTC"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"pairlists": [
|
||||||
|
{"method": "StaticPairList"}
|
||||||
|
],
|
||||||
"edge": {
|
"edge": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"process_throttle_secs": 3600,
|
"process_throttle_secs": 3600,
|
||||||
"calculate_since_number_of_days": 7,
|
"calculate_since_number_of_days": 7,
|
||||||
"capital_available_percentage": 0.5,
|
|
||||||
"allowed_risk": 0.01,
|
"allowed_risk": 0.01,
|
||||||
"stoploss_range_min": -0.01,
|
"stoploss_range_min": -0.01,
|
||||||
"stoploss_range_max": -0.1,
|
"stoploss_range_max": -0.1,
|
||||||
@@ -74,6 +80,16 @@
|
|||||||
"token": "your_telegram_token",
|
"token": "your_telegram_token",
|
||||||
"chat_id": "your_telegram_chat_id"
|
"chat_id": "your_telegram_chat_id"
|
||||||
},
|
},
|
||||||
|
"api_server": {
|
||||||
|
"enabled": false,
|
||||||
|
"listen_ip_address": "127.0.0.1",
|
||||||
|
"listen_port": 8080,
|
||||||
|
"verbosity": "info",
|
||||||
|
"jwt_secret_key": "somethingrandom",
|
||||||
|
"CORS_origins": [],
|
||||||
|
"username": "",
|
||||||
|
"password": ""
|
||||||
|
},
|
||||||
"initial_state": "running",
|
"initial_state": "running",
|
||||||
"forcebuy_enable": false,
|
"forcebuy_enable": false,
|
||||||
"internals": {
|
"internals": {
|
||||||
|
|||||||
@@ -2,10 +2,14 @@
|
|||||||
"max_open_trades": 3,
|
"max_open_trades": 3,
|
||||||
"stake_currency": "BTC",
|
"stake_currency": "BTC",
|
||||||
"stake_amount": 0.05,
|
"stake_amount": 0.05,
|
||||||
|
"tradable_balance_ratio": 0.99,
|
||||||
"fiat_display_currency": "USD",
|
"fiat_display_currency": "USD",
|
||||||
"amount_reserve_percent" : 0.05,
|
"amount_reserve_percent": 0.05,
|
||||||
|
"amend_last_stake_amount": false,
|
||||||
|
"last_stake_amount_min_ratio": 0.5,
|
||||||
"dry_run": false,
|
"dry_run": false,
|
||||||
"ticker_interval": "5m",
|
"cancel_open_orders_on_exit": false,
|
||||||
|
"timeframe": "5m",
|
||||||
"trailing_stop": false,
|
"trailing_stop": false,
|
||||||
"trailing_stop_positive": 0.005,
|
"trailing_stop_positive": 0.005,
|
||||||
"trailing_stop_positive_offset": 0.0051,
|
"trailing_stop_positive_offset": 0.0051,
|
||||||
@@ -22,6 +26,7 @@
|
|||||||
"sell": 30
|
"sell": 30
|
||||||
},
|
},
|
||||||
"bid_strategy": {
|
"bid_strategy": {
|
||||||
|
"price_side": "bid",
|
||||||
"use_order_book": false,
|
"use_order_book": false,
|
||||||
"ask_last_balance": 0.0,
|
"ask_last_balance": 0.0,
|
||||||
"order_book_top": 1,
|
"order_book_top": 1,
|
||||||
@@ -31,9 +36,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ask_strategy":{
|
"ask_strategy":{
|
||||||
|
"price_side": "ask",
|
||||||
"use_order_book": false,
|
"use_order_book": false,
|
||||||
"order_book_min": 1,
|
"order_book_min": 1,
|
||||||
"order_book_max": 9,
|
"order_book_max": 1,
|
||||||
"use_sell_signal": true,
|
"use_sell_signal": true,
|
||||||
"sell_profit_only": false,
|
"sell_profit_only": false,
|
||||||
"ignore_roi_if_buy_signal": false
|
"ignore_roi_if_buy_signal": false
|
||||||
@@ -50,14 +56,19 @@
|
|||||||
"buy": "gtc",
|
"buy": "gtc",
|
||||||
"sell": "gtc"
|
"sell": "gtc"
|
||||||
},
|
},
|
||||||
"pairlist": {
|
"pairlists": [
|
||||||
"method": "VolumePairList",
|
{"method": "StaticPairList"},
|
||||||
"config": {
|
{
|
||||||
|
"method": "VolumePairList",
|
||||||
"number_assets": 20,
|
"number_assets": 20,
|
||||||
"sort_key": "quoteVolume",
|
"sort_key": "quoteVolume",
|
||||||
"precision_filter": false
|
"refresh_period": 1800
|
||||||
}
|
},
|
||||||
},
|
{"method": "AgeFilter", "min_days_listed": 10},
|
||||||
|
{"method": "PrecisionFilter"},
|
||||||
|
{"method": "PriceFilter", "low_price_ratio": 0.01, "min_price": 0.00000010},
|
||||||
|
{"method": "SpreadFilter", "max_spread_ratio": 0.005}
|
||||||
|
],
|
||||||
"exchange": {
|
"exchange": {
|
||||||
"name": "bittrex",
|
"name": "bittrex",
|
||||||
"sandbox": false,
|
"sandbox": false,
|
||||||
@@ -92,7 +103,6 @@
|
|||||||
"enabled": false,
|
"enabled": false,
|
||||||
"process_throttle_secs": 3600,
|
"process_throttle_secs": 3600,
|
||||||
"calculate_since_number_of_days": 7,
|
"calculate_since_number_of_days": 7,
|
||||||
"capital_available_percentage": 0.5,
|
|
||||||
"allowed_risk": 0.01,
|
"allowed_risk": 0.01,
|
||||||
"stoploss_range_min": -0.01,
|
"stoploss_range_min": -0.01,
|
||||||
"stoploss_range_max": -0.1,
|
"stoploss_range_max": -0.1,
|
||||||
@@ -106,12 +116,24 @@
|
|||||||
"telegram": {
|
"telegram": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"token": "your_telegram_token",
|
"token": "your_telegram_token",
|
||||||
"chat_id": "your_telegram_chat_id"
|
"chat_id": "your_telegram_chat_id",
|
||||||
|
"notification_settings": {
|
||||||
|
"status": "on",
|
||||||
|
"warning": "on",
|
||||||
|
"startup": "on",
|
||||||
|
"buy": "on",
|
||||||
|
"sell": "on",
|
||||||
|
"buy_cancel": "on",
|
||||||
|
"sell_cancel": "on"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"api_server": {
|
"api_server": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"listen_ip_address": "127.0.0.1",
|
"listen_ip_address": "127.0.0.1",
|
||||||
"listen_port": 8080,
|
"listen_port": 8080,
|
||||||
|
"verbosity": "info",
|
||||||
|
"jwt_secret_key": "somethingrandom",
|
||||||
|
"CORS_origins": [],
|
||||||
"username": "freqtrader",
|
"username": "freqtrader",
|
||||||
"password": "SuperSecurePassword"
|
"password": "SuperSecurePassword"
|
||||||
},
|
},
|
||||||
@@ -122,6 +144,9 @@
|
|||||||
"process_throttle_secs": 5,
|
"process_throttle_secs": 5,
|
||||||
"heartbeat_interval": 60
|
"heartbeat_interval": 60
|
||||||
},
|
},
|
||||||
|
"disable_dataframe_checks": false,
|
||||||
"strategy": "DefaultStrategy",
|
"strategy": "DefaultStrategy",
|
||||||
"strategy_path": "user_data/strategies/"
|
"strategy_path": "user_data/strategies/",
|
||||||
|
"dataformat_ohlcv": "json",
|
||||||
|
"dataformat_trades": "jsongz"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,11 @@
|
|||||||
"max_open_trades": 5,
|
"max_open_trades": 5,
|
||||||
"stake_currency": "EUR",
|
"stake_currency": "EUR",
|
||||||
"stake_amount": 10,
|
"stake_amount": 10,
|
||||||
|
"tradable_balance_ratio": 0.99,
|
||||||
"fiat_display_currency": "EUR",
|
"fiat_display_currency": "EUR",
|
||||||
"ticker_interval" : "5m",
|
"timeframe": "5m",
|
||||||
"dry_run": true,
|
"dry_run": true,
|
||||||
"trailing_stop": false,
|
"cancel_open_orders_on_exit": false,
|
||||||
"unfilledtimeout": {
|
"unfilledtimeout": {
|
||||||
"buy": 10,
|
"buy": 10,
|
||||||
"sell": 30
|
"sell": 30
|
||||||
@@ -22,7 +23,7 @@
|
|||||||
"ask_strategy":{
|
"ask_strategy":{
|
||||||
"use_order_book": false,
|
"use_order_book": false,
|
||||||
"order_book_min": 1,
|
"order_book_min": 1,
|
||||||
"order_book_max": 9,
|
"order_book_max": 1,
|
||||||
"use_sell_signal": true,
|
"use_sell_signal": true,
|
||||||
"sell_profit_only": false,
|
"sell_profit_only": false,
|
||||||
"ignore_roi_if_buy_signal": false
|
"ignore_roi_if_buy_signal": false
|
||||||
@@ -38,19 +39,38 @@
|
|||||||
"rateLimit": 1000
|
"rateLimit": 1000
|
||||||
},
|
},
|
||||||
"pair_whitelist": [
|
"pair_whitelist": [
|
||||||
"ETH/EUR",
|
"ADA/EUR",
|
||||||
|
"ATOM/EUR",
|
||||||
|
"BAT/EUR",
|
||||||
|
"BCH/EUR",
|
||||||
"BTC/EUR",
|
"BTC/EUR",
|
||||||
"BCH/EUR"
|
"DAI/EUR",
|
||||||
|
"DASH/EUR",
|
||||||
|
"EOS/EUR",
|
||||||
|
"ETC/EUR",
|
||||||
|
"ETH/EUR",
|
||||||
|
"LINK/EUR",
|
||||||
|
"LTC/EUR",
|
||||||
|
"QTUM/EUR",
|
||||||
|
"REP/EUR",
|
||||||
|
"WAVES/EUR",
|
||||||
|
"XLM/EUR",
|
||||||
|
"XMR/EUR",
|
||||||
|
"XRP/EUR",
|
||||||
|
"XTZ/EUR",
|
||||||
|
"ZEC/EUR"
|
||||||
],
|
],
|
||||||
"pair_blacklist": [
|
"pair_blacklist": [
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"pairlists": [
|
||||||
|
{"method": "StaticPairList"}
|
||||||
|
],
|
||||||
"edge": {
|
"edge": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"process_throttle_secs": 3600,
|
"process_throttle_secs": 3600,
|
||||||
"calculate_since_number_of_days": 7,
|
"calculate_since_number_of_days": 7,
|
||||||
"capital_available_percentage": 0.5,
|
|
||||||
"allowed_risk": 0.01,
|
"allowed_risk": 0.01,
|
||||||
"stoploss_range_min": -0.01,
|
"stoploss_range_min": -0.01,
|
||||||
"stoploss_range_max": -0.1,
|
"stoploss_range_max": -0.1,
|
||||||
@@ -66,6 +86,16 @@
|
|||||||
"token": "your_telegram_token",
|
"token": "your_telegram_token",
|
||||||
"chat_id": "your_telegram_chat_id"
|
"chat_id": "your_telegram_chat_id"
|
||||||
},
|
},
|
||||||
|
"api_server": {
|
||||||
|
"enabled": false,
|
||||||
|
"listen_ip_address": "127.0.0.1",
|
||||||
|
"listen_port": 8080,
|
||||||
|
"verbosity": "info",
|
||||||
|
"jwt_secret_key": "somethingrandom",
|
||||||
|
"CORS_origins": [],
|
||||||
|
"username": "",
|
||||||
|
"password": ""
|
||||||
|
},
|
||||||
"initial_state": "running",
|
"initial_state": "running",
|
||||||
"forcebuy_enable": false,
|
"forcebuy_enable": false,
|
||||||
"internals": {
|
"internals": {
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
version: '3'
|
|
||||||
services:
|
|
||||||
freqtrade_develop:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: "./Dockerfile.develop"
|
|
||||||
volumes:
|
|
||||||
- ".:/freqtrade"
|
|
||||||
entrypoint:
|
|
||||||
- "freqtrade"
|
|
||||||
|
|
||||||
freqtrade_bash:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: "./Dockerfile.develop"
|
|
||||||
volumes:
|
|
||||||
- ".:/freqtrade"
|
|
||||||
entrypoint:
|
|
||||||
- "/bin/bash"
|
|
||||||
@@ -2,7 +2,22 @@
|
|||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
freqtrade:
|
freqtrade:
|
||||||
image: freqtradeorg/freqtrade:master
|
image: freqtradeorg/freqtrade:stable
|
||||||
|
# image: freqtradeorg/freqtrade:develop
|
||||||
|
# Use plotting image
|
||||||
|
# image: freqtradeorg/freqtrade:develop_plot
|
||||||
|
# Build step - only needed when additional dependencies are needed
|
||||||
|
# build:
|
||||||
|
# context: .
|
||||||
|
# dockerfile: "./Dockerfile.technical"
|
||||||
|
restart: unless-stopped
|
||||||
|
container_name: freqtrade
|
||||||
volumes:
|
volumes:
|
||||||
- "./user_data:/freqtrade/user_data"
|
- "./user_data:/freqtrade/user_data"
|
||||||
- "./config.json:/freqtrade/config.json"
|
# Default command used when running `docker compose up`
|
||||||
|
command: >
|
||||||
|
trade
|
||||||
|
--logfile /freqtrade/user_data/logs/freqtrade.log
|
||||||
|
--db-url sqlite:////freqtrade/user_data/tradesv3.sqlite
|
||||||
|
--config /freqtrade/user_data/config.json
|
||||||
|
--strategy SampleStrategy
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ FROM freqtradeorg/freqtrade:develop
|
|||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
COPY requirements-dev.txt /freqtrade/
|
COPY requirements-dev.txt /freqtrade/
|
||||||
|
|
||||||
RUN pip install numpy --no-cache-dir \
|
RUN pip install numpy --no-cache-dir \
|
||||||
&& pip install -r requirements-dev.txt --no-cache-dir
|
&& pip install -r requirements-dev.txt --no-cache-dir
|
||||||
|
|
||||||
7
docker/Dockerfile.jupyter
Normal file
7
docker/Dockerfile.jupyter
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
FROM freqtradeorg/freqtrade:develop_plot
|
||||||
|
|
||||||
|
|
||||||
|
RUN pip install jupyterlab --no-cache-dir
|
||||||
|
|
||||||
|
# Empty the ENTRYPOINT to allow all commands
|
||||||
|
ENTRYPOINT []
|
||||||
10
docker/Dockerfile.plot
Normal file
10
docker/Dockerfile.plot
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
ARG sourceimage=develop
|
||||||
|
FROM freqtradeorg/freqtrade:${sourceimage}
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
COPY requirements-plot.txt /freqtrade/
|
||||||
|
|
||||||
|
RUN pip install -r requirements-plot.txt --no-cache-dir
|
||||||
|
|
||||||
|
# Empty the ENTRYPOINT to allow all commands
|
||||||
|
ENTRYPOINT []
|
||||||
16
docker/docker-compose-jupyter.yml
Normal file
16
docker/docker-compose-jupyter.yml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
ft_jupyterlab:
|
||||||
|
build:
|
||||||
|
context: ..
|
||||||
|
dockerfile: docker/Dockerfile.jupyter
|
||||||
|
restart: unless-stopped
|
||||||
|
container_name: freqtrade
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:8888:8888"
|
||||||
|
volumes:
|
||||||
|
- "./user_data:/freqtrade/user_data"
|
||||||
|
# Default command used when running `docker compose up`
|
||||||
|
command: >
|
||||||
|
jupyter lab --port=8888 --ip 0.0.0.0 --allow-root
|
||||||
91
docs/advanced-hyperopt.md
Normal file
91
docs/advanced-hyperopt.md
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
# Advanced Hyperopt
|
||||||
|
|
||||||
|
This page explains some advanced Hyperopt topics that may require higher
|
||||||
|
coding skills and Python knowledge than creation of an ordinal hyperoptimization
|
||||||
|
class.
|
||||||
|
|
||||||
|
## Derived hyperopt classes
|
||||||
|
|
||||||
|
Custom hyperop classes can be derived in the same way [it can be done for strategies](strategy-customization.md#derived-strategies).
|
||||||
|
|
||||||
|
Applying to hyperoptimization, as an example, you may override how dimensions are defined in your optimization hyperspace:
|
||||||
|
|
||||||
|
```python
|
||||||
|
class MyAwesomeHyperOpt(IHyperOpt):
|
||||||
|
...
|
||||||
|
# Uses default stoploss dimension
|
||||||
|
|
||||||
|
class MyAwesomeHyperOpt2(MyAwesomeHyperOpt):
|
||||||
|
@staticmethod
|
||||||
|
def stoploss_space() -> List[Dimension]:
|
||||||
|
# Override boundaries for stoploss
|
||||||
|
return [
|
||||||
|
Real(-0.33, -0.01, name='stoploss'),
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
and then quickly switch between hyperopt classes, running optimization process with hyperopt class you need in each particular case:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ freqtrade hyperopt --hyperopt MyAwesomeHyperOpt ...
|
||||||
|
or
|
||||||
|
$ freqtrade hyperopt --hyperopt MyAwesomeHyperOpt2 ...
|
||||||
|
```
|
||||||
|
|
||||||
|
## Creating and using a custom loss function
|
||||||
|
|
||||||
|
To use a custom loss function class, make sure that the function `hyperopt_loss_function` is defined in your custom hyperopt loss class.
|
||||||
|
For the sample below, you then need to add the command line parameter `--hyperopt-loss SuperDuperHyperOptLoss` to your hyperopt call so this function is being used.
|
||||||
|
|
||||||
|
A sample of this can be found below, which is identical to the Default Hyperopt loss implementation. A full sample can be found in [userdata/hyperopts](https://github.com/freqtrade/freqtrade/blob/develop/freqtrade/templates/sample_hyperopt_loss.py).
|
||||||
|
|
||||||
|
``` python
|
||||||
|
from freqtrade.optimize.hyperopt import IHyperOptLoss
|
||||||
|
|
||||||
|
TARGET_TRADES = 600
|
||||||
|
EXPECTED_MAX_PROFIT = 3.0
|
||||||
|
MAX_ACCEPTED_TRADE_DURATION = 300
|
||||||
|
|
||||||
|
class SuperDuperHyperOptLoss(IHyperOptLoss):
|
||||||
|
"""
|
||||||
|
Defines the default loss function for hyperopt
|
||||||
|
"""
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def hyperopt_loss_function(results: DataFrame, trade_count: int,
|
||||||
|
min_date: datetime, max_date: datetime,
|
||||||
|
*args, **kwargs) -> float:
|
||||||
|
"""
|
||||||
|
Objective function, returns smaller number for better results
|
||||||
|
This is the legacy algorithm (used until now in freqtrade).
|
||||||
|
Weights are distributed as follows:
|
||||||
|
* 0.4 to trade duration
|
||||||
|
* 0.25: Avoiding trade loss
|
||||||
|
* 1.0 to total profit, compared to the expected value (`EXPECTED_MAX_PROFIT`) defined above
|
||||||
|
"""
|
||||||
|
total_profit = results['profit_percent'].sum()
|
||||||
|
trade_duration = results['trade_duration'].mean()
|
||||||
|
|
||||||
|
trade_loss = 1 - 0.25 * exp(-(trade_count - TARGET_TRADES) ** 2 / 10 ** 5.8)
|
||||||
|
profit_loss = max(0, 1 - total_profit / EXPECTED_MAX_PROFIT)
|
||||||
|
duration_loss = 0.4 * min(trade_duration / MAX_ACCEPTED_TRADE_DURATION, 1)
|
||||||
|
result = trade_loss + profit_loss + duration_loss
|
||||||
|
return result
|
||||||
|
```
|
||||||
|
|
||||||
|
Currently, the arguments are:
|
||||||
|
|
||||||
|
* `results`: DataFrame containing the result
|
||||||
|
The following columns are available in results (corresponds to the output-file of backtesting when used with `--export trades`):
|
||||||
|
`pair, profit_percent, profit_abs, open_time, close_time, open_index, close_index, trade_duration, open_at_end, open_rate, close_rate, sell_reason`
|
||||||
|
* `trade_count`: Amount of trades (identical to `len(results)`)
|
||||||
|
* `min_date`: Start date of the hyperopting TimeFrame
|
||||||
|
* `min_date`: End date of the hyperopting TimeFrame
|
||||||
|
|
||||||
|
This function needs to return a floating point number (`float`). Smaller numbers will be interpreted as better results. The parameters and balancing for this is up to you.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
This function is called once per iteration - so please make sure to have this as optimized as possible to not slow hyperopt down unnecessarily.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
Please keep the arguments `*args` and `**kwargs` in the interface to allow us to extend this interface later.
|
||||||
140
docs/advanced-setup.md
Normal file
140
docs/advanced-setup.md
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
# Advanced Post-installation Tasks
|
||||||
|
|
||||||
|
This page explains some advanced tasks and configuration options that can be performed after the bot installation and may be uselful in some environments.
|
||||||
|
|
||||||
|
If you do not know what things mentioned here mean, you probably do not need it.
|
||||||
|
|
||||||
|
## Running multiple instances of Freqtrade
|
||||||
|
|
||||||
|
This section will show you how to run multiple bots at the same time, on the same machine.
|
||||||
|
|
||||||
|
### Things to consider
|
||||||
|
|
||||||
|
* Use different database files.
|
||||||
|
* Use different Telegram bots (requires multiple different configuration files; applies only when Telegram is enabled).
|
||||||
|
* Use different ports (applies only when Freqtrade REST API webserver is enabled).
|
||||||
|
|
||||||
|
### Different database files
|
||||||
|
|
||||||
|
In order to keep track of your trades, profits, etc., freqtrade is using a SQLite database where it stores various types of information such as the trades you performed in the past and the current position(s) you are holding at any time. This allows you to keep track of your profits, but most importantly, keep track of ongoing activity if the bot process would be restarted or would be terminated unexpectedly.
|
||||||
|
|
||||||
|
Freqtrade will, by default, use separate database files for dry-run and live bots (this assumes no database-url is given in either configuration nor via command line argument).
|
||||||
|
For live trading mode, the default database will be `tradesv3.sqlite` and for dry-run it will be `tradesv3.dryrun.sqlite`.
|
||||||
|
|
||||||
|
The optional argument to the trade command used to specify the path of these files is `--db-url`, which requires a valid SQLAlchemy url.
|
||||||
|
So when you are starting a bot with only the config and strategy arguments in dry-run mode, the following 2 commands would have the same outcome.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
freqtrade trade -c MyConfig.json -s MyStrategy
|
||||||
|
# is equivalent to
|
||||||
|
freqtrade trade -c MyConfig.json -s MyStrategy --db-url sqlite:///tradesv3.dryrun.sqlite
|
||||||
|
```
|
||||||
|
|
||||||
|
It means that if you are running the trade command in two different terminals, for example to test your strategy both for trades in USDT and in another instance for trades in BTC, you will have to run them with different databases.
|
||||||
|
|
||||||
|
If you specify the URL of a database which does not exist, freqtrade will create one with the name you specified. So to test your custom strategy with BTC and USDT stake currencies, you could use the following commands (in 2 separate terminals):
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
# Terminal 1:
|
||||||
|
freqtrade trade -c MyConfigBTC.json -s MyCustomStrategy --db-url sqlite:///user_data/tradesBTC.dryrun.sqlite
|
||||||
|
# Terminal 2:
|
||||||
|
freqtrade trade -c MyConfigUSDT.json -s MyCustomStrategy --db-url sqlite:///user_data/tradesUSDT.dryrun.sqlite
|
||||||
|
```
|
||||||
|
|
||||||
|
Conversely, if you wish to do the same thing in production mode, you will also have to create at least one new database (in addition to the default one) and specify the path to the "live" databases, for example:
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
# Terminal 1:
|
||||||
|
freqtrade trade -c MyConfigBTC.json -s MyCustomStrategy --db-url sqlite:///user_data/tradesBTC.live.sqlite
|
||||||
|
# Terminal 2:
|
||||||
|
freqtrade trade -c MyConfigUSDT.json -s MyCustomStrategy --db-url sqlite:///user_data/tradesUSDT.live.sqlite
|
||||||
|
```
|
||||||
|
|
||||||
|
For more information regarding usage of the sqlite databases, for example to manually enter or remove trades, please refer to the [SQL Cheatsheet](sql_cheatsheet.md).
|
||||||
|
|
||||||
|
## Configure the bot running as a systemd service
|
||||||
|
|
||||||
|
Copy the `freqtrade.service` file to your systemd user directory (usually `~/.config/systemd/user`) and update `WorkingDirectory` and `ExecStart` to match your setup.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
Certain systems (like Raspbian) don't load service unit files from the user directory. In this case, copy `freqtrade.service` into `/etc/systemd/user/` (requires superuser permissions).
|
||||||
|
|
||||||
|
After that you can start the daemon with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
systemctl --user start freqtrade
|
||||||
|
```
|
||||||
|
|
||||||
|
For this to be persistent (run when user is logged out) you'll need to enable `linger` for your freqtrade user.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo loginctl enable-linger "$USER"
|
||||||
|
```
|
||||||
|
|
||||||
|
If you run the bot as a service, you can use systemd service manager as a software watchdog monitoring freqtrade bot
|
||||||
|
state and restarting it in the case of failures. If the `internals.sd_notify` parameter is set to true in the
|
||||||
|
configuration or the `--sd-notify` command line option is used, the bot will send keep-alive ping messages to systemd
|
||||||
|
using the sd_notify (systemd notifications) protocol and will also tell systemd its current state (Running or Stopped)
|
||||||
|
when it changes.
|
||||||
|
|
||||||
|
The `freqtrade.service.watchdog` file contains an example of the service unit configuration file which uses systemd
|
||||||
|
as the watchdog.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
The sd_notify communication between the bot and the systemd service manager will not work if the bot runs in a Docker container.
|
||||||
|
|
||||||
|
## Advanced Logging
|
||||||
|
|
||||||
|
On many Linux systems the bot can be configured to send its log messages to `syslog` or `journald` system services. Logging to a remote `syslog` server is also available on Windows. The special values for the `--logfile` command line option can be used for this.
|
||||||
|
|
||||||
|
### Logging to syslog
|
||||||
|
|
||||||
|
To send Freqtrade log messages to a local or remote `syslog` service use the `--logfile` command line option with the value in the following format:
|
||||||
|
|
||||||
|
* `--logfile syslog:<syslog_address>` -- send log messages to `syslog` service using the `<syslog_address>` as the syslog address.
|
||||||
|
|
||||||
|
The syslog address can be either a Unix domain socket (socket filename) or a UDP socket specification, consisting of IP address and UDP port, separated by the `:` character.
|
||||||
|
|
||||||
|
So, the following are the examples of possible usages:
|
||||||
|
|
||||||
|
* `--logfile syslog:/dev/log` -- log to syslog (rsyslog) using the `/dev/log` socket, suitable for most systems.
|
||||||
|
* `--logfile syslog` -- same as above, the shortcut for `/dev/log`.
|
||||||
|
* `--logfile syslog:/var/run/syslog` -- log to syslog (rsyslog) using the `/var/run/syslog` socket. Use this on MacOS.
|
||||||
|
* `--logfile syslog:localhost:514` -- log to local syslog using UDP socket, if it listens on port 514.
|
||||||
|
* `--logfile syslog:<ip>:514` -- log to remote syslog at IP address and port 514. This may be used on Windows for remote logging to an external syslog server.
|
||||||
|
|
||||||
|
Log messages are send to `syslog` with the `user` facility. So you can see them with the following commands:
|
||||||
|
|
||||||
|
* `tail -f /var/log/user`, or
|
||||||
|
* install a comprehensive graphical viewer (for instance, 'Log File Viewer' for Ubuntu).
|
||||||
|
|
||||||
|
On many systems `syslog` (`rsyslog`) fetches data from `journald` (and vice versa), so both `--logfile syslog` or `--logfile journald` can be used and the messages be viewed with both `journalctl` and a syslog viewer utility. You can combine this in any way which suites you better.
|
||||||
|
|
||||||
|
For `rsyslog` the messages from the bot can be redirected into a separate dedicated log file. To achieve this, add
|
||||||
|
```
|
||||||
|
if $programname startswith "freqtrade" then -/var/log/freqtrade.log
|
||||||
|
```
|
||||||
|
to one of the rsyslog configuration files, for example at the end of the `/etc/rsyslog.d/50-default.conf`.
|
||||||
|
|
||||||
|
For `syslog` (`rsyslog`), the reduction mode can be switched on. This will reduce the number of repeating messages. For instance, multiple bot Heartbeat messages will be reduced to a single message when nothing else happens with the bot. To achieve this, set in `/etc/rsyslog.conf`:
|
||||||
|
```
|
||||||
|
# Filter duplicated messages
|
||||||
|
$RepeatedMsgReduction on
|
||||||
|
```
|
||||||
|
|
||||||
|
### Logging to journald
|
||||||
|
|
||||||
|
This needs the `systemd` python package installed as the dependency, which is not available on Windows. Hence, the whole journald logging functionality is not available for a bot running on Windows.
|
||||||
|
|
||||||
|
To send Freqtrade log messages to `journald` system service use the `--logfile` command line option with the value in the following format:
|
||||||
|
|
||||||
|
* `--logfile journald` -- send log messages to `journald`.
|
||||||
|
|
||||||
|
Log messages are send to `journald` with the `user` facility. So you can see them with the following commands:
|
||||||
|
|
||||||
|
* `journalctl -f` -- shows Freqtrade log messages sent to `journald` along with other log messages fetched by `journald`.
|
||||||
|
* `journalctl -f -u freqtrade.service` -- this command can be used when the bot is run as a `systemd` service.
|
||||||
|
|
||||||
|
There are many other options in the `journalctl` utility to filter the messages, see manual pages for this utility.
|
||||||
|
|
||||||
|
On many systems `syslog` (`rsyslog`) fetches data from `journald` (and vice versa), so both `--logfile syslog` or `--logfile journald` can be used and the messages be viewed with both `journalctl` and a syslog viewer utility. You can combine this in any way which suites you better.
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 173 KiB After Width: | Height: | Size: 211 KiB |
BIN
docs/assets/plot-dataframe2.png
Normal file
BIN
docs/assets/plot-dataframe2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 190 KiB |
@@ -11,29 +11,34 @@ Now you have good Buy and Sell strategies and some historic data, you want to te
|
|||||||
real data. This is what we call
|
real data. This is what we call
|
||||||
[backtesting](https://en.wikipedia.org/wiki/Backtesting).
|
[backtesting](https://en.wikipedia.org/wiki/Backtesting).
|
||||||
|
|
||||||
Backtesting will use the crypto-currencies (pairs) from your config file
|
Backtesting will use the crypto-currencies (pairs) from your config file and load historical candle (OHCLV) data from `user_data/data/<exchange>` by default.
|
||||||
and load ticker data from `user_data/data/<exchange>` by default.
|
If no data is available for the exchange / pair / timeframe combination, backtesting will ask you to download them first using `freqtrade download-data`.
|
||||||
If no data is available for the exchange / pair / ticker interval combination, backtesting will
|
|
||||||
ask you to download them first using `freqtrade download-data`.
|
|
||||||
For details on downloading, please refer to the [Data Downloading](data-download.md) section in the documentation.
|
For details on downloading, please refer to the [Data Downloading](data-download.md) section in the documentation.
|
||||||
|
|
||||||
The result of backtesting will confirm if your bot has better odds of making a profit than a loss.
|
The result of backtesting will confirm if your bot has better odds of making a profit than a loss.
|
||||||
|
|
||||||
|
!!! Warning "Using dynamic pairlists for backtesting"
|
||||||
|
Using dynamic pairlists is possible, however it relies on the current market conditions - which will not reflect the historic status of the pairlist.
|
||||||
|
Also, when using pairlists other than StaticPairlist, reproducability of backtesting-results cannot be guaranteed.
|
||||||
|
Please read the [pairlists documentation](configuration.md#pairlists) for more information.
|
||||||
|
|
||||||
|
To achieve reproducible results, best generate a pairlist via the [`test-pairlist`](utils.md#test-pairlist) command and use that as static pairlist.
|
||||||
|
|
||||||
### Run a backtesting against the currencies listed in your config file
|
### Run a backtesting against the currencies listed in your config file
|
||||||
|
|
||||||
#### With 5 min tickers (Per default)
|
#### With 5 min candle (OHLCV) data (per default)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
freqtrade backtesting
|
freqtrade backtesting
|
||||||
```
|
```
|
||||||
|
|
||||||
#### With 1 min tickers
|
#### With 1 min candle (OHLCV) data
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
freqtrade backtesting --ticker-interval 1m
|
freqtrade backtesting --timeframe 1m
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Using a different on-disk ticker-data source
|
#### Using a different on-disk historical candle (OHLCV) data source
|
||||||
|
|
||||||
Assume you downloaded the history data from the Bittrex exchange and kept it in the `user_data/data/bittrex-20180101` directory.
|
Assume you downloaded the history data from the Bittrex exchange and kept it in the `user_data/data/bittrex-20180101` directory.
|
||||||
You can then use this data for backtesting as follows:
|
You can then use this data for backtesting as follows:
|
||||||
@@ -45,7 +50,7 @@ freqtrade --datadir user_data/data/bittrex-20180101 backtesting
|
|||||||
#### With a (custom) strategy file
|
#### With a (custom) strategy file
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
freqtrade -s SampleStrategy backtesting
|
freqtrade backtesting -s SampleStrategy
|
||||||
```
|
```
|
||||||
|
|
||||||
Where `-s SampleStrategy` refers to the class name within the strategy file `sample_strategy.py` found in the `freqtrade/user_data/strategies` directory.
|
Where `-s SampleStrategy` refers to the class name within the strategy file `sample_strategy.py` found in the `freqtrade/user_data/strategies` directory.
|
||||||
@@ -53,7 +58,7 @@ Where `-s SampleStrategy` refers to the class name within the strategy file `sam
|
|||||||
#### Comparing multiple Strategies
|
#### Comparing multiple Strategies
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
freqtrade backtesting --strategy-list SampleStrategy1 AwesomeStrategy --ticker-interval 5m
|
freqtrade backtesting --strategy-list SampleStrategy1 AwesomeStrategy --timeframe 5m
|
||||||
```
|
```
|
||||||
|
|
||||||
Where `SampleStrategy1` and `AwesomeStrategy` refer to class names of strategies.
|
Where `SampleStrategy1` and `AwesomeStrategy` refer to class names of strategies.
|
||||||
@@ -61,7 +66,7 @@ Where `SampleStrategy1` and `AwesomeStrategy` refer to class names of strategies
|
|||||||
#### Exporting trades to file
|
#### Exporting trades to file
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
freqtrade backtesting --export trades
|
freqtrade backtesting --export trades --config config.json --strategy SampleStrategy
|
||||||
```
|
```
|
||||||
|
|
||||||
The exported trades can be used for [further analysis](#further-backtest-result-analysis), or can be used by the plotting script `plot_dataframe.py` in the scripts directory.
|
The exported trades can be used for [further analysis](#further-backtest-result-analysis), or can be used by the plotting script `plot_dataframe.py` in the scripts directory.
|
||||||
@@ -72,16 +77,22 @@ The exported trades can be used for [further analysis](#further-backtest-result-
|
|||||||
freqtrade backtesting --export trades --export-filename=backtest_samplestrategy.json
|
freqtrade backtesting --export trades --export-filename=backtest_samplestrategy.json
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Please also read about the [strategy startup period](strategy-customization.md#strategy-startup-period).
|
||||||
|
|
||||||
#### Supplying custom fee value
|
#### Supplying custom fee value
|
||||||
|
|
||||||
Sometimes your account has certain fee rebates (fee reductions starting with a certain account size or monthly volume), which are not visible to ccxt.
|
Sometimes your account has certain fee rebates (fee reductions starting with a certain account size or monthly volume), which are not visible to ccxt.
|
||||||
To account for this in backtesting, you can use `--fee 0.001` to supply this value to backtesting.
|
To account for this in backtesting, you can use the `--fee` command line option to supply this value to backtesting.
|
||||||
This fee must be a percentage, and will be applied twice (once for trade entry, and once for trade exit).
|
This fee must be a ratio, and will be applied twice (once for trade entry, and once for trade exit).
|
||||||
|
|
||||||
|
For example, if the buying and selling commission fee is 0.1% (i.e., 0.001 written as ratio), then you would run backtesting as the following:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
freqtrade backtesting --fee 0.001
|
freqtrade backtesting --fee 0.001
|
||||||
```
|
```
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
Only supply this option (or the corresponding configuration parameter) if you want to experiment with different fee values. By default, Backtesting fetches the default fee from the exchange pair/market info.
|
||||||
|
|
||||||
#### Running backtest with smaller testset by using timerange
|
#### Running backtest with smaller testset by using timerange
|
||||||
|
|
||||||
@@ -112,50 +123,66 @@ A backtesting result will look like that:
|
|||||||
|
|
||||||
```
|
```
|
||||||
========================================================= BACKTESTING REPORT ========================================================
|
========================================================= BACKTESTING REPORT ========================================================
|
||||||
| pair | buy count | avg profit % | cum profit % | tot profit BTC | tot profit % | avg duration | profit | loss |
|
| Pair | Buys | Avg Profit % | Cum Profit % | Tot Profit BTC | Tot Profit % | Avg Duration | Wins | Draws | Losses |
|
||||||
|:---------|------------:|---------------:|---------------:|-----------------:|---------------:|:---------------|---------:|-------:|
|
|:---------|-------:|---------------:|---------------:|-----------------:|---------------:|:---------------|------:|-------:|--------:|
|
||||||
| ADA/BTC | 35 | -0.11 | -3.88 | -0.00019428 | -1.94 | 4:35:00 | 14 | 21 |
|
| ADA/BTC | 35 | -0.11 | -3.88 | -0.00019428 | -1.94 | 4:35:00 | 14 | 0 | 21 |
|
||||||
| ARK/BTC | 11 | -0.41 | -4.52 | -0.00022647 | -2.26 | 2:03:00 | 3 | 8 |
|
| ARK/BTC | 11 | -0.41 | -4.52 | -0.00022647 | -2.26 | 2:03:00 | 3 | 0 | 8 |
|
||||||
| BTS/BTC | 32 | 0.31 | 9.78 | 0.00048938 | 4.89 | 5:05:00 | 18 | 14 |
|
| BTS/BTC | 32 | 0.31 | 9.78 | 0.00048938 | 4.89 | 5:05:00 | 18 | 0 | 14 |
|
||||||
| DASH/BTC | 13 | -0.08 | -1.07 | -0.00005343 | -0.53 | 4:39:00 | 6 | 7 |
|
| DASH/BTC | 13 | -0.08 | -1.07 | -0.00005343 | -0.53 | 4:39:00 | 6 | 0 | 7 |
|
||||||
| ENG/BTC | 18 | 1.36 | 24.54 | 0.00122807 | 12.27 | 2:50:00 | 8 | 10 |
|
| ENG/BTC | 18 | 1.36 | 24.54 | 0.00122807 | 12.27 | 2:50:00 | 8 | 0 | 10 |
|
||||||
| EOS/BTC | 36 | 0.08 | 3.06 | 0.00015304 | 1.53 | 3:34:00 | 16 | 20 |
|
| EOS/BTC | 36 | 0.08 | 3.06 | 0.00015304 | 1.53 | 3:34:00 | 16 | 0 | 20 |
|
||||||
| ETC/BTC | 26 | 0.37 | 9.51 | 0.00047576 | 4.75 | 6:14:00 | 11 | 15 |
|
| ETC/BTC | 26 | 0.37 | 9.51 | 0.00047576 | 4.75 | 6:14:00 | 11 | 0 | 15 |
|
||||||
| ETH/BTC | 33 | 0.30 | 9.96 | 0.00049856 | 4.98 | 7:31:00 | 16 | 17 |
|
| ETH/BTC | 33 | 0.30 | 9.96 | 0.00049856 | 4.98 | 7:31:00 | 16 | 0 | 17 |
|
||||||
| IOTA/BTC | 32 | 0.03 | 1.09 | 0.00005444 | 0.54 | 3:12:00 | 14 | 18 |
|
| IOTA/BTC | 32 | 0.03 | 1.09 | 0.00005444 | 0.54 | 3:12:00 | 14 | 0 | 18 |
|
||||||
| LSK/BTC | 15 | 1.75 | 26.26 | 0.00131413 | 13.13 | 2:58:00 | 6 | 9 |
|
| LSK/BTC | 15 | 1.75 | 26.26 | 0.00131413 | 13.13 | 2:58:00 | 6 | 0 | 9 |
|
||||||
| LTC/BTC | 32 | -0.04 | -1.38 | -0.00006886 | -0.69 | 4:49:00 | 11 | 21 |
|
| LTC/BTC | 32 | -0.04 | -1.38 | -0.00006886 | -0.69 | 4:49:00 | 11 | 0 | 21 |
|
||||||
| NANO/BTC | 17 | 1.26 | 21.39 | 0.00107058 | 10.70 | 1:55:00 | 10 | 7 |
|
| NANO/BTC | 17 | 1.26 | 21.39 | 0.00107058 | 10.70 | 1:55:00 | 10 | 0 | 7 |
|
||||||
| NEO/BTC | 23 | 0.82 | 18.97 | 0.00094936 | 9.48 | 2:59:00 | 10 | 13 |
|
| NEO/BTC | 23 | 0.82 | 18.97 | 0.00094936 | 9.48 | 2:59:00 | 10 | 0 | 13 |
|
||||||
| REQ/BTC | 9 | 1.17 | 10.54 | 0.00052734 | 5.27 | 3:47:00 | 4 | 5 |
|
| REQ/BTC | 9 | 1.17 | 10.54 | 0.00052734 | 5.27 | 3:47:00 | 4 | 0 | 5 |
|
||||||
| XLM/BTC | 16 | 1.22 | 19.54 | 0.00097800 | 9.77 | 3:15:00 | 7 | 9 |
|
| XLM/BTC | 16 | 1.22 | 19.54 | 0.00097800 | 9.77 | 3:15:00 | 7 | 0 | 9 |
|
||||||
| XMR/BTC | 23 | -0.18 | -4.13 | -0.00020696 | -2.07 | 5:30:00 | 12 | 11 |
|
| XMR/BTC | 23 | -0.18 | -4.13 | -0.00020696 | -2.07 | 5:30:00 | 12 | 0 | 11 |
|
||||||
| XRP/BTC | 35 | 0.66 | 22.96 | 0.00114897 | 11.48 | 3:49:00 | 12 | 23 |
|
| XRP/BTC | 35 | 0.66 | 22.96 | 0.00114897 | 11.48 | 3:49:00 | 12 | 0 | 23 |
|
||||||
| ZEC/BTC | 22 | -0.46 | -10.18 | -0.00050971 | -5.09 | 2:22:00 | 7 | 15 |
|
| ZEC/BTC | 22 | -0.46 | -10.18 | -0.00050971 | -5.09 | 2:22:00 | 7 | 0 | 15 |
|
||||||
| TOTAL | 429 | 0.36 | 152.41 | 0.00762792 | 76.20 | 4:12:00 | 186 | 243 |
|
| TOTAL | 429 | 0.36 | 152.41 | 0.00762792 | 76.20 | 4:12:00 | 186 | 0 | 243 |
|
||||||
========================================================= SELL REASON STATS =========================================================
|
========================================================= SELL REASON STATS =========================================================
|
||||||
| Sell Reason | Count |
|
| Sell Reason | Sells | Wins | Draws | Losses |
|
||||||
|:-------------------|--------:|
|
|:-------------------|--------:|------:|-------:|--------:|
|
||||||
| trailing_stop_loss | 205 |
|
| trailing_stop_loss | 205 | 150 | 0 | 55 |
|
||||||
| stop_loss | 166 |
|
| stop_loss | 166 | 0 | 0 | 166 |
|
||||||
| sell_signal | 56 |
|
| sell_signal | 56 | 36 | 0 | 20 |
|
||||||
| force_sell | 2 |
|
| force_sell | 2 | 0 | 0 | 2 |
|
||||||
====================================================== LEFT OPEN TRADES REPORT ======================================================
|
====================================================== LEFT OPEN TRADES REPORT ======================================================
|
||||||
| pair | buy count | avg profit % | cum profit % | tot profit BTC | tot profit % | avg duration | profit | loss |
|
| Pair | Buys | Avg Profit % | Cum Profit % | Tot Profit BTC | Tot Profit % | Avg Duration | Wins | Draws | Losses |
|
||||||
|:---------|------------:|---------------:|---------------:|-----------------:|---------------:|:---------------|---------:|-------:|
|
|:---------|-------:|---------------:|---------------:|-----------------:|---------------:|:---------------|------:|-------:|--------:|
|
||||||
| ADA/BTC | 1 | 0.89 | 0.89 | 0.00004434 | 0.44 | 6:00:00 | 1 | 0 |
|
| ADA/BTC | 1 | 0.89 | 0.89 | 0.00004434 | 0.44 | 6:00:00 | 1 | 0 | 0 |
|
||||||
| LTC/BTC | 1 | 0.68 | 0.68 | 0.00003421 | 0.34 | 2:00:00 | 1 | 0 |
|
| LTC/BTC | 1 | 0.68 | 0.68 | 0.00003421 | 0.34 | 2:00:00 | 1 | 0 | 0 |
|
||||||
| TOTAL | 2 | 0.78 | 1.57 | 0.00007855 | 0.78 | 4:00:00 | 2 | 0 |
|
| TOTAL | 2 | 0.78 | 1.57 | 0.00007855 | 0.78 | 4:00:00 | 2 | 0 | 0 |
|
||||||
|
=============== SUMMARY METRICS ===============
|
||||||
|
| Metric | Value |
|
||||||
|
|-----------------------+---------------------|
|
||||||
|
| Backtesting from | 2019-01-01 00:00:00 |
|
||||||
|
| Backtesting to | 2019-05-01 00:00:00 |
|
||||||
|
| Total trades | 429 |
|
||||||
|
| First trade | 2019-01-01 18:30:00 |
|
||||||
|
| First trade Pair | EOS/USDT |
|
||||||
|
| Total Profit % | 152.41% |
|
||||||
|
| Trades per day | 3.575 |
|
||||||
|
| Best day | 25.27% |
|
||||||
|
| Worst day | -30.67% |
|
||||||
|
| Avg. Duration Winners | 4:23:00 |
|
||||||
|
| Avg. Duration Loser | 6:55:00 |
|
||||||
|
| | |
|
||||||
|
| Max Drawdown | 50.63% |
|
||||||
|
| Drawdown Start | 2019-02-15 14:10:00 |
|
||||||
|
| Drawdown End | 2019-04-11 18:15:00 |
|
||||||
|
| Market change | -5.88% |
|
||||||
|
===============================================
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Backtesting report table
|
||||||
|
|
||||||
The 1st table contains all trades the bot made, including "left open trades".
|
The 1st table contains all trades the bot made, including "left open trades".
|
||||||
|
|
||||||
The 2nd table contains a recap of sell reasons.
|
|
||||||
|
|
||||||
The 3rd table contains all trades the bot had to `forcesell` at the end of the backtest period to present a full picture.
|
|
||||||
This is necessary to simulate realistic behaviour, since the backtest period has to end at some point, while realistically, you could leave the bot running forever.
|
|
||||||
These trades are also included in the first table, but are extracted separately for clarity.
|
|
||||||
|
|
||||||
The last line will give you the overall performance of your strategy,
|
The last line will give you the overall performance of your strategy,
|
||||||
here:
|
here:
|
||||||
|
|
||||||
@@ -184,19 +211,75 @@ On the other hand, if you set a too high `minimal_roi` like `"0": 0.55`
|
|||||||
(55%), there is almost no chance that the bot will ever reach this profit.
|
(55%), there is almost no chance that the bot will ever reach this profit.
|
||||||
Hence, keep in mind that your performance is an integral mix of all different elements of the strategy, your configuration, and the crypto-currency pairs you have set up.
|
Hence, keep in mind that your performance is an integral mix of all different elements of the strategy, your configuration, and the crypto-currency pairs you have set up.
|
||||||
|
|
||||||
|
### Sell reasons table
|
||||||
|
|
||||||
|
The 2nd table contains a recap of sell reasons.
|
||||||
|
This table can tell you which area needs some additional work (e.g. all or many of the `sell_signal` trades are losses, so you should work on improving the sell signal, or consider disabling it).
|
||||||
|
|
||||||
|
### Left open trades table
|
||||||
|
|
||||||
|
The 3rd table contains all trades the bot had to `forcesell` at the end of the backtesting period to present you the full picture.
|
||||||
|
This is necessary to simulate realistic behavior, since the backtest period has to end at some point, while realistically, you could leave the bot running forever.
|
||||||
|
These trades are also included in the first table, but are also shown separately in this table for clarity.
|
||||||
|
|
||||||
|
### Summary metrics
|
||||||
|
|
||||||
|
The last element of the backtest report is the summary metrics table.
|
||||||
|
It contains some useful key metrics about performance of your strategy on backtesting data.
|
||||||
|
|
||||||
|
```
|
||||||
|
=============== SUMMARY METRICS ===============
|
||||||
|
| Metric | Value |
|
||||||
|
|-----------------------+---------------------|
|
||||||
|
| Backtesting from | 2019-01-01 00:00:00 |
|
||||||
|
| Backtesting to | 2019-05-01 00:00:00 |
|
||||||
|
| Total trades | 429 |
|
||||||
|
| First trade | 2019-01-01 18:30:00 |
|
||||||
|
| First trade Pair | EOS/USDT |
|
||||||
|
| Total Profit % | 152.41% |
|
||||||
|
| Trades per day | 3.575 |
|
||||||
|
| Best day | 25.27% |
|
||||||
|
| Worst day | -30.67% |
|
||||||
|
| Avg. Duration Winners | 4:23:00 |
|
||||||
|
| Avg. Duration Loser | 6:55:00 |
|
||||||
|
| | |
|
||||||
|
| Max Drawdown | 50.63% |
|
||||||
|
| Drawdown Start | 2019-02-15 14:10:00 |
|
||||||
|
| Drawdown End | 2019-04-11 18:15:00 |
|
||||||
|
| Market change | -5.88% |
|
||||||
|
===============================================
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
- `Total trades`: Identical to the total trades of the backtest output table.
|
||||||
|
- `First trade`: First trade entered.
|
||||||
|
- `First trade pair`: Which pair was part of the first trade.
|
||||||
|
- `Backtesting from` / `Backtesting to`: Backtesting range (usually defined with the `--timerange` option).
|
||||||
|
- `Total Profit %`: Total profit per stake amount. Aligned to the TOTAL column of the first table.
|
||||||
|
- `Trades per day`: Total trades divided by the backtesting duration in days (this will give you information about how many trades to expect from the strategy).
|
||||||
|
- `Best day` / `Worst day`: Best and worst day based on daily profit.
|
||||||
|
- `Avg. Duration Winners` / `Avg. Duration Loser`: Average durations for winning and losing trades.
|
||||||
|
- `Max Drawdown`: Maximum drawdown experienced. For example, the value of 50% means that from highest to subsequent lowest point, a 50% drop was experienced).
|
||||||
|
- `Drawdown Start` / `Drawdown End`: Start and end datetimes for this largest drawdown (can also be visualized via the `plot-dataframe` sub-command).
|
||||||
|
- `Market change`: Change of the market during the backtest period. Calculated as average of all pairs changes from the first to the last candle using the "close" column.
|
||||||
|
|
||||||
### Assumptions made by backtesting
|
### Assumptions made by backtesting
|
||||||
|
|
||||||
Since backtesting lacks some detailed information about what happens within a candle, it needs to take a few assumptions:
|
Since backtesting lacks some detailed information about what happens within a candle, it needs to take a few assumptions:
|
||||||
|
|
||||||
- Buys happen at open-price
|
- Buys happen at open-price
|
||||||
- Sell signal sells happen at open-price of the following candle
|
- Sell signal sells happen at open-price of the following candle
|
||||||
- Low happens before high for stoploss, protecting capital first.
|
- Low happens before high for stoploss, protecting capital first
|
||||||
- ROI sells are compared to high - but the ROI value is used (e.g. ROI = 2%, high=5% - so the sell will be at 2%)
|
- ROI
|
||||||
|
- sells are compared to high - but the ROI value is used (e.g. ROI = 2%, high=5% - so the sell will be at 2%)
|
||||||
|
- sells are never "below the candle", so a ROI of 2% may result in a sell at 2.4% if low was at 2.4% profit
|
||||||
|
- Forcesells caused by `<N>=-1` ROI entries use low as sell value, unless N falls on the candle open (e.g. `120: -1` for 1h candles)
|
||||||
- Stoploss sells happen exactly at stoploss price, even if low was lower
|
- Stoploss sells happen exactly at stoploss price, even if low was lower
|
||||||
- Trailing stoploss
|
- Trailing stoploss
|
||||||
- High happens first - adjusting stoploss
|
- High happens first - adjusting stoploss
|
||||||
- Low uses the adjusted stoploss (so sells with large high-low difference are backtested correctly)
|
- Low uses the adjusted stoploss (so sells with large high-low difference are backtested correctly)
|
||||||
- Sell-reason does not explain if a trade was positive or negative, just what triggered the sell (this can look odd if negative ROI values are used)
|
- Sell-reason does not explain if a trade was positive or negative, just what triggered the sell (this can look odd if negative ROI values are used)
|
||||||
|
- Stoploss (and trailing stoploss) is evaluated before ROI within one candle. So you can often see more trades with the `stoploss` and/or `trailing_stop` sell reason comparing to the results obtained with the same strategy in the Dry Run/Live Trade modes.
|
||||||
|
|
||||||
Taking these assumptions, backtesting tries to mirror real trading as closely as possible. However, backtesting will **never** replace running a strategy in dry-run mode.
|
Taking these assumptions, backtesting tries to mirror real trading as closely as possible. However, backtesting will **never** replace running a strategy in dry-run mode.
|
||||||
Also, keep in mind that past results don't guarantee future success.
|
Also, keep in mind that past results don't guarantee future success.
|
||||||
@@ -212,13 +295,13 @@ You can then load the trades to perform further analysis as shown in our [data a
|
|||||||
|
|
||||||
To compare multiple strategies, a list of Strategies can be provided to backtesting.
|
To compare multiple strategies, a list of Strategies can be provided to backtesting.
|
||||||
|
|
||||||
This is limited to 1 ticker-interval per run, however, data is only loaded once from disk so if you have multiple
|
This is limited to 1 timeframe value per run. However, data is only loaded once from disk so if you have multiple
|
||||||
strategies you'd like to compare, this will give a nice runtime boost.
|
strategies you'd like to compare, this will give a nice runtime boost.
|
||||||
|
|
||||||
All listed Strategies need to be in the same directory.
|
All listed Strategies need to be in the same directory.
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
freqtrade backtesting --timerange 20180401-20180410 --ticker-interval 5m --strategy-list Strategy001 Strategy002 --export trades
|
freqtrade backtesting --timerange 20180401-20180410 --timeframe 5m --strategy-list Strategy001 Strategy002 --export trades
|
||||||
```
|
```
|
||||||
|
|
||||||
This will save the results to `user_data/backtest_results/backtest-result-<strategy>.json`, injecting the strategy-name into the target filename.
|
This will save the results to `user_data/backtest_results/backtest-result-<strategy>.json`, injecting the strategy-name into the target filename.
|
||||||
@@ -226,11 +309,11 @@ There will be an additional table comparing win/losses of the different strategi
|
|||||||
Detailed output for all strategies one after the other will be available, so make sure to scroll up to see the details per strategy.
|
Detailed output for all strategies one after the other will be available, so make sure to scroll up to see the details per strategy.
|
||||||
|
|
||||||
```
|
```
|
||||||
=========================================================== Strategy Summary ===========================================================
|
=========================================================== STRATEGY SUMMARY ===========================================================
|
||||||
| Strategy | buy count | avg profit % | cum profit % | tot profit BTC | tot profit % | avg duration | profit | loss |
|
| Strategy | Buys | Avg Profit % | Cum Profit % | Tot Profit BTC | Tot Profit % | Avg Duration | Wins | Draws | Losses |
|
||||||
|:------------|------------:|---------------:|---------------:|-----------------:|---------------:|:---------------|---------:|-------:|
|
|:------------|-------:|---------------:|---------------:|-----------------:|---------------:|:---------------|------:|-------:|-------:|
|
||||||
| Strategy1 | 429 | 0.36 | 152.41 | 0.00762792 | 76.20 | 4:12:00 | 186 | 243 |
|
| Strategy1 | 429 | 0.36 | 152.41 | 0.00762792 | 76.20 | 4:12:00 | 186 | 0 | 243 |
|
||||||
| Strategy2 | 1487 | -0.13 | -197.58 | -0.00988917 | -98.79 | 4:43:00 | 662 | 825 |
|
| Strategy2 | 1487 | -0.13 | -197.58 | -0.00988917 | -98.79 | 4:43:00 | 662 | 0 | 825 |
|
||||||
```
|
```
|
||||||
|
|
||||||
## Next step
|
## Next step
|
||||||
|
|||||||
58
docs/bot-basics.md
Normal file
58
docs/bot-basics.md
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
# Freqtrade basics
|
||||||
|
|
||||||
|
This page provides you some basic concepts on how Freqtrade works and operates.
|
||||||
|
|
||||||
|
## Freqtrade terminology
|
||||||
|
|
||||||
|
* Trade: Open position.
|
||||||
|
* Open Order: Order which is currently placed on the exchange, and is not yet complete.
|
||||||
|
* Pair: Tradable pair, usually in the format of Quote/Base (e.g. XRP/USDT).
|
||||||
|
* Timeframe: Candle length to use (e.g. `"5m"`, `"1h"`, ...).
|
||||||
|
* Indicators: Technical indicators (SMA, EMA, RSI, ...).
|
||||||
|
* Limit order: Limit orders which execute at the defined limit price or better.
|
||||||
|
* Market order: Guaranteed to fill, may move price depending on the order size.
|
||||||
|
|
||||||
|
## Fee handling
|
||||||
|
|
||||||
|
All profit calculations of Freqtrade include fees. For Backtesting / Hyperopt / Dry-run modes, the exchange default fee is used (lowest tier on the exchange). For live operations, fees are used as applied by the exchange (this includes BNB rebates etc.).
|
||||||
|
|
||||||
|
## Bot execution logic
|
||||||
|
|
||||||
|
Starting freqtrade in dry-run or live mode (using `freqtrade trade`) will start the bot and start the bot iteration loop.
|
||||||
|
By default, loop runs every few seconds (`internals.process_throttle_secs`) and does roughly the following in the following sequence:
|
||||||
|
|
||||||
|
* Fetch open trades from persistence.
|
||||||
|
* Calculate current list of tradable pairs.
|
||||||
|
* Download ohlcv data for the pairlist including all [informative pairs](strategy-customization.md#get-data-for-non-tradeable-pairs)
|
||||||
|
This step is only executed once per Candle to avoid unnecessary network traffic.
|
||||||
|
* Call `bot_loop_start()` strategy callback.
|
||||||
|
* Analyze strategy per pair.
|
||||||
|
* Call `populate_indicators()`
|
||||||
|
* Call `populate_buy_trend()`
|
||||||
|
* Call `populate_sell_trend()`
|
||||||
|
* Check timeouts for open orders.
|
||||||
|
* Calls `check_buy_timeout()` strategy callback for open buy orders.
|
||||||
|
* Calls `check_sell_timeout()` strategy callback for open sell orders.
|
||||||
|
* Verifies existing positions and eventually places sell orders.
|
||||||
|
* Considers stoploss, ROI and sell-signal.
|
||||||
|
* Determine sell-price based on `ask_strategy` configuration setting.
|
||||||
|
* Before a sell order is placed, `confirm_trade_exit()` strategy callback is called.
|
||||||
|
* Check if trade-slots are still available (if `max_open_trades` is reached).
|
||||||
|
* Verifies buy signal trying to enter new positions.
|
||||||
|
* Determine buy-price based on `bid_strategy` configuration setting.
|
||||||
|
* Before a buy order is placed, `confirm_trade_entry()` strategy callback is called.
|
||||||
|
|
||||||
|
This loop will be repeated again and again until the bot is stopped.
|
||||||
|
|
||||||
|
## Backtesting / Hyperopt execution logic
|
||||||
|
|
||||||
|
[backtesting](backtesting.md) or [hyperopt](hyperopt.md) do only part of the above logic, since most of the trading operations are fully simulated.
|
||||||
|
|
||||||
|
* Load historic data for configured pairlist.
|
||||||
|
* Calculate indicators (calls `populate_indicators()`).
|
||||||
|
* Calls `populate_buy_trend()` and `populate_sell_trend()`
|
||||||
|
* Loops per candle simulating entry and exit points.
|
||||||
|
* Generate backtest report output
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
Both Backtesting and Hyperopt include exchange default Fees in the calculation. Custom fees can be passed to backtesting / hyperopt by specifying the `--fee` argument.
|
||||||
@@ -5,52 +5,89 @@ This page explains the different parameters of the bot and how to run it.
|
|||||||
!!! Note
|
!!! Note
|
||||||
If you've used `setup.sh`, don't forget to activate your virtual environment (`source .env/bin/activate`) before running freqtrade commands.
|
If you've used `setup.sh`, don't forget to activate your virtual environment (`source .env/bin/activate`) before running freqtrade commands.
|
||||||
|
|
||||||
|
!!! Warning "Up-to-date clock"
|
||||||
|
The clock on the system running the bot must be accurate, synchronized to a NTP server frequently enough to avoid problems with communication to the exchanges.
|
||||||
|
|
||||||
## Bot commands
|
## Bot commands
|
||||||
|
|
||||||
```
|
```
|
||||||
usage: freqtrade [-h] [-v] [--logfile FILE] [-V] [-c PATH] [-d PATH]
|
usage: freqtrade [-h] [-V]
|
||||||
[--userdir PATH] [-s NAME] [--strategy-path PATH]
|
{trade,create-userdir,new-config,new-hyperopt,new-strategy,download-data,convert-data,convert-trade-data,backtesting,edge,hyperopt,hyperopt-list,hyperopt-show,list-exchanges,list-hyperopts,list-markets,list-pairs,list-strategies,list-timeframes,show-trades,test-pairlist,plot-dataframe,plot-profit}
|
||||||
[--db-url PATH] [--sd-notify]
|
|
||||||
{backtesting,edge,hyperopt,create-userdir,list-exchanges,list-timeframes,download-data,plot-dataframe,plot-profit}
|
|
||||||
...
|
...
|
||||||
|
|
||||||
Free, open source crypto trading bot
|
Free, open source crypto trading bot
|
||||||
|
|
||||||
positional arguments:
|
positional arguments:
|
||||||
{backtesting,edge,hyperopt,create-userdir,list-exchanges,list-timeframes,download-data,plot-dataframe,plot-profit}
|
{trade,create-userdir,new-config,new-hyperopt,new-strategy,download-data,convert-data,convert-trade-data,backtesting,edge,hyperopt,hyperopt-list,hyperopt-show,list-exchanges,list-hyperopts,list-markets,list-pairs,list-strategies,list-timeframes,show-trades,test-pairlist,plot-dataframe,plot-profit}
|
||||||
|
trade Trade module.
|
||||||
|
create-userdir Create user-data directory.
|
||||||
|
new-config Create new config
|
||||||
|
new-hyperopt Create new hyperopt
|
||||||
|
new-strategy Create new strategy
|
||||||
|
download-data Download backtesting data.
|
||||||
|
convert-data Convert candle (OHLCV) data from one format to
|
||||||
|
another.
|
||||||
|
convert-trade-data Convert trade data from one format to another.
|
||||||
backtesting Backtesting module.
|
backtesting Backtesting module.
|
||||||
edge Edge module.
|
edge Edge module.
|
||||||
hyperopt Hyperopt module.
|
hyperopt Hyperopt module.
|
||||||
create-userdir Create user-data directory.
|
hyperopt-list List Hyperopt results
|
||||||
|
hyperopt-show Show details of Hyperopt results
|
||||||
list-exchanges Print available exchanges.
|
list-exchanges Print available exchanges.
|
||||||
list-timeframes Print available ticker intervals (timeframes) for the
|
list-hyperopts Print available hyperopt classes.
|
||||||
exchange.
|
list-markets Print markets on exchange.
|
||||||
download-data Download backtesting data.
|
list-pairs Print pairs on exchange.
|
||||||
|
list-strategies Print available strategies.
|
||||||
|
list-timeframes Print available timeframes for the exchange.
|
||||||
|
show-trades Show trades.
|
||||||
|
test-pairlist Test your pairlist configuration.
|
||||||
plot-dataframe Plot candles with indicators.
|
plot-dataframe Plot candles with indicators.
|
||||||
plot-profit Generate plot showing profits.
|
plot-profit Generate plot showing profits.
|
||||||
|
|
||||||
optional arguments:
|
optional arguments:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
|
-V, --version show program's version number and exit
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Bot trading commands
|
||||||
|
|
||||||
|
```
|
||||||
|
usage: freqtrade trade [-h] [-v] [--logfile FILE] [-V] [-c PATH] [-d PATH]
|
||||||
|
[--userdir PATH] [-s NAME] [--strategy-path PATH]
|
||||||
|
[--db-url PATH] [--sd-notify] [--dry-run]
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
--db-url PATH Override trades database URL, this is useful in custom
|
||||||
|
deployments (default: `sqlite:///tradesv3.sqlite` for
|
||||||
|
Live Run mode, `sqlite:///tradesv3.dryrun.sqlite` for
|
||||||
|
Dry Run).
|
||||||
|
--sd-notify Notify systemd service manager.
|
||||||
|
--dry-run Enforce dry-run for trading (removes Exchange secrets
|
||||||
|
and simulates trades).
|
||||||
|
|
||||||
|
Common arguments:
|
||||||
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
||||||
--logfile FILE Log to the file specified.
|
--logfile FILE Log to the file specified. Special values are:
|
||||||
|
'syslog', 'journald'. See the documentation for more
|
||||||
|
details.
|
||||||
-V, --version show program's version number and exit
|
-V, --version show program's version number and exit
|
||||||
-c PATH, --config PATH
|
-c PATH, --config PATH
|
||||||
Specify configuration file (default: `config.json`).
|
Specify configuration file (default:
|
||||||
Multiple --config options may be used. Can be set to
|
`userdir/config.json` or `config.json` whichever
|
||||||
`-` to read config from stdin.
|
exists). Multiple --config options may be used. Can be
|
||||||
|
set to `-` to read config from stdin.
|
||||||
-d PATH, --datadir PATH
|
-d PATH, --datadir PATH
|
||||||
Path to directory with historical backtesting data.
|
Path to directory with historical backtesting data.
|
||||||
--userdir PATH, --user-data-dir PATH
|
--userdir PATH, --user-data-dir PATH
|
||||||
Path to userdata directory.
|
Path to userdata directory.
|
||||||
|
|
||||||
|
Strategy arguments:
|
||||||
-s NAME, --strategy NAME
|
-s NAME, --strategy NAME
|
||||||
Specify strategy class name (default:
|
Specify strategy class name which will be used by the
|
||||||
`DefaultStrategy`).
|
bot.
|
||||||
--strategy-path PATH Specify additional strategy lookup path.
|
--strategy-path PATH Specify additional strategy lookup path.
|
||||||
--db-url PATH Override trades database URL, this is useful in custom
|
|
||||||
deployments (default: `sqlite:///tradesv3.sqlite` for
|
|
||||||
Live Run mode, `sqlite://` for Dry Run).
|
|
||||||
--sd-notify Notify systemd service manager.
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -60,7 +97,7 @@ The bot allows you to select which configuration file you want to use by means o
|
|||||||
the `-c/--config` command line option:
|
the `-c/--config` command line option:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
freqtrade -c path/far/far/away/config.json
|
freqtrade trade -c path/far/far/away/config.json
|
||||||
```
|
```
|
||||||
|
|
||||||
Per default, the bot loads the `config.json` configuration file from the current
|
Per default, the bot loads the `config.json` configuration file from the current
|
||||||
@@ -73,22 +110,22 @@ The bot allows you to use multiple configuration files by specifying multiple
|
|||||||
defined in the latter configuration files override parameters with the same name
|
defined in the latter configuration files override parameters with the same name
|
||||||
defined in the previous configuration files specified in the command line earlier.
|
defined in the previous configuration files specified in the command line earlier.
|
||||||
|
|
||||||
For example, you can make a separate configuration file with your key and secrete
|
For example, you can make a separate configuration file with your key and secret
|
||||||
for the Exchange you use for trading, specify default configuration file with
|
for the Exchange you use for trading, specify default configuration file with
|
||||||
empty key and secrete values while running in the Dry Mode (which does not actually
|
empty key and secret values while running in the Dry Mode (which does not actually
|
||||||
require them):
|
require them):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
freqtrade -c ./config.json
|
freqtrade trade -c ./config.json
|
||||||
```
|
```
|
||||||
|
|
||||||
and specify both configuration files when running in the normal Live Trade Mode:
|
and specify both configuration files when running in the normal Live Trade Mode:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
freqtrade -c ./config.json -c path/to/secrets/keys.config.json
|
freqtrade trade -c ./config.json -c path/to/secrets/keys.config.json
|
||||||
```
|
```
|
||||||
|
|
||||||
This could help you hide your private Exchange key and Exchange secrete on you local machine
|
This could help you hide your private Exchange key and Exchange secret on you local machine
|
||||||
by setting appropriate file permissions for the file which contains actual secrets and, additionally,
|
by setting appropriate file permissions for the file which contains actual secrets and, additionally,
|
||||||
prevent unintended disclosure of sensitive private data when you publish examples
|
prevent unintended disclosure of sensitive private data when you publish examples
|
||||||
of your configuration in the project issues or in the Internet.
|
of your configuration in the project issues or in the Internet.
|
||||||
@@ -122,10 +159,10 @@ It is recommended to use version control to keep track of changes to your strate
|
|||||||
### How to use **--strategy**?
|
### How to use **--strategy**?
|
||||||
|
|
||||||
This parameter will allow you to load your custom strategy class.
|
This parameter will allow you to load your custom strategy class.
|
||||||
Per default without `--strategy` or `-s` the bot will load the
|
To test the bot installation, you can use the `SampleStrategy` installed by the `create-userdir` subcommand (usually `user_data/strategy/sample_strategy.py`).
|
||||||
`DefaultStrategy` included with the bot (`freqtrade/strategy/default_strategy.py`).
|
|
||||||
|
|
||||||
The bot will search your strategy file within `user_data/strategies` and `freqtrade/strategy`.
|
The bot will search your strategy file within `user_data/strategies`.
|
||||||
|
To use other directories, please read the next section about `--strategy-path`.
|
||||||
|
|
||||||
To load a strategy, simply pass the class name (e.g.: `CustomStrategy`) in this parameter.
|
To load a strategy, simply pass the class name (e.g.: `CustomStrategy`) in this parameter.
|
||||||
|
|
||||||
@@ -134,7 +171,7 @@ In `user_data/strategies` you have a file `my_awesome_strategy.py` which has
|
|||||||
a strategy class called `AwesomeStrategy` to load it:
|
a strategy class called `AwesomeStrategy` to load it:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
freqtrade --strategy AwesomeStrategy
|
freqtrade trade --strategy AwesomeStrategy
|
||||||
```
|
```
|
||||||
|
|
||||||
If the bot does not find your strategy file, it will display in an error
|
If the bot does not find your strategy file, it will display in an error
|
||||||
@@ -149,7 +186,7 @@ This parameter allows you to add an additional strategy lookup path, which gets
|
|||||||
checked before the default locations (The passed path must be a directory!):
|
checked before the default locations (The passed path must be a directory!):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
freqtrade --strategy AwesomeStrategy --strategy-path /some/directory
|
freqtrade trade --strategy AwesomeStrategy --strategy-path /some/directory
|
||||||
```
|
```
|
||||||
|
|
||||||
#### How to install a strategy?
|
#### How to install a strategy?
|
||||||
@@ -165,7 +202,7 @@ using `--db-url`. This can also be used to specify a custom database
|
|||||||
in production mode. Example command:
|
in production mode. Example command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
freqtrade -c config.json --db-url sqlite:///tradesv3.dry_run.sqlite
|
freqtrade trade -c config.json --db-url sqlite:///tradesv3.dry_run.sqlite
|
||||||
```
|
```
|
||||||
|
|
||||||
## Backtesting commands
|
## Backtesting commands
|
||||||
@@ -173,24 +210,28 @@ freqtrade -c config.json --db-url sqlite:///tradesv3.dry_run.sqlite
|
|||||||
Backtesting also uses the config specified via `-c/--config`.
|
Backtesting also uses the config specified via `-c/--config`.
|
||||||
|
|
||||||
```
|
```
|
||||||
usage: freqtrade backtesting [-h] [-i TICKER_INTERVAL] [--timerange TIMERANGE]
|
usage: freqtrade backtesting [-h] [-v] [--logfile FILE] [-V] [-c PATH]
|
||||||
[--max_open_trades INT]
|
[-d PATH] [--userdir PATH] [-s NAME]
|
||||||
[--stake_amount STAKE_AMOUNT] [--fee FLOAT]
|
[--strategy-path PATH] [-i TIMEFRAME]
|
||||||
|
[--timerange TIMERANGE] [--max-open-trades INT]
|
||||||
|
[--stake-amount STAKE_AMOUNT] [--fee FLOAT]
|
||||||
[--eps] [--dmmp]
|
[--eps] [--dmmp]
|
||||||
[--strategy-list STRATEGY_LIST [STRATEGY_LIST ...]]
|
[--strategy-list STRATEGY_LIST [STRATEGY_LIST ...]]
|
||||||
[--export EXPORT] [--export-filename PATH]
|
[--export EXPORT] [--export-filename PATH]
|
||||||
|
|
||||||
optional arguments:
|
optional arguments:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
-i TICKER_INTERVAL, --ticker-interval TICKER_INTERVAL
|
-i TIMEFRAME, --timeframe TIMEFRAME, --ticker-interval TIMEFRAME
|
||||||
Specify ticker interval (`1m`, `5m`, `30m`, `1h`,
|
Specify ticker interval (`1m`, `5m`, `30m`, `1h`,
|
||||||
`1d`).
|
`1d`).
|
||||||
--timerange TIMERANGE
|
--timerange TIMERANGE
|
||||||
Specify what timerange of data to use.
|
Specify what timerange of data to use.
|
||||||
--max_open_trades INT
|
--max-open-trades INT
|
||||||
Specify max_open_trades to use.
|
Override the value of the `max_open_trades`
|
||||||
--stake_amount STAKE_AMOUNT
|
configuration setting.
|
||||||
Specify stake_amount.
|
--stake-amount STAKE_AMOUNT
|
||||||
|
Override the value of the `stake_amount` configuration
|
||||||
|
setting.
|
||||||
--fee FLOAT Specify fee ratio. Will be applied twice (on trade
|
--fee FLOAT Specify fee ratio. Will be applied twice (on trade
|
||||||
entry and exit).
|
entry and exit).
|
||||||
--eps, --enable-position-stacking
|
--eps, --enable-position-stacking
|
||||||
@@ -211,11 +252,32 @@ optional arguments:
|
|||||||
--export EXPORT Export backtest results, argument are: trades.
|
--export EXPORT Export backtest results, argument are: trades.
|
||||||
Example: `--export=trades`
|
Example: `--export=trades`
|
||||||
--export-filename PATH
|
--export-filename PATH
|
||||||
Save backtest results to the file with this filename
|
Save backtest results to the file with this filename.
|
||||||
(default: `user_data/backtest_results/backtest-
|
Requires `--export` to be set as well. Example:
|
||||||
result.json`). Requires `--export` to be set as well.
|
`--export-filename=user_data/backtest_results/backtest
|
||||||
Example: `--export-filename=user_data/backtest_results
|
_today.json`
|
||||||
/backtest_today.json`
|
|
||||||
|
Common arguments:
|
||||||
|
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
||||||
|
--logfile FILE Log to the file specified. Special values are:
|
||||||
|
'syslog', 'journald'. See the documentation for more
|
||||||
|
details.
|
||||||
|
-V, --version show program's version number and exit
|
||||||
|
-c PATH, --config PATH
|
||||||
|
Specify configuration file (default:
|
||||||
|
`userdir/config.json` or `config.json` whichever
|
||||||
|
exists). Multiple --config options may be used. Can be
|
||||||
|
set to `-` to read config from stdin.
|
||||||
|
-d PATH, --datadir PATH
|
||||||
|
Path to directory with historical backtesting data.
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
|
||||||
|
Strategy arguments:
|
||||||
|
-s NAME, --strategy NAME
|
||||||
|
Specify strategy class name which will be used by the
|
||||||
|
bot.
|
||||||
|
--strategy-path PATH Specify additional strategy lookup path.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -223,49 +285,52 @@ optional arguments:
|
|||||||
|
|
||||||
The first time your run Backtesting, you will need to download some historic data first.
|
The first time your run Backtesting, you will need to download some historic data first.
|
||||||
This can be accomplished by using `freqtrade download-data`.
|
This can be accomplished by using `freqtrade download-data`.
|
||||||
Check the corresponding [help page section](backtesting.md#Getting-data-for-backtesting-and-hyperopt) for more details
|
Check the corresponding [Data Downloading](data-download.md) section for more details
|
||||||
|
|
||||||
## Hyperopt commands
|
## Hyperopt commands
|
||||||
|
|
||||||
To optimize your strategy, you can use hyperopt parameter hyperoptimization
|
To optimize your strategy, you can use hyperopt parameter hyperoptimization
|
||||||
to find optimal parameter values for your stategy.
|
to find optimal parameter values for your strategy.
|
||||||
|
|
||||||
```
|
```
|
||||||
usage: freqtrade hyperopt [-h] [-i TICKER_INTERVAL] [--timerange TIMERANGE]
|
usage: freqtrade hyperopt [-h] [-v] [--logfile FILE] [-V] [-c PATH] [-d PATH]
|
||||||
[--max_open_trades INT]
|
[--userdir PATH] [-s NAME] [--strategy-path PATH]
|
||||||
[--stake_amount STAKE_AMOUNT] [--fee FLOAT]
|
[-i TIMEFRAME] [--timerange TIMERANGE]
|
||||||
[--customhyperopt NAME] [--hyperopt-path PATH]
|
[--max-open-trades INT]
|
||||||
[--eps] [-e INT]
|
[--stake-amount STAKE_AMOUNT] [--fee FLOAT]
|
||||||
[-s {all,buy,sell,roi,stoploss} [{all,buy,sell,roi,stoploss} ...]]
|
[--hyperopt NAME] [--hyperopt-path PATH] [--eps]
|
||||||
|
[-e INT]
|
||||||
|
[--spaces {all,buy,sell,roi,stoploss,trailing,default} [{all,buy,sell,roi,stoploss,trailing,default} ...]]
|
||||||
[--dmmp] [--print-all] [--no-color] [--print-json]
|
[--dmmp] [--print-all] [--no-color] [--print-json]
|
||||||
[-j JOBS] [--random-state INT] [--min-trades INT]
|
[-j JOBS] [--random-state INT] [--min-trades INT]
|
||||||
[--continue] [--hyperopt-loss NAME]
|
[--continue] [--hyperopt-loss NAME]
|
||||||
|
|
||||||
optional arguments:
|
optional arguments:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
-i TICKER_INTERVAL, --ticker-interval TICKER_INTERVAL
|
-i TIMEFRAME, --timeframe TIMEFRAME, --ticker-interval TIMEFRAME
|
||||||
Specify ticker interval (`1m`, `5m`, `30m`, `1h`,
|
Specify ticker interval (`1m`, `5m`, `30m`, `1h`,
|
||||||
`1d`).
|
`1d`).
|
||||||
--timerange TIMERANGE
|
--timerange TIMERANGE
|
||||||
Specify what timerange of data to use.
|
Specify what timerange of data to use.
|
||||||
--max_open_trades INT
|
--max-open-trades INT
|
||||||
Specify max_open_trades to use.
|
Override the value of the `max_open_trades`
|
||||||
--stake_amount STAKE_AMOUNT
|
configuration setting.
|
||||||
Specify stake_amount.
|
--stake-amount STAKE_AMOUNT
|
||||||
|
Override the value of the `stake_amount` configuration
|
||||||
|
setting.
|
||||||
--fee FLOAT Specify fee ratio. Will be applied twice (on trade
|
--fee FLOAT Specify fee ratio. Will be applied twice (on trade
|
||||||
entry and exit).
|
entry and exit).
|
||||||
--customhyperopt NAME
|
--hyperopt NAME Specify hyperopt class name which will be used by the
|
||||||
Specify hyperopt class name (default:
|
bot.
|
||||||
`DefaultHyperOpt`).
|
--hyperopt-path PATH Specify additional lookup path for Hyperopt and
|
||||||
--hyperopt-path PATH Specify additional lookup path for Hyperopts and
|
|
||||||
Hyperopt Loss functions.
|
Hyperopt Loss functions.
|
||||||
--eps, --enable-position-stacking
|
--eps, --enable-position-stacking
|
||||||
Allow buying the same pair multiple times (position
|
Allow buying the same pair multiple times (position
|
||||||
stacking).
|
stacking).
|
||||||
-e INT, --epochs INT Specify number of epochs (default: 100).
|
-e INT, --epochs INT Specify number of epochs (default: 100).
|
||||||
-s {all,buy,sell,roi,stoploss} [{all,buy,sell,roi,stoploss} ...], --spaces {all,buy,sell,roi,stoploss} [{all,buy,sell,roi,stoploss} ...]
|
--spaces {all,buy,sell,roi,stoploss,trailing,default} [{all,buy,sell,roi,stoploss,trailing,default} ...]
|
||||||
Specify which parameters to hyperopt. Space-separated
|
Specify which parameters to hyperopt. Space-separated
|
||||||
list. Default: `all`.
|
list.
|
||||||
--dmmp, --disable-max-market-positions
|
--dmmp, --disable-max-market-positions
|
||||||
Disable applying `max_open_trades` during backtest
|
Disable applying `max_open_trades` during backtest
|
||||||
(same as setting `max_open_trades` to a very high
|
(same as setting `max_open_trades` to a very high
|
||||||
@@ -273,7 +338,7 @@ optional arguments:
|
|||||||
--print-all Print all results, not only the best ones.
|
--print-all Print all results, not only the best ones.
|
||||||
--no-color Disable colorization of hyperopt results. May be
|
--no-color Disable colorization of hyperopt results. May be
|
||||||
useful if you are redirecting output to a file.
|
useful if you are redirecting output to a file.
|
||||||
--print-json Print best result detailization in JSON format.
|
--print-json Print output in JSON format.
|
||||||
-j JOBS, --job-workers JOBS
|
-j JOBS, --job-workers JOBS
|
||||||
The number of concurrently running jobs for
|
The number of concurrently running jobs for
|
||||||
hyperoptimization (hyperopt worker processes). If -1
|
hyperoptimization (hyperopt worker processes). If -1
|
||||||
@@ -292,8 +357,33 @@ optional arguments:
|
|||||||
generate completely different results, since the
|
generate completely different results, since the
|
||||||
target for optimization is different. Built-in
|
target for optimization is different. Built-in
|
||||||
Hyperopt-loss-functions are: DefaultHyperOptLoss,
|
Hyperopt-loss-functions are: DefaultHyperOptLoss,
|
||||||
OnlyProfitHyperOptLoss, SharpeHyperOptLoss.(default:
|
OnlyProfitHyperOptLoss, SharpeHyperOptLoss,
|
||||||
|
SharpeHyperOptLossDaily, SortinoHyperOptLoss,
|
||||||
|
SortinoHyperOptLossDaily.(default:
|
||||||
`DefaultHyperOptLoss`).
|
`DefaultHyperOptLoss`).
|
||||||
|
|
||||||
|
Common arguments:
|
||||||
|
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
||||||
|
--logfile FILE Log to the file specified. Special values are:
|
||||||
|
'syslog', 'journald'. See the documentation for more
|
||||||
|
details.
|
||||||
|
-V, --version show program's version number and exit
|
||||||
|
-c PATH, --config PATH
|
||||||
|
Specify configuration file (default:
|
||||||
|
`userdir/config.json` or `config.json` whichever
|
||||||
|
exists). Multiple --config options may be used. Can be
|
||||||
|
set to `-` to read config from stdin.
|
||||||
|
-d PATH, --datadir PATH
|
||||||
|
Path to directory with historical backtesting data.
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
|
||||||
|
Strategy arguments:
|
||||||
|
-s NAME, --strategy NAME
|
||||||
|
Specify strategy class name which will be used by the
|
||||||
|
bot.
|
||||||
|
--strategy-path PATH Specify additional strategy lookup path.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Edge commands
|
## Edge commands
|
||||||
@@ -301,21 +391,25 @@ optional arguments:
|
|||||||
To know your trade expectancy and winrate against historical data, you can use Edge.
|
To know your trade expectancy and winrate against historical data, you can use Edge.
|
||||||
|
|
||||||
```
|
```
|
||||||
usage: freqtrade edge [-h] [-i TICKER_INTERVAL] [--timerange TIMERANGE]
|
usage: freqtrade edge [-h] [-v] [--logfile FILE] [-V] [-c PATH] [-d PATH]
|
||||||
[--max_open_trades INT] [--stake_amount STAKE_AMOUNT]
|
[--userdir PATH] [-s NAME] [--strategy-path PATH]
|
||||||
|
[-i TIMEFRAME] [--timerange TIMERANGE]
|
||||||
|
[--max-open-trades INT] [--stake-amount STAKE_AMOUNT]
|
||||||
[--fee FLOAT] [--stoplosses STOPLOSS_RANGE]
|
[--fee FLOAT] [--stoplosses STOPLOSS_RANGE]
|
||||||
|
|
||||||
optional arguments:
|
optional arguments:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
-i TICKER_INTERVAL, --ticker-interval TICKER_INTERVAL
|
-i TIMEFRAME, --timeframe TIMEFRAME, --ticker-interval TIMEFRAME
|
||||||
Specify ticker interval (`1m`, `5m`, `30m`, `1h`,
|
Specify ticker interval (`1m`, `5m`, `30m`, `1h`,
|
||||||
`1d`).
|
`1d`).
|
||||||
--timerange TIMERANGE
|
--timerange TIMERANGE
|
||||||
Specify what timerange of data to use.
|
Specify what timerange of data to use.
|
||||||
--max_open_trades INT
|
--max-open-trades INT
|
||||||
Specify max_open_trades to use.
|
Override the value of the `max_open_trades`
|
||||||
--stake_amount STAKE_AMOUNT
|
configuration setting.
|
||||||
Specify stake_amount.
|
--stake-amount STAKE_AMOUNT
|
||||||
|
Override the value of the `stake_amount` configuration
|
||||||
|
setting.
|
||||||
--fee FLOAT Specify fee ratio. Will be applied twice (on trade
|
--fee FLOAT Specify fee ratio. Will be applied twice (on trade
|
||||||
entry and exit).
|
entry and exit).
|
||||||
--stoplosses STOPLOSS_RANGE
|
--stoplosses STOPLOSS_RANGE
|
||||||
@@ -324,6 +418,28 @@ optional arguments:
|
|||||||
(without any space). Example:
|
(without any space). Example:
|
||||||
`--stoplosses=-0.01,-0.1,-0.001`
|
`--stoplosses=-0.01,-0.1,-0.001`
|
||||||
|
|
||||||
|
Common arguments:
|
||||||
|
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
||||||
|
--logfile FILE Log to the file specified. Special values are:
|
||||||
|
'syslog', 'journald'. See the documentation for more
|
||||||
|
details.
|
||||||
|
-V, --version show program's version number and exit
|
||||||
|
-c PATH, --config PATH
|
||||||
|
Specify configuration file (default:
|
||||||
|
`userdir/config.json` or `config.json` whichever
|
||||||
|
exists). Multiple --config options may be used. Can be
|
||||||
|
set to `-` to read config from stdin.
|
||||||
|
-d PATH, --datadir PATH
|
||||||
|
Path to directory with historical backtesting data.
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
|
||||||
|
Strategy arguments:
|
||||||
|
-s NAME, --strategy NAME
|
||||||
|
Specify strategy class name which will be used by the
|
||||||
|
bot.
|
||||||
|
--strategy-path PATH Specify additional strategy lookup path.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
To understand edge and how to read the results, please read the [edge documentation](edge.md).
|
To understand edge and how to read the results, please read the [edge documentation](edge.md).
|
||||||
|
|||||||
@@ -34,114 +34,191 @@ The prevelance for all Options is as follows:
|
|||||||
|
|
||||||
- CLI arguments override any other option
|
- CLI arguments override any other option
|
||||||
- Configuration files are used in sequence (last file wins), and override Strategy configurations.
|
- Configuration files are used in sequence (last file wins), and override Strategy configurations.
|
||||||
- Strategy configurations are only used if they are not set via configuration or via command line arguments. These options are market with [Strategy Override](#parameters-in-the-strategy) in the below table.
|
- Strategy configurations are only used if they are not set via configuration or via command line arguments. These options are marked with [Strategy Override](#parameters-in-the-strategy) in the below table.
|
||||||
|
|
||||||
Mandatory parameters are marked as **Required**, which means that they are required to be set in one of the possible ways.
|
Mandatory parameters are marked as **Required**, which means that they are required to be set in one of the possible ways.
|
||||||
|
|
||||||
| Command | Default | Description |
|
| Parameter | Description |
|
||||||
|----------|---------|-------------|
|
|------------|-------------|
|
||||||
| `max_open_trades` | 3 | **Required.** Number of trades open your bot will have. If -1 then it is ignored (i.e. potentially unlimited open trades)
|
| `max_open_trades` | **Required.** Number of open trades your bot is allowed to have. Only one open trade per pair is possible, so the length of your pairlist is another limitation which can apply. If -1 then it is ignored (i.e. potentially unlimited open trades, limited by the pairlist). [More information below](#configuring-amount-per-trade).<br> **Datatype:** Positive integer or -1.
|
||||||
| `stake_currency` | BTC | **Required.** Crypto-currency used for trading.
|
| `stake_currency` | **Required.** Crypto-currency used for trading. [Strategy Override](#parameters-in-the-strategy). <br> **Datatype:** String
|
||||||
| `stake_amount` | 0.05 | **Required.** Amount of crypto-currency your bot will use for each trade. Per default, the bot will use (0.05 BTC x 3) = 0.15 BTC in total will be always engaged. Set it to `"unlimited"` to allow the bot to use all available balance.
|
| `stake_amount` | **Required.** Amount of crypto-currency your bot will use for each trade. Set it to `"unlimited"` to allow the bot to use all available balance. [More information below](#configuring-amount-per-trade). [Strategy Override](#parameters-in-the-strategy). <br> **Datatype:** Positive float or `"unlimited"`.
|
||||||
| `amount_reserve_percent` | 0.05 | Reserve some amount in min pair stake amount. Default is 5%. The bot will reserve `amount_reserve_percent` + stop-loss value when calculating min pair stake amount in order to avoid possible trade refusals.
|
| `tradable_balance_ratio` | Ratio of the total account balance the bot is allowed to trade. [More information below](#configuring-amount-per-trade). <br>*Defaults to `0.99` 99%).*<br> **Datatype:** Positive float between `0.1` and `1.0`.
|
||||||
| `ticker_interval` | [1m, 5m, 15m, 30m, 1h, 1d, ...] | The ticker interval to use (1min, 5 min, 15 min, 30 min, 1 hour or 1 day). Default is 5 minutes. [Strategy Override](#parameters-in-the-strategy).
|
| `amend_last_stake_amount` | Use reduced last stake amount if necessary. [More information below](#configuring-amount-per-trade). <br>*Defaults to `false`.* <br> **Datatype:** Boolean
|
||||||
| `fiat_display_currency` | USD | **Required.** Fiat currency used to show your profits. More information below.
|
| `last_stake_amount_min_ratio` | Defines minimum stake amount that has to be left and executed. Applies only to the last stake amount when it's amended to a reduced value (i.e. if `amend_last_stake_amount` is set to `true`). [More information below](#configuring-amount-per-trade). <br>*Defaults to `0.5`.* <br> **Datatype:** Float (as ratio)
|
||||||
| `dry_run` | true | **Required.** Define if the bot must be in Dry-run or production mode.
|
| `amount_reserve_percent` | Reserve some amount in min pair stake amount. The bot will reserve `amount_reserve_percent` + stoploss value when calculating min pair stake amount in order to avoid possible trade refusals. <br>*Defaults to `0.05` (5%).* <br> **Datatype:** Positive Float as ratio.
|
||||||
| `dry_run_wallet` | 999.9 | Overrides the default amount of 999.9 stake currency units in the wallet used by the bot running in the Dry Run mode if you need it for any reason.
|
| `timeframe` | The timeframe (former ticker interval) to use (e.g `1m`, `5m`, `15m`, `30m`, `1h` ...). [Strategy Override](#parameters-in-the-strategy). <br> **Datatype:** String
|
||||||
| `process_only_new_candles` | false | If set to true indicators are processed only once a new candle arrives. If false each loop populates the indicators, this will mean the same candle is processed many times creating system load but can be useful of your strategy depends on tick data not only candle. [Strategy Override](#parameters-in-the-strategy).
|
| `fiat_display_currency` | Fiat currency used to show your profits. [More information below](#what-values-can-be-used-for-fiat_display_currency). <br> **Datatype:** String
|
||||||
| `minimal_roi` | See below | Set the threshold in percent the bot will use to sell a trade. More information below. [Strategy Override](#parameters-in-the-strategy).
|
| `dry_run` | **Required.** Define if the bot must be in Dry Run or production mode. <br>*Defaults to `true`.* <br> **Datatype:** Boolean
|
||||||
| `stoploss` | -0.10 | Value of the stoploss in percent used by the bot. More information below. More details in the [stoploss documentation](stoploss.md). [Strategy Override](#parameters-in-the-strategy).
|
| `dry_run_wallet` | Define the starting amount in stake currency for the simulated wallet used by the bot running in the Dry Run mode.<br>*Defaults to `1000`.* <br> **Datatype:** Float
|
||||||
| `trailing_stop` | false | Enables trailing stop-loss (based on `stoploss` in either configuration or strategy file). More details in the [stoploss documentation](stoploss.md). [Strategy Override](#parameters-in-the-strategy).
|
| `cancel_open_orders_on_exit` | Cancel open orders when the `/stop` RPC command is issued, `Ctrl+C` is pressed or the bot dies unexpectedly. When set to `true`, this allows you to use `/stop` to cancel unfilled and partially filled orders in the event of a market crash. It does not impact open positions. <br>*Defaults to `false`.* <br> **Datatype:** Boolean
|
||||||
| `trailing_stop_positive` | 0 | Changes stop-loss once profit has been reached. More details in the [stoploss documentation](stoploss.md). [Strategy Override](#parameters-in-the-strategy).
|
| `process_only_new_candles` | Enable processing of indicators only when new candles arrive. If false each loop populates the indicators, this will mean the same candle is processed many times creating system load but can be useful of your strategy depends on tick data not only candle. [Strategy Override](#parameters-in-the-strategy). <br>*Defaults to `false`.* <br> **Datatype:** Boolean
|
||||||
| `trailing_stop_positive_offset` | 0 | Offset on when to apply `trailing_stop_positive`. Percentage value which should be positive. More details in the [stoploss documentation](stoploss.md). [Strategy Override](#parameters-in-the-strategy).
|
| `minimal_roi` | **Required.** Set the threshold as ratio the bot will use to sell a trade. [More information below](#understand-minimal_roi). [Strategy Override](#parameters-in-the-strategy). <br> **Datatype:** Dict
|
||||||
| `trailing_only_offset_is_reached` | false | Only apply trailing stoploss when the offset is reached. [stoploss documentation](stoploss.md). [Strategy Override](#parameters-in-the-strategy).
|
| `stoploss` | **Required.** Value as ratio of the stoploss used by the bot. More details in the [stoploss documentation](stoploss.md). [Strategy Override](#parameters-in-the-strategy). <br> **Datatype:** Float (as ratio)
|
||||||
| `unfilledtimeout.buy` | 10 | **Required.** How long (in minutes) the bot will wait for an unfilled buy order to complete, after which the order will be cancelled.
|
| `trailing_stop` | Enables trailing stoploss (based on `stoploss` in either configuration or strategy file). More details in the [stoploss documentation](stoploss.md#trailing-stop-loss). [Strategy Override](#parameters-in-the-strategy). <br> **Datatype:** Boolean
|
||||||
| `unfilledtimeout.sell` | 10 | **Required.** How long (in minutes) the bot will wait for an unfilled sell order to complete, after which the order will be cancelled.
|
| `trailing_stop_positive` | Changes stoploss once profit has been reached. More details in the [stoploss documentation](stoploss.md#trailing-stop-loss-custom-positive-loss). [Strategy Override](#parameters-in-the-strategy). <br> **Datatype:** Float
|
||||||
| `bid_strategy.ask_last_balance` | 0.0 | **Required.** Set the bidding price. More information [below](#understand-ask_last_balance).
|
| `trailing_stop_positive_offset` | Offset on when to apply `trailing_stop_positive`. Percentage value which should be positive. More details in the [stoploss documentation](stoploss.md#trailing-stop-loss-only-once-the-trade-has-reached-a-certain-offset). [Strategy Override](#parameters-in-the-strategy). <br>*Defaults to `0.0` (no offset).* <br> **Datatype:** Float
|
||||||
| `bid_strategy.use_order_book` | false | Allows buying of pair using the rates in Order Book Bids.
|
| `trailing_only_offset_is_reached` | Only apply trailing stoploss when the offset is reached. [stoploss documentation](stoploss.md). [Strategy Override](#parameters-in-the-strategy). <br>*Defaults to `false`.* <br> **Datatype:** Boolean
|
||||||
| `bid_strategy.order_book_top` | 0 | Bot will use the top N rate in Order Book Bids. I.e. a value of 2 will allow the bot to pick the 2nd bid rate in Order Book Bids.
|
| `unfilledtimeout.buy` | **Required.** How long (in minutes) the bot will wait for an unfilled buy order to complete, after which the order will be cancelled. [Strategy Override](#parameters-in-the-strategy).<br> **Datatype:** Integer
|
||||||
| `bid_strategy. check_depth_of_market.enabled` | false | Does not buy if the % difference of buy orders and sell orders is met in Order Book.
|
| `unfilledtimeout.sell` | **Required.** How long (in minutes) the bot will wait for an unfilled sell order to complete, after which the order will be cancelled. [Strategy Override](#parameters-in-the-strategy).<br> **Datatype:** Integer
|
||||||
| `bid_strategy. check_depth_of_market.bids_to_ask_delta` | 0 | The % difference of buy orders and sell orders found in Order Book. A value lesser than 1 means sell orders is greater, while value greater than 1 means buy orders is higher.
|
| `bid_strategy.price_side` | Select the side of the spread the bot should look at to get the buy rate. [More information below](#buy-price-side).<br> *Defaults to `bid`.* <br> **Datatype:** String (either `ask` or `bid`).
|
||||||
| `ask_strategy.use_order_book` | false | Allows selling of open traded pair using the rates in Order Book Asks.
|
| `bid_strategy.ask_last_balance` | **Required.** Set the bidding price. More information [below](#buy-price-without-orderbook-enabled).
|
||||||
| `ask_strategy.order_book_min` | 0 | Bot will scan from the top min to max Order Book Asks searching for a profitable rate.
|
| `bid_strategy.use_order_book` | Enable buying using the rates in [Order Book Bids](#buy-price-with-orderbook-enabled). <br> **Datatype:** Boolean
|
||||||
| `ask_strategy.order_book_max` | 0 | Bot will scan from the top min to max Order Book Asks searching for a profitable rate.
|
| `bid_strategy.order_book_top` | Bot will use the top N rate in Order Book Bids to buy. I.e. a value of 2 will allow the bot to pick the 2nd bid rate in [Order Book Bids](#buy-price-with-orderbook-enabled). <br>*Defaults to `1`.* <br> **Datatype:** Positive Integer
|
||||||
| `ask_strategy.use_sell_signal` | true | Use sell signals produced by the strategy in addition to the `minimal_roi`. [Strategy Override](#parameters-in-the-strategy).
|
| `bid_strategy. check_depth_of_market.enabled` | Do not buy if the difference of buy orders and sell orders is met in Order Book. [Check market depth](#check-depth-of-market). <br>*Defaults to `false`.* <br> **Datatype:** Boolean
|
||||||
| `ask_strategy.sell_profit_only` | false | Wait until the bot makes a positive profit before taking a sell decision. [Strategy Override](#parameters-in-the-strategy).
|
| `bid_strategy. check_depth_of_market.bids_to_ask_delta` | The difference ratio of buy orders and sell orders found in Order Book. A value below 1 means sell order size is greater, while value greater than 1 means buy order size is higher. [Check market depth](#check-depth-of-market) <br> *Defaults to `0`.* <br> **Datatype:** Float (as ratio)
|
||||||
| `ask_strategy.ignore_roi_if_buy_signal` | false | Do not sell if the buy signal is still active. This setting takes preference over `minimal_roi` and `use_sell_signal`. [Strategy Override](#parameters-in-the-strategy).
|
| `ask_strategy.price_side` | Select the side of the spread the bot should look at to get the sell rate. [More information below](#sell-price-side).<br> *Defaults to `ask`.* <br> **Datatype:** String (either `ask` or `bid`).
|
||||||
| `order_types` | None | Configure order-types depending on the action (`"buy"`, `"sell"`, `"stoploss"`, `"stoploss_on_exchange"`). [More information below](#understand-order_types). [Strategy Override](#parameters-in-the-strategy).
|
| `ask_strategy.use_order_book` | Enable selling of open trades using [Order Book Asks](#sell-price-with-orderbook-enabled). <br> **Datatype:** Boolean
|
||||||
| `order_time_in_force` | None | Configure time in force for buy and sell orders. [More information below](#understand-order_time_in_force). [Strategy Override](#parameters-in-the-strategy).
|
| `ask_strategy.order_book_min` | Bot will scan from the top min to max Order Book Asks searching for a profitable rate. <br>*Defaults to `1`.* <br> **Datatype:** Positive Integer
|
||||||
| `exchange.name` | | **Required.** Name of the exchange class to use. [List below](#user-content-what-values-for-exchangename).
|
| `ask_strategy.order_book_max` | Bot will scan from the top min to max Order Book Asks searching for a profitable rate. <br>*Defaults to `1`.* <br> **Datatype:** Positive Integer
|
||||||
| `exchange.sandbox` | false | Use the 'sandbox' version of the exchange, where the exchange provides a sandbox for risk-free integration. See [here](sandbox-testing.md) in more details.
|
| `ask_strategy.use_sell_signal` | Use sell signals produced by the strategy in addition to the `minimal_roi`. [Strategy Override](#parameters-in-the-strategy). <br>*Defaults to `true`.* <br> **Datatype:** Boolean
|
||||||
| `exchange.key` | '' | API key to use for the exchange. Only required when you are in production mode. ***Keep it in secrete, do not disclose publicly.***
|
| `ask_strategy.sell_profit_only` | Wait until the bot makes a positive profit before taking a sell decision. [Strategy Override](#parameters-in-the-strategy). <br>*Defaults to `false`.* <br> **Datatype:** Boolean
|
||||||
| `exchange.secret` | '' | API secret to use for the exchange. Only required when you are in production mode. ***Keep it in secrete, do not disclose publicly.***
|
| `ask_strategy.ignore_roi_if_buy_signal` | Do not sell if the buy signal is still active. This setting takes preference over `minimal_roi` and `use_sell_signal`. [Strategy Override](#parameters-in-the-strategy). <br>*Defaults to `false`.* <br> **Datatype:** Boolean
|
||||||
| `exchange.password` | '' | API password to use for the exchange. Only required when you are in production mode and for exchanges that use password for API requests. ***Keep it in secrete, do not disclose publicly.***
|
| `order_types` | Configure order-types depending on the action (`"buy"`, `"sell"`, `"stoploss"`, `"stoploss_on_exchange"`). [More information below](#understand-order_types). [Strategy Override](#parameters-in-the-strategy).<br> **Datatype:** Dict
|
||||||
| `exchange.pair_whitelist` | [] | List of pairs to use by the bot for trading and to check for potential trades during backtesting. Can be overriden by dynamic pairlists (see [below](#dynamic-pairlists)).
|
| `order_time_in_force` | Configure time in force for buy and sell orders. [More information below](#understand-order_time_in_force). [Strategy Override](#parameters-in-the-strategy). <br> **Datatype:** Dict
|
||||||
| `exchange.pair_blacklist` | [] | List of pairs the bot must absolutely avoid for trading and backtesting. Can be overriden by dynamic pairlists (see [below](#dynamic-pairlists)).
|
| `exchange.name` | **Required.** Name of the exchange class to use. [List below](#user-content-what-values-for-exchangename). <br> **Datatype:** String
|
||||||
| `exchange.ccxt_config` | None | Additional CCXT parameters passed to the regular ccxt instance. Parameters may differ from exchange to exchange and are documented in the [ccxt documentation](https://ccxt.readthedocs.io/en/latest/manual.html#instantiation)
|
| `exchange.sandbox` | Use the 'sandbox' version of the exchange, where the exchange provides a sandbox for risk-free integration. See [here](sandbox-testing.md) in more details.<br> **Datatype:** Boolean
|
||||||
| `exchange.ccxt_async_config` | None | Additional CCXT parameters passed to the async ccxt instance. Parameters may differ from exchange to exchange and are documented in the [ccxt documentation](https://ccxt.readthedocs.io/en/latest/manual.html#instantiation)
|
| `exchange.key` | API key to use for the exchange. Only required when you are in production mode.<br>**Keep it in secret, do not disclose publicly.** <br> **Datatype:** String
|
||||||
| `exchange.markets_refresh_interval` | 60 | The interval in minutes in which markets are reloaded.
|
| `exchange.secret` | API secret to use for the exchange. Only required when you are in production mode.<br>**Keep it in secret, do not disclose publicly.** <br> **Datatype:** String
|
||||||
| `edge` | false | Please refer to [edge configuration document](edge.md) for detailed explanation.
|
| `exchange.password` | API password to use for the exchange. Only required when you are in production mode and for exchanges that use password for API requests.<br>**Keep it in secret, do not disclose publicly.** <br> **Datatype:** String
|
||||||
| `experimental.block_bad_exchanges` | true | Block exchanges known to not work with freqtrade. Leave on default unless you want to test if that exchange works now.
|
| `exchange.pair_whitelist` | List of pairs to use by the bot for trading and to check for potential trades during backtesting. Not used by VolumePairList (see [below](#pairlists-and-pairlist-handlers)). <br> **Datatype:** List
|
||||||
| `pairlist.method` | StaticPairList | Use static or dynamic volume-based pairlist. [More information below](#dynamic-pairlists).
|
| `exchange.pair_blacklist` | List of pairs the bot must absolutely avoid for trading and backtesting (see [below](#pairlists-and-pairlist-handlers)). <br> **Datatype:** List
|
||||||
| `pairlist.config` | None | Additional configuration for dynamic pairlists. [More information below](#dynamic-pairlists).
|
| `exchange.ccxt_config` | Additional CCXT parameters passed to both ccxt instances (sync and async). This is usually the correct place for ccxt configurations. Parameters may differ from exchange to exchange and are documented in the [ccxt documentation](https://ccxt.readthedocs.io/en/latest/manual.html#instantiation) <br> **Datatype:** Dict
|
||||||
| `telegram.enabled` | true | **Required.** Enable or not the usage of Telegram.
|
| `exchange.ccxt_sync_config` | Additional CCXT parameters passed to the regular (sync) ccxt instance. Parameters may differ from exchange to exchange and are documented in the [ccxt documentation](https://ccxt.readthedocs.io/en/latest/manual.html#instantiation) <br> **Datatype:** Dict
|
||||||
| `telegram.token` | token | Your Telegram bot token. Only required if `telegram.enabled` is `true`. ***Keep it in secrete, do not disclose publicly.***
|
| `exchange.ccxt_async_config` | Additional CCXT parameters passed to the async ccxt instance. Parameters may differ from exchange to exchange and are documented in the [ccxt documentation](https://ccxt.readthedocs.io/en/latest/manual.html#instantiation) <br> **Datatype:** Dict
|
||||||
| `telegram.chat_id` | chat_id | Your personal Telegram account id. Only required if `telegram.enabled` is `true`. ***Keep it in secrete, do not disclose publicly.***
|
| `exchange.markets_refresh_interval` | The interval in minutes in which markets are reloaded. <br>*Defaults to `60` minutes.* <br> **Datatype:** Positive Integer
|
||||||
| `webhook.enabled` | false | Enable usage of Webhook notifications
|
| `edge.*` | Please refer to [edge configuration document](edge.md) for detailed explanation.
|
||||||
| `webhook.url` | false | URL for the webhook. Only required if `webhook.enabled` is `true`. See the [webhook documentation](webhook-config.md) for more details.
|
| `experimental.block_bad_exchanges` | Block exchanges known to not work with freqtrade. Leave on default unless you want to test if that exchange works now. <br>*Defaults to `true`.* <br> **Datatype:** Boolean
|
||||||
| `webhook.webhookbuy` | false | Payload to send on buy. Only required if `webhook.enabled` is `true`. See the [webhook documentationV](webhook-config.md) for more details.
|
| `pairlists` | Define one or more pairlists to be used. [More information below](#pairlists-and-pairlist-handlers). <br>*Defaults to `StaticPairList`.* <br> **Datatype:** List of Dicts
|
||||||
| `webhook.webhooksell` | false | Payload to send on sell. Only required if `webhook.enabled` is `true`. See the [webhook documentationV](webhook-config.md) for more details.
|
| `telegram.enabled` | Enable the usage of Telegram. <br> **Datatype:** Boolean
|
||||||
| `webhook.webhookstatus` | false | Payload to send on status calls. Only required if `webhook.enabled` is `true`. See the [webhook documentationV](webhook-config.md) for more details.
|
| `telegram.token` | Your Telegram bot token. Only required if `telegram.enabled` is `true`. <br>**Keep it in secret, do not disclose publicly.** <br> **Datatype:** String
|
||||||
| `db_url` | `sqlite:///tradesv3.sqlite`| Declares database URL to use. NOTE: This defaults to `sqlite://` if `dry_run` is `True`.
|
| `telegram.chat_id` | Your personal Telegram account id. Only required if `telegram.enabled` is `true`. <br>**Keep it in secret, do not disclose publicly.** <br> **Datatype:** String
|
||||||
| `initial_state` | running | Defines the initial application state. More information below.
|
| `webhook.enabled` | Enable usage of Webhook notifications <br> **Datatype:** Boolean
|
||||||
| `forcebuy_enable` | false | Enables the RPC Commands to force a buy. More information below.
|
| `webhook.url` | URL for the webhook. Only required if `webhook.enabled` is `true`. See the [webhook documentation](webhook-config.md) for more details. <br> **Datatype:** String
|
||||||
| `strategy` | DefaultStrategy | Defines Strategy class to use.
|
| `webhook.webhookbuy` | Payload to send on buy. Only required if `webhook.enabled` is `true`. See the [webhook documentation](webhook-config.md) for more details. <br> **Datatype:** String
|
||||||
| `strategy_path` | null | Adds an additional strategy lookup path (must be a directory).
|
| `webhook.webhookbuycancel` | Payload to send on buy order cancel. Only required if `webhook.enabled` is `true`. See the [webhook documentation](webhook-config.md) for more details. <br> **Datatype:** String
|
||||||
| `internals.process_throttle_secs` | 5 | **Required.** Set the process throttle. Value in second.
|
| `webhook.webhooksell` | Payload to send on sell. Only required if `webhook.enabled` is `true`. See the [webhook documentation](webhook-config.md) for more details. <br> **Datatype:** String
|
||||||
| `internals.heartbeat_interval` | 60 | Print heartbeat message every X seconds. Set to 0 to disable heartbeat messages.
|
| `webhook.webhooksellcancel` | Payload to send on sell order cancel. Only required if `webhook.enabled` is `true`. See the [webhook documentation](webhook-config.md) for more details. <br> **Datatype:** String
|
||||||
| `internals.sd_notify` | false | Enables use of the sd_notify protocol to tell systemd service manager about changes in the bot state and issue keep-alive pings. See [here](installation.md#7-optional-configure-freqtrade-as-a-systemd-service) for more details.
|
| `webhook.webhookstatus` | Payload to send on status calls. Only required if `webhook.enabled` is `true`. See the [webhook documentation](webhook-config.md) for more details. <br> **Datatype:** String
|
||||||
| `logfile` | | Specify Logfile. Uses a rolling strategy of 10 files, with 1Mb per file.
|
| `api_server.enabled` | Enable usage of API Server. See the [API Server documentation](rest-api.md) for more details. <br> **Datatype:** Boolean
|
||||||
| `user_data_dir` | cwd()/user_data | Directory containing user data. Defaults to `./user_data/`.
|
| `api_server.listen_ip_address` | Bind IP address. See the [API Server documentation](rest-api.md) for more details. <br> **Datatype:** IPv4
|
||||||
|
| `api_server.listen_port` | Bind Port. See the [API Server documentation](rest-api.md) for more details. <br>**Datatype:** Integer between 1024 and 65535
|
||||||
|
| `api_server.verbosity` | Logging verbosity. `info` will print all RPC Calls, while "error" will only display errors. <br>**Datatype:** Enum, either `info` or `error`. Defaults to `info`.
|
||||||
|
| `api_server.username` | Username for API server. See the [API Server documentation](rest-api.md) for more details. <br>**Keep it in secret, do not disclose publicly.**<br> **Datatype:** String
|
||||||
|
| `api_server.password` | Password for API server. See the [API Server documentation](rest-api.md) for more details. <br>**Keep it in secret, do not disclose publicly.**<br> **Datatype:** String
|
||||||
|
| `db_url` | Declares database URL to use. NOTE: This defaults to `sqlite:///tradesv3.dryrun.sqlite` if `dry_run` is `true`, and to `sqlite:///tradesv3.sqlite` for production instances. <br> **Datatype:** String, SQLAlchemy connect string
|
||||||
|
| `initial_state` | Defines the initial application state. More information below. <br>*Defaults to `stopped`.* <br> **Datatype:** Enum, either `stopped` or `running`
|
||||||
|
| `forcebuy_enable` | Enables the RPC Commands to force a buy. More information below. <br> **Datatype:** Boolean
|
||||||
|
| `disable_dataframe_checks` | Disable checking the OHLCV dataframe returned from the strategy methods for correctness. Only use when intentionally changing the dataframe and understand what you are doing. [Strategy Override](#parameters-in-the-strategy).<br> *Defaults to `False`*. <br> **Datatype:** Boolean
|
||||||
|
| `strategy` | **Required** Defines Strategy class to use. Recommended to be set via `--strategy NAME`. <br> **Datatype:** ClassName
|
||||||
|
| `strategy_path` | Adds an additional strategy lookup path (must be a directory). <br> **Datatype:** String
|
||||||
|
| `internals.process_throttle_secs` | Set the process throttle. Value in second. <br>*Defaults to `5` seconds.* <br> **Datatype:** Positive Integer
|
||||||
|
| `internals.heartbeat_interval` | Print heartbeat message every N seconds. Set to 0 to disable heartbeat messages. <br>*Defaults to `60` seconds.* <br> **Datatype:** Positive Integer or 0
|
||||||
|
| `internals.sd_notify` | Enables use of the sd_notify protocol to tell systemd service manager about changes in the bot state and issue keep-alive pings. See [here](installation.md#7-optional-configure-freqtrade-as-a-systemd-service) for more details. <br> **Datatype:** Boolean
|
||||||
|
| `logfile` | Specifies logfile name. Uses a rolling strategy for log file rotation for 10 files with the 1MB limit per file. <br> **Datatype:** String
|
||||||
|
| `user_data_dir` | Directory containing user data. <br> *Defaults to `./user_data/`*. <br> **Datatype:** String
|
||||||
|
| `dataformat_ohlcv` | Data format to use to store historical candle (OHLCV) data. <br> *Defaults to `json`*. <br> **Datatype:** String
|
||||||
|
| `dataformat_trades` | Data format to use to store historical trades data. <br> *Defaults to `jsongz`*. <br> **Datatype:** String
|
||||||
|
|
||||||
### Parameters in the strategy
|
### Parameters in the strategy
|
||||||
|
|
||||||
The following parameters can be set in either configuration file or strategy.
|
The following parameters can be set in either configuration file or strategy.
|
||||||
Values set in the configuration file always overwrite values set in the strategy.
|
Values set in the configuration file always overwrite values set in the strategy.
|
||||||
|
|
||||||
* `ticker_interval`
|
|
||||||
* `minimal_roi`
|
* `minimal_roi`
|
||||||
|
* `timeframe`
|
||||||
* `stoploss`
|
* `stoploss`
|
||||||
* `trailing_stop`
|
* `trailing_stop`
|
||||||
* `trailing_stop_positive`
|
* `trailing_stop_positive`
|
||||||
* `trailing_stop_positive_offset`
|
* `trailing_stop_positive_offset`
|
||||||
|
* `trailing_only_offset_is_reached`
|
||||||
* `process_only_new_candles`
|
* `process_only_new_candles`
|
||||||
* `order_types`
|
* `order_types`
|
||||||
* `order_time_in_force`
|
* `order_time_in_force`
|
||||||
|
* `stake_currency`
|
||||||
|
* `stake_amount`
|
||||||
|
* `unfilledtimeout`
|
||||||
|
* `disable_dataframe_checks`
|
||||||
* `use_sell_signal` (ask_strategy)
|
* `use_sell_signal` (ask_strategy)
|
||||||
* `sell_profit_only` (ask_strategy)
|
* `sell_profit_only` (ask_strategy)
|
||||||
* `ignore_roi_if_buy_signal` (ask_strategy)
|
* `ignore_roi_if_buy_signal` (ask_strategy)
|
||||||
|
|
||||||
### Understand stake_amount
|
### Configuring amount per trade
|
||||||
|
|
||||||
The `stake_amount` configuration parameter is an amount of crypto-currency your bot will use for each trade.
|
There are several methods to configure how much of the stake currency the bot will use to enter a trade. All methods respect the [available balance configuration](#available-balance) as explained below.
|
||||||
The minimal value is 0.0005. If there is not enough crypto-currency in
|
|
||||||
the account an exception is generated.
|
#### Available balance
|
||||||
To allow the bot to trade all the available `stake_currency` in your account set
|
|
||||||
|
By default, the bot assumes that the `complete amount - 1%` is at it's disposal, and when using [dynamic stake amount](#dynamic-stake-amount), it will split the complete balance into `max_open_trades` buckets per trade.
|
||||||
|
Freqtrade will reserve 1% for eventual fees when entering a trade and will therefore not touch that by default.
|
||||||
|
|
||||||
|
You can configure the "untouched" amount by using the `tradable_balance_ratio` setting.
|
||||||
|
|
||||||
|
For example, if you have 10 ETH available in your wallet on the exchange and `tradable_balance_ratio=0.5` (which is 50%), then the bot will use a maximum amount of 5 ETH for trading and considers this as available balance. The rest of the wallet is untouched by the trades.
|
||||||
|
|
||||||
|
!!! Warning
|
||||||
|
The `tradable_balance_ratio` setting applies to the current balance (free balance + tied up in trades). Therefore, assuming the starting balance of 1000, a configuration with `tradable_balance_ratio=0.99` will not guarantee that 10 currency units will always remain available on the exchange. For example, the free amount may reduce to 5 units if the total balance is reduced to 500 (either by a losing streak, or by withdrawing balance).
|
||||||
|
|
||||||
|
#### Amend last stake amount
|
||||||
|
|
||||||
|
Assuming we have the tradable balance of 1000 USDT, `stake_amount=400`, and `max_open_trades=3`.
|
||||||
|
The bot would open 2 trades, and will be unable to fill the last trading slot, since the requested 400 USDT are no longer available, since 800 USDT are already tied in other trades.
|
||||||
|
|
||||||
|
To overcome this, the option `amend_last_stake_amount` can be set to `True`, which will enable the bot to reduce stake_amount to the available balance in order to fill the last trade slot.
|
||||||
|
|
||||||
|
In the example above this would mean:
|
||||||
|
|
||||||
|
- Trade1: 400 USDT
|
||||||
|
- Trade2: 400 USDT
|
||||||
|
- Trade3: 200 USDT
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
This option only applies with [Static stake amount](#static-stake-amount) - since [Dynamic stake amount](#dynamic-stake-amount) divides the balances evenly.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
The minimum last stake amount can be configured using `amend_last_stake_amount` - which defaults to 0.5 (50%). This means that the minimum stake amount that's ever used is `stake_amount * 0.5`. This avoids very low stake amounts, that are close to the minimum tradable amount for the pair and can be refused by the exchange.
|
||||||
|
|
||||||
|
#### Static stake amount
|
||||||
|
|
||||||
|
The `stake_amount` configuration statically configures the amount of stake-currency your bot will use for each trade.
|
||||||
|
|
||||||
|
The minimal configuration value is 0.0001, however, please check your exchange's trading minimums for the stake currency you're using to avoid problems.
|
||||||
|
|
||||||
|
This setting works in combination with `max_open_trades`. The maximum capital engaged in trades is `stake_amount * max_open_trades`.
|
||||||
|
For example, the bot will at most use (0.05 BTC x 3) = 0.15 BTC, assuming a configuration of `max_open_trades=3` and `stake_amount=0.05`.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
This setting respects the [available balance configuration](#available-balance).
|
||||||
|
|
||||||
|
#### Dynamic stake amount
|
||||||
|
|
||||||
|
Alternatively, you can use a dynamic stake amount, which will use the available balance on the exchange, and divide that equally by the amount of allowed trades (`max_open_trades`).
|
||||||
|
|
||||||
|
To configure this, set `stake_amount="unlimited"`. We also recommend to set `tradable_balance_ratio=0.99` (99%) - to keep a minimum balance for eventual fees.
|
||||||
|
|
||||||
|
In this case a trade amount is calculated as:
|
||||||
|
|
||||||
|
```python
|
||||||
|
currency_balance / (max_open_trades - current_open_trades)
|
||||||
|
```
|
||||||
|
|
||||||
|
To allow the bot to trade all the available `stake_currency` in your account (minus `tradable_balance_ratio`) set
|
||||||
|
|
||||||
```json
|
```json
|
||||||
"stake_amount" : "unlimited",
|
"stake_amount" : "unlimited",
|
||||||
|
"tradable_balance_ratio": 0.99,
|
||||||
```
|
```
|
||||||
|
|
||||||
In this case a trade amount is calclulated as:
|
!!! Note
|
||||||
|
This configuration will allow increasing / decreasing stakes depending on the performance of the bot (lower stake if bot is loosing, higher stakes if the bot has a winning record, since higher balances are available).
|
||||||
|
|
||||||
```python
|
!!! Note "When using Dry-Run Mode"
|
||||||
currency_balanse / (max_open_trades - current_open_trades)
|
When using `"stake_amount" : "unlimited",` in combination with Dry-Run, the balance will be simulated starting with a stake of `dry_run_wallet` which will evolve over time. It is therefore important to set `dry_run_wallet` to a sensible value (like 0.05 or 0.01 for BTC and 1000 or 100 for USDT, for example), otherwise it may simulate trades with 100 BTC (or more) or 0.05 USDT (or less) at once - which may not correspond to your real available balance or is less than the exchange minimal limit for the order amount for the stake currency.
|
||||||
```
|
|
||||||
|
|
||||||
### Understand minimal_roi
|
### Understand minimal_roi
|
||||||
|
|
||||||
The `minimal_roi` configuration parameter is a JSON object where the key is a duration
|
The `minimal_roi` configuration parameter is a JSON object where the key is a duration
|
||||||
in minutes and the value is the minimum ROI in percent.
|
in minutes and the value is the minimum ROI as ratio.
|
||||||
See the example below:
|
See the example below:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
@@ -158,6 +235,9 @@ This parameter can be set in either Strategy or Configuration file. If you use i
|
|||||||
`minimal_roi` value from the strategy file.
|
`minimal_roi` value from the strategy file.
|
||||||
If it is not set in either Strategy or Configuration, a default of 1000% `{"0": 10}` is used, and minimal roi is disabled unless your trade generates 1000% profit.
|
If it is not set in either Strategy or Configuration, a default of 1000% `{"0": 10}` is used, and minimal roi is disabled unless your trade generates 1000% profit.
|
||||||
|
|
||||||
|
!!! Note "Special case to forcesell after a specific time"
|
||||||
|
A special case presents using `"<N>": -1` as ROI. This forces the bot to sell a trade after N Minutes, no matter if it's positive or negative, so represents a time-limited force-sell.
|
||||||
|
|
||||||
### Understand stoploss
|
### Understand stoploss
|
||||||
|
|
||||||
Go to the [stoploss documentation](stoploss.md) for more details.
|
Go to the [stoploss documentation](stoploss.md) for more details.
|
||||||
@@ -190,30 +270,21 @@ before asking the strategy if we should buy or a sell an asset. After each wait
|
|||||||
every opened trade wether or not we should sell, and for all the remaining pairs (either the dynamic list of pairs or
|
every opened trade wether or not we should sell, and for all the remaining pairs (either the dynamic list of pairs or
|
||||||
the static list of pairs) if we should buy.
|
the static list of pairs) if we should buy.
|
||||||
|
|
||||||
### Understand ask_last_balance
|
|
||||||
|
|
||||||
The `ask_last_balance` configuration parameter sets the bidding price. Value `0.0` will use `ask` price, `1.0` will
|
|
||||||
use the `last` price and values between those interpolate between ask and last
|
|
||||||
price. Using `ask` price will guarantee quick success in bid, but bot will also
|
|
||||||
end up paying more then would probably have been necessary.
|
|
||||||
|
|
||||||
### Understand order_types
|
### Understand order_types
|
||||||
|
|
||||||
The `order_types` configuration parameter maps actions (`buy`, `sell`, `stoploss`) to order-types (`market`, `limit`, ...) as well as configures stoploss to be on the exchange and defines stoploss on exchange update interval in seconds.
|
The `order_types` configuration parameter maps actions (`buy`, `sell`, `stoploss`, `emergencysell`) to order-types (`market`, `limit`, ...) as well as configures stoploss to be on the exchange and defines stoploss on exchange update interval in seconds.
|
||||||
|
|
||||||
This allows to buy using limit orders, sell using
|
This allows to buy using limit orders, sell using
|
||||||
limit-orders, and create stoplosses using using market orders. It also allows to set the
|
limit-orders, and create stoplosses using market orders. It also allows to set the
|
||||||
stoploss "on exchange" which means stoploss order would be placed immediately once
|
stoploss "on exchange" which means stoploss order would be placed immediately once
|
||||||
the buy order is fulfilled.
|
the buy order is fulfilled.
|
||||||
If `stoploss_on_exchange` and `trailing_stop` are both set, then the bot will use `stoploss_on_exchange_interval` to check and update the stoploss on exchange periodically.
|
|
||||||
`order_types` can be set in the configuration file or in the strategy.
|
|
||||||
`order_types` set in the configuration file overwrites values set in the strategy as a whole, so you need to configure the whole `order_types` dictionary in one place.
|
`order_types` set in the configuration file overwrites values set in the strategy as a whole, so you need to configure the whole `order_types` dictionary in one place.
|
||||||
|
|
||||||
If this is configured, the following 4 values (`buy`, `sell`, `stoploss` and
|
If this is configured, the following 4 values (`buy`, `sell`, `stoploss` and
|
||||||
`stoploss_on_exchange`) need to be present, otherwise the bot will fail to start.
|
`stoploss_on_exchange`) need to be present, otherwise the bot will fail to start.
|
||||||
|
|
||||||
`emergencysell` is an optional value, which defaults to `market` and is used when creating stoploss on exchange orders fails.
|
For information on (`emergencysell`,`stoploss_on_exchange`,`stoploss_on_exchange_interval`,`stoploss_on_exchange_limit_ratio`) please see stop loss documentation [stop loss on exchange](stoploss.md)
|
||||||
The below is the default which is used if this is not configured in either strategy or configuration file.
|
|
||||||
|
|
||||||
Syntax for Strategy:
|
Syntax for Strategy:
|
||||||
|
|
||||||
@@ -224,7 +295,8 @@ order_types = {
|
|||||||
"emergencysell": "market",
|
"emergencysell": "market",
|
||||||
"stoploss": "market",
|
"stoploss": "market",
|
||||||
"stoploss_on_exchange": False,
|
"stoploss_on_exchange": False,
|
||||||
"stoploss_on_exchange_interval": 60
|
"stoploss_on_exchange_interval": 60,
|
||||||
|
"stoploss_on_exchange_limit_ratio": 0.99,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -252,9 +324,12 @@ Configuration:
|
|||||||
refer to [the stoploss documentation](stoploss.md).
|
refer to [the stoploss documentation](stoploss.md).
|
||||||
|
|
||||||
!!! Note
|
!!! Note
|
||||||
If `stoploss_on_exchange` is enabled and the stoploss is cancelled manually on the exchange, then the bot will create a new order.
|
If `stoploss_on_exchange` is enabled and the stoploss is cancelled manually on the exchange, then the bot will create a new stoploss order.
|
||||||
|
|
||||||
!!! Warning stoploss_on_exchange failures
|
!!! Warning "Using market orders"
|
||||||
|
Please read the section [Market order pricing](#market-order-pricing) section when using market orders.
|
||||||
|
|
||||||
|
!!! Warning "Warning: stoploss_on_exchange failures"
|
||||||
If stoploss on exchange creation fails for some reason, then an "emergency sell" is initiated. By default, this will sell the asset using a market order. The order-type for the emergency-sell can be changed by setting the `emergencysell` value in the `order_types` dictionary - however this is not advised.
|
If stoploss on exchange creation fails for some reason, then an "emergency sell" is initiated. By default, this will sell the asset using a market order. The order-type for the emergency-sell can be changed by setting the `emergencysell` value in the `order_types` dictionary - however this is not advised.
|
||||||
|
|
||||||
### Understand order_time_in_force
|
### Understand order_time_in_force
|
||||||
@@ -268,7 +343,7 @@ This is most of the time the default time in force. It means the order will rema
|
|||||||
on exchange till it is canceled by user. It can be fully or partially fulfilled.
|
on exchange till it is canceled by user. It can be fully or partially fulfilled.
|
||||||
If partially fulfilled, the remaining will stay on the exchange till cancelled.
|
If partially fulfilled, the remaining will stay on the exchange till cancelled.
|
||||||
|
|
||||||
**FOK (Full Or Kill):**
|
**FOK (Fill Or Kill):**
|
||||||
|
|
||||||
It means if the order is not executed immediately AND fully then it is canceled by the exchange.
|
It means if the order is not executed immediately AND fully then it is canceled by the exchange.
|
||||||
|
|
||||||
@@ -298,16 +373,18 @@ The possible values are: `gtc` (default), `fok` or `ioc`.
|
|||||||
|
|
||||||
Freqtrade is based on [CCXT library](https://github.com/ccxt/ccxt) that supports over 100 cryptocurrency
|
Freqtrade is based on [CCXT library](https://github.com/ccxt/ccxt) that supports over 100 cryptocurrency
|
||||||
exchange markets and trading APIs. The complete up-to-date list can be found in the
|
exchange markets and trading APIs. The complete up-to-date list can be found in the
|
||||||
[CCXT repo homepage](https://github.com/ccxt/ccxt/tree/master/python). However, the bot was tested
|
[CCXT repo homepage](https://github.com/ccxt/ccxt/tree/master/python).
|
||||||
with only Bittrex and Binance.
|
However, the bot was tested by the development team with only Bittrex, Binance and Kraken,
|
||||||
|
so the these are the only officially supported exchanges:
|
||||||
The bot was tested with the following exchanges:
|
|
||||||
|
|
||||||
- [Bittrex](https://bittrex.com/): "bittrex"
|
- [Bittrex](https://bittrex.com/): "bittrex"
|
||||||
- [Binance](https://www.binance.com/): "binance"
|
- [Binance](https://www.binance.com/): "binance"
|
||||||
|
- [Kraken](https://kraken.com/): "kraken"
|
||||||
|
|
||||||
Feel free to test other exchanges and submit your PR to improve the bot.
|
Feel free to test other exchanges and submit your PR to improve the bot.
|
||||||
|
|
||||||
|
Some exchanges require special configuration, which can be found on the [Exchange-specific Notes](exchanges.md) documentation page.
|
||||||
|
|
||||||
#### Sample exchange configuration
|
#### Sample exchange configuration
|
||||||
|
|
||||||
A exchange configuration for "binance" would look as follows:
|
A exchange configuration for "binance" would look as follows:
|
||||||
@@ -331,13 +408,13 @@ This configuration enables binance, as well as rate limiting to avoid bans from
|
|||||||
Optimal settings for rate limiting depend on the exchange and the size of the whitelist, so an ideal parameter will vary on many other settings.
|
Optimal settings for rate limiting depend on the exchange and the size of the whitelist, so an ideal parameter will vary on many other settings.
|
||||||
We try to provide sensible defaults per exchange where possible, if you encounter bans please make sure that `"enableRateLimit"` is enabled and increase the `"rateLimit"` parameter step by step.
|
We try to provide sensible defaults per exchange where possible, if you encounter bans please make sure that `"enableRateLimit"` is enabled and increase the `"rateLimit"` parameter step by step.
|
||||||
|
|
||||||
#### Advanced FreqTrade Exchange configuration
|
#### Advanced Freqtrade Exchange configuration
|
||||||
|
|
||||||
Advanced options can be configured using the `_ft_has_params` setting, which will override Defaults and exchange-specific behaviours.
|
Advanced options can be configured using the `_ft_has_params` setting, which will override Defaults and exchange-specific behaviours.
|
||||||
|
|
||||||
Available options are listed in the exchange-class as `_ft_has_default`.
|
Available options are listed in the exchange-class as `_ft_has_default`.
|
||||||
|
|
||||||
For example, to test the order type `FOK` with Kraken, and modify candle_limit to 200 (so you only get 200 candles per call):
|
For example, to test the order type `FOK` with Kraken, and modify candle limit to 200 (so you only get 200 candles per API call):
|
||||||
|
|
||||||
```json
|
```json
|
||||||
"exchange": {
|
"exchange": {
|
||||||
@@ -370,6 +447,272 @@ The valid values are:
|
|||||||
"BTC", "ETH", "XRP", "LTC", "BCH", "USDT"
|
"BTC", "ETH", "XRP", "LTC", "BCH", "USDT"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Prices used for orders
|
||||||
|
|
||||||
|
Prices for regular orders can be controlled via the parameter structures `bid_strategy` for buying and `ask_strategy` for selling.
|
||||||
|
Prices are always retrieved right before an order is placed, either by querying the exchange tickers or by using the orderbook data.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
Orderbook data used by Freqtrade are the data retrieved from exchange by the ccxt's function `fetch_order_book()`, i.e. are usually data from the L2-aggregated orderbook, while the ticker data are the structures returned by the ccxt's `fetch_ticker()`/`fetch_tickers()` functions. Refer to the ccxt library [documentation](https://github.com/ccxt/ccxt/wiki/Manual#market-data) for more details.
|
||||||
|
|
||||||
|
!!! Warning "Using market orders"
|
||||||
|
Please read the section [Market order pricing](#market-order-pricing) section when using market orders.
|
||||||
|
|
||||||
|
### Buy price
|
||||||
|
|
||||||
|
#### Check depth of market
|
||||||
|
|
||||||
|
When check depth of market is enabled (`bid_strategy.check_depth_of_market.enabled=True`), the buy signals are filtered based on the orderbook depth (sum of all amounts) for each orderbook side.
|
||||||
|
|
||||||
|
Orderbook `bid` (buy) side depth is then divided by the orderbook `ask` (sell) side depth and the resulting delta is compared to the value of the `bid_strategy.check_depth_of_market.bids_to_ask_delta` parameter. The buy order is only executed if the orderbook delta is greater than or equal to the configured delta value.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
A delta value below 1 means that `ask` (sell) orderbook side depth is greater than the depth of the `bid` (buy) orderbook side, while a value greater than 1 means opposite (depth of the buy side is higher than the depth of the sell side).
|
||||||
|
|
||||||
|
#### Buy price side
|
||||||
|
|
||||||
|
The configuration setting `bid_strategy.price_side` defines the side of the spread the bot looks for when buying.
|
||||||
|
|
||||||
|
The following displays an orderbook.
|
||||||
|
|
||||||
|
``` explanation
|
||||||
|
...
|
||||||
|
103
|
||||||
|
102
|
||||||
|
101 # ask
|
||||||
|
-------------Current spread
|
||||||
|
99 # bid
|
||||||
|
98
|
||||||
|
97
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
If `bid_strategy.price_side` is set to `"bid"`, then the bot will use 99 as buying price.
|
||||||
|
In line with that, if `bid_strategy.price_side` is set to `"ask"`, then the bot will use 101 as buying price.
|
||||||
|
|
||||||
|
Using `ask` price often guarantees quicker filled orders, but the bot can also end up paying more than what would have been necessary.
|
||||||
|
Taker fees instead of maker fees will most likely apply even when using limit buy orders.
|
||||||
|
Also, prices at the "ask" side of the spread are higher than prices at the "bid" side in the orderbook, so the order behaves similar to a market order (however with a maximum price).
|
||||||
|
|
||||||
|
#### Buy price with Orderbook enabled
|
||||||
|
|
||||||
|
When buying with the orderbook enabled (`bid_strategy.use_order_book=True`), Freqtrade fetches the `bid_strategy.order_book_top` entries from the orderbook and then uses the entry specified as `bid_strategy.order_book_top` on the configured side (`bid_strategy.price_side`) of the orderbook. 1 specifies the topmost entry in the orderbook, while 2 would use the 2nd entry in the orderbook, and so on.
|
||||||
|
|
||||||
|
#### Buy price without Orderbook enabled
|
||||||
|
|
||||||
|
The following section uses `side` as the configured `bid_strategy.price_side`.
|
||||||
|
|
||||||
|
When not using orderbook (`bid_strategy.use_order_book=False`), Freqtrade uses the best `side` price from the ticker if it's below the `last` traded price from the ticker. Otherwise (when the `side` price is above the `last` price), it calculates a rate between `side` and `last` price.
|
||||||
|
|
||||||
|
The `bid_strategy.ask_last_balance` configuration parameter controls this. A value of `0.0` will use `side` price, while `1.0` will use the `last` price and values between those interpolate between ask and last price.
|
||||||
|
|
||||||
|
### Sell price
|
||||||
|
|
||||||
|
#### Sell price side
|
||||||
|
|
||||||
|
The configuration setting `ask_strategy.price_side` defines the side of the spread the bot looks for when selling.
|
||||||
|
|
||||||
|
The following displays an orderbook:
|
||||||
|
|
||||||
|
``` explanation
|
||||||
|
...
|
||||||
|
103
|
||||||
|
102
|
||||||
|
101 # ask
|
||||||
|
-------------Current spread
|
||||||
|
99 # bid
|
||||||
|
98
|
||||||
|
97
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
If `ask_strategy.price_side` is set to `"ask"`, then the bot will use 101 as selling price.
|
||||||
|
In line with that, if `ask_strategy.price_side` is set to `"bid"`, then the bot will use 99 as selling price.
|
||||||
|
|
||||||
|
#### Sell price with Orderbook enabled
|
||||||
|
|
||||||
|
When selling with the orderbook enabled (`ask_strategy.use_order_book=True`), Freqtrade fetches the `ask_strategy.order_book_max` entries in the orderbook. Then each of the orderbook steps between `ask_strategy.order_book_min` and `ask_strategy.order_book_max` on the configured orderbook side are validated for a profitable sell-possibility based on the strategy configuration (`minimal_roi` conditions) and the sell order is placed at the first profitable spot.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
Using `order_book_max` higher than `order_book_min` only makes sense when ask_strategy.price_side is set to `"ask"`.
|
||||||
|
|
||||||
|
The idea here is to place the sell order early, to be ahead in the queue.
|
||||||
|
|
||||||
|
A fixed slot (mirroring `bid_strategy.order_book_top`) can be defined by setting `ask_strategy.order_book_min` and `ask_strategy.order_book_max` to the same number.
|
||||||
|
|
||||||
|
!!! Warning "Order_book_max > 1 - increased risks for stoplosses!"
|
||||||
|
Using `ask_strategy.order_book_max` higher than 1 will increase the risk the stoploss on exchange is cancelled too early, since an eventual [stoploss on exchange](#understand-order_types) will be cancelled as soon as the order is placed.
|
||||||
|
Also, the sell order will remain on the exchange for `unfilledtimeout.sell` (or until it's filled) - which can lead to missed stoplosses (with or without using stoploss on exchange).
|
||||||
|
|
||||||
|
!!! Warning "Order_book_max > 1 in dry-run"
|
||||||
|
Using `ask_strategy.order_book_max` higher than 1 will result in improper dry-run results (significantly better than real orders executed on exchange), since dry-run assumes orders to be filled almost instantly.
|
||||||
|
It is therefore advised to not use this setting for dry-runs.
|
||||||
|
|
||||||
|
#### Sell price without Orderbook enabled
|
||||||
|
|
||||||
|
When not using orderbook (`ask_strategy.use_order_book=False`), the price at the `ask_strategy.price_side` side (defaults to `"ask"`) from the ticker will be used as the sell price.
|
||||||
|
|
||||||
|
### Market order pricing
|
||||||
|
|
||||||
|
When using market orders, prices should be configured to use the "correct" side of the orderbook to allow realistic pricing detection.
|
||||||
|
Assuming both buy and sell are using market orders, a configuration similar to the following might be used
|
||||||
|
|
||||||
|
``` jsonc
|
||||||
|
"order_types": {
|
||||||
|
"buy": "market",
|
||||||
|
"sell": "market"
|
||||||
|
// ...
|
||||||
|
},
|
||||||
|
"bid_strategy": {
|
||||||
|
"price_side": "ask",
|
||||||
|
// ...
|
||||||
|
},
|
||||||
|
"ask_strategy":{
|
||||||
|
"price_side": "bid",
|
||||||
|
// ...
|
||||||
|
},
|
||||||
|
```
|
||||||
|
|
||||||
|
Obviously, if only one side is using limit orders, different pricing combinations can be used.
|
||||||
|
|
||||||
|
## Pairlists and Pairlist Handlers
|
||||||
|
|
||||||
|
Pairlist Handlers define the list of pairs (pairlist) that the bot should trade. They are configured in the `pairlists` section of the configuration settings.
|
||||||
|
|
||||||
|
In your configuration, you can use Static Pairlist (defined by the [`StaticPairList`](#static-pair-list) Pairlist Handler) and Dynamic Pairlist (defined by the [`VolumePairList`](#volume-pair-list) Pairlist Handler).
|
||||||
|
|
||||||
|
Additionaly, [`AgeFilter`](#agefilter), [`PrecisionFilter`](#precisionfilter), [`PriceFilter`](#pricefilter), [`ShuffleFilter`](#shufflefilter) and [`SpreadFilter`](#spreadfilter) act as Pairlist Filters, removing certain pairs and/or moving their positions in the pairlist.
|
||||||
|
|
||||||
|
If multiple Pairlist Handlers are used, they are chained and a combination of all Pairlist Handlers forms the resulting pairlist the bot uses for trading and backtesting. Pairlist Handlers are executed in the sequence they are configured. You should always configure either `StaticPairList` or `VolumePairList` as the starting Pairlist Handler.
|
||||||
|
|
||||||
|
Inactive markets are always removed from the resulting pairlist. Explicitly blacklisted pairs (those in the `pair_blacklist` configuration setting) are also always removed from the resulting pairlist.
|
||||||
|
|
||||||
|
### Available Pairlist Handlers
|
||||||
|
|
||||||
|
* [`StaticPairList`](#static-pair-list) (default, if not configured differently)
|
||||||
|
* [`VolumePairList`](#volume-pair-list)
|
||||||
|
* [`AgeFilter`](#agefilter)
|
||||||
|
* [`PrecisionFilter`](#precisionfilter)
|
||||||
|
* [`PriceFilter`](#pricefilter)
|
||||||
|
* [`ShuffleFilter`](#shufflefilter)
|
||||||
|
* [`SpreadFilter`](#spreadfilter)
|
||||||
|
|
||||||
|
!!! Tip "Testing pairlists"
|
||||||
|
Pairlist configurations can be quite tricky to get right. Best use the [`test-pairlist`](utils.md#test-pairlist) utility subcommand to test your configuration quickly.
|
||||||
|
|
||||||
|
#### Static Pair List
|
||||||
|
|
||||||
|
By default, the `StaticPairList` method is used, which uses a statically defined pair whitelist from the configuration.
|
||||||
|
|
||||||
|
It uses configuration from `exchange.pair_whitelist` and `exchange.pair_blacklist`.
|
||||||
|
|
||||||
|
```json
|
||||||
|
"pairlists": [
|
||||||
|
{"method": "StaticPairList"}
|
||||||
|
],
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Volume Pair List
|
||||||
|
|
||||||
|
`VolumePairList` employs sorting/filtering of pairs by their trading volume. It selects `number_assets` top pairs with sorting based on the `sort_key` (which can only be `quoteVolume`).
|
||||||
|
|
||||||
|
When used in the chain of Pairlist Handlers in a non-leading position (after StaticPairList and other Pairlist Filters), `VolumePairList` considers outputs of previous Pairlist Handlers, adding its sorting/selection of the pairs by the trading volume.
|
||||||
|
|
||||||
|
When used on the leading position of the chain of Pairlist Handlers, it does not consider `pair_whitelist` configuration setting, but selects the top assets from all available markets (with matching stake-currency) on the exchange.
|
||||||
|
|
||||||
|
The `refresh_period` setting allows to define the period (in seconds), at which the pairlist will be refreshed. Defaults to 1800s (30 minutes).
|
||||||
|
|
||||||
|
`VolumePairList` is based on the ticker data from exchange, as reported by the ccxt library:
|
||||||
|
|
||||||
|
* The `quoteVolume` is the amount of quote (stake) currency traded (bought or sold) in last 24 hours.
|
||||||
|
|
||||||
|
```json
|
||||||
|
"pairlists": [{
|
||||||
|
"method": "VolumePairList",
|
||||||
|
"number_assets": 20,
|
||||||
|
"sort_key": "quoteVolume",
|
||||||
|
"refresh_period": 1800,
|
||||||
|
}],
|
||||||
|
```
|
||||||
|
|
||||||
|
#### AgeFilter
|
||||||
|
|
||||||
|
Removes pairs that have been listed on the exchange for less than `min_days_listed` days (defaults to `10`).
|
||||||
|
|
||||||
|
When pairs are first listed on an exchange they can suffer huge price drops and volatility
|
||||||
|
in the first few days while the pair goes through its price-discovery period. Bots can often
|
||||||
|
be caught out buying before the pair has finished dropping in price.
|
||||||
|
|
||||||
|
This filter allows freqtrade to ignore pairs until they have been listed for at least `min_days_listed` days.
|
||||||
|
|
||||||
|
#### PrecisionFilter
|
||||||
|
|
||||||
|
Filters low-value coins which would not allow setting stoplosses.
|
||||||
|
|
||||||
|
#### PriceFilter
|
||||||
|
|
||||||
|
The `PriceFilter` allows filtering of pairs by price. Currently the following price filters are supported:
|
||||||
|
|
||||||
|
* `min_price`
|
||||||
|
* `max_price`
|
||||||
|
* `low_price_ratio`
|
||||||
|
|
||||||
|
The `min_price` setting removes pairs where the price is below the specified price. This is useful if you wish to avoid trading very low-priced pairs.
|
||||||
|
This option is disabled by default, and will only apply if set to > 0.
|
||||||
|
|
||||||
|
The `max_price` setting removes pairs where the price is above the specified price. This is useful if you wish to trade only low-priced pairs.
|
||||||
|
This option is disabled by default, and will only apply if set to > 0.
|
||||||
|
|
||||||
|
The `low_price_ratio` setting removes pairs where a raise of 1 price unit (pip) is above the `low_price_ratio` ratio.
|
||||||
|
This option is disabled by default, and will only apply if set to > 0.
|
||||||
|
|
||||||
|
For `PriceFiler` at least one of its `min_price`, `max_price` or `low_price_ratio` settings must be applied.
|
||||||
|
|
||||||
|
Calculation example:
|
||||||
|
|
||||||
|
Min price precision for SHITCOIN/BTC is 8 decimals. If its price is 0.00000011 - one price step above would be 0.00000012, which is ~9% higher than the previous price value. You may filter out this pair by using PriceFilter with `low_price_ratio` set to 0.09 (9%) or with `min_price` set to 0.00000011, correspondingly.
|
||||||
|
|
||||||
|
!!! Warning "Low priced pairs"
|
||||||
|
Low priced pairs with high "1 pip movements" are dangerous since they are often illiquid and it may also be impossible to place the desired stoploss, which can often result in high losses since price needs to be rounded to the next tradable price - so instead of having a stoploss of -5%, you could end up with a stoploss of -9% simply due to price rounding.
|
||||||
|
|
||||||
|
#### ShuffleFilter
|
||||||
|
|
||||||
|
Shuffles (randomizes) pairs in the pairlist. It can be used for preventing the bot from trading some of the pairs more frequently then others when you want all pairs be treated with the same priority.
|
||||||
|
|
||||||
|
!!! Tip
|
||||||
|
You may set the `seed` value for this Pairlist to obtain reproducible results, which can be useful for repeated backtesting sessions. If `seed` is not set, the pairs are shuffled in the non-repeatable random order.
|
||||||
|
|
||||||
|
#### SpreadFilter
|
||||||
|
|
||||||
|
Removes pairs that have a difference between asks and bids above the specified ratio, `max_spread_ratio` (defaults to `0.005`).
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
If `DOGE/BTC` maximum bid is 0.00000026 and minimum ask is 0.00000027, the ratio is calculated as: `1 - bid/ask ~= 0.037` which is `> 0.005` and this pair will be filtered out.
|
||||||
|
|
||||||
|
### Full example of Pairlist Handlers
|
||||||
|
|
||||||
|
The below example blacklists `BNB/BTC`, uses `VolumePairList` with `20` assets, sorting pairs by `quoteVolume` and applies both [`PrecisionFilter`](#precisionfilter) and [`PriceFilter`](#price-filter), filtering all assets where 1 priceunit is > 1%. Then the `SpreadFilter` is applied and pairs are finally shuffled with the random seed set to some predefined value.
|
||||||
|
|
||||||
|
```json
|
||||||
|
"exchange": {
|
||||||
|
"pair_whitelist": [],
|
||||||
|
"pair_blacklist": ["BNB/BTC"]
|
||||||
|
},
|
||||||
|
"pairlists": [
|
||||||
|
{
|
||||||
|
"method": "VolumePairList",
|
||||||
|
"number_assets": 20,
|
||||||
|
"sort_key": "quoteVolume",
|
||||||
|
},
|
||||||
|
{"method": "AgeFilter", "min_days_listed": 10},
|
||||||
|
{"method": "PrecisionFilter"},
|
||||||
|
{"method": "PriceFilter", "low_price_ratio": 0.01},
|
||||||
|
{"method": "SpreadFilter", "max_spread_ratio": 0.005},
|
||||||
|
{"method": "ShuffleFilter", "seed": 42}
|
||||||
|
],
|
||||||
|
```
|
||||||
|
|
||||||
## Switch to Dry-run mode
|
## Switch to Dry-run mode
|
||||||
|
|
||||||
We recommend starting the bot in the Dry-run mode to see how your bot will
|
We recommend starting the bot in the Dry-run mode to see how your bot will
|
||||||
@@ -385,7 +728,7 @@ creating trades on the exchange.
|
|||||||
"db_url": "sqlite:///tradesv3.dryrun.sqlite",
|
"db_url": "sqlite:///tradesv3.dryrun.sqlite",
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Remove your Exchange API key and secrete (change them by empty values or fake credentials):
|
3. Remove your Exchange API key and secret (change them by empty values or fake credentials):
|
||||||
|
|
||||||
```json
|
```json
|
||||||
"exchange": {
|
"exchange": {
|
||||||
@@ -396,41 +739,18 @@ creating trades on the exchange.
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Once you will be happy with your bot performance running in the Dry-run mode,
|
Once you will be happy with your bot performance running in the Dry-run mode, you can switch it to production mode.
|
||||||
you can switch it to production mode.
|
|
||||||
|
|
||||||
### Dynamic Pairlists
|
!!! Note
|
||||||
|
A simulated wallet is available during dry-run mode, and will assume a starting capital of `dry_run_wallet` (defaults to 1000).
|
||||||
|
|
||||||
Dynamic pairlists select pairs for you based on the logic configured.
|
### Considerations for dry-run
|
||||||
The bot runs against all pairs (with that stake) on the exchange, and a number of assets
|
|
||||||
(`number_assets`) is selected based on the selected criteria.
|
|
||||||
|
|
||||||
By default, the `StaticPairList` method is used.
|
* API-keys may or may not be provided. Only Read-Only operations (i.e. operations that do not alter account state) on the exchange are performed in the dry-run mode.
|
||||||
The Pairlist method is configured as `pair_whitelist` parameter under the `exchange`
|
* Wallets (`/balance`) are simulated.
|
||||||
section of the configuration.
|
* Orders are simulated, and will not be posted to the exchange.
|
||||||
|
* In combination with `stoploss_on_exchange`, the stop_loss price is assumed to be filled.
|
||||||
**Available Pairlist methods:**
|
* Open orders (not trades, which are stored in the database) are reset on bot restart.
|
||||||
|
|
||||||
* `StaticPairList`
|
|
||||||
* It uses configuration from `exchange.pair_whitelist` and `exchange.pair_blacklist`.
|
|
||||||
* `VolumePairList`
|
|
||||||
* It selects `number_assets` top pairs based on `sort_key`, which can be one of
|
|
||||||
`askVolume`, `bidVolume` and `quoteVolume`, defaults to `quoteVolume`.
|
|
||||||
* There is a possibility to filter low-value coins that would not allow setting a stop loss
|
|
||||||
(set `precision_filter` parameter to `true` for this).
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
```json
|
|
||||||
"pairlist": {
|
|
||||||
"method": "VolumePairList",
|
|
||||||
"config": {
|
|
||||||
"number_assets": 20,
|
|
||||||
"sort_key": "quoteVolume",
|
|
||||||
"precision_filter": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
```
|
|
||||||
|
|
||||||
## Switch to production mode
|
## Switch to production mode
|
||||||
|
|
||||||
@@ -438,6 +758,11 @@ In production mode, the bot will engage your money. Be careful, since a wrong
|
|||||||
strategy can lose all your money. Be aware of what you are doing when
|
strategy can lose all your money. Be aware of what you are doing when
|
||||||
you run it in production mode.
|
you run it in production mode.
|
||||||
|
|
||||||
|
### Setup your exchange account
|
||||||
|
|
||||||
|
You will need to create API Keys (usually you get `key` and `secret`, some exchanges require an additional `password`) from the Exchange website and you'll need to insert this into the appropriate fields in the configuration or when asked by the `freqtrade new-config` command.
|
||||||
|
API Keys are usually only required for live trading (trading for real money, bot running in "production mode", executing real orders on the exchange) and are not required for the bot running in dry-run (trade simulation) mode. When you setup the bot in dry-run mode, you may fill these fields with empty values.
|
||||||
|
|
||||||
### To switch your bot in production mode
|
### To switch your bot in production mode
|
||||||
|
|
||||||
**Edit your `config.json` file.**
|
**Edit your `config.json` file.**
|
||||||
@@ -457,12 +782,11 @@ you run it in production mode.
|
|||||||
"secret": "08a9dc6db3d7b53e1acebd9275677f4b0a04f1a5",
|
"secret": "08a9dc6db3d7b53e1acebd9275677f4b0a04f1a5",
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
!!! Note
|
|
||||||
If you have an exchange API key yet, [see our tutorial](/pre-requisite).
|
|
||||||
|
|
||||||
### Using proxy with FreqTrade
|
You should also make sure to read the [Exchanges](exchanges.md) section of the documentation to be aware of potential configuration details specific to your exchange.
|
||||||
|
|
||||||
|
### Using proxy with Freqtrade
|
||||||
|
|
||||||
To use a proxy with freqtrade, add the kwarg `"aiohttp_trust_env"=true` to the `"ccxt_async_kwargs"` dict in the exchange section of the configuration.
|
To use a proxy with freqtrade, add the kwarg `"aiohttp_trust_env"=true` to the `"ccxt_async_kwargs"` dict in the exchange section of the configuration.
|
||||||
|
|
||||||
@@ -482,14 +806,13 @@ export HTTPS_PROXY="http://addr:port"
|
|||||||
freqtrade
|
freqtrade
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Embedding Strategies
|
||||||
|
|
||||||
### Embedding Strategies
|
Freqtrade provides you with with an easy way to embed the strategy into your configuration file.
|
||||||
|
|
||||||
FreqTrade provides you with with an easy way to embed the strategy into your configuration file.
|
|
||||||
This is done by utilizing BASE64 encoding and providing this string at the strategy configuration field,
|
This is done by utilizing BASE64 encoding and providing this string at the strategy configuration field,
|
||||||
in your chosen config file.
|
in your chosen config file.
|
||||||
|
|
||||||
#### Encoding a string as BASE64
|
### Encoding a string as BASE64
|
||||||
|
|
||||||
This is a quick example, how to generate the BASE64 string in python
|
This is a quick example, how to generate the BASE64 string in python
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,45 @@
|
|||||||
# Analyzing bot data with Jupyter notebooks
|
# Analyzing bot data with Jupyter notebooks
|
||||||
|
|
||||||
You can analyze the results of backtests and trading history easily using Jupyter notebooks. Sample notebooks are located at `user_data/notebooks/`.
|
You can analyze the results of backtests and trading history easily using Jupyter notebooks. Sample notebooks are located at `user_data/notebooks/` after initializing the user directory with `freqtrade create-userdir --userdir user_data`.
|
||||||
|
|
||||||
## Pro tips
|
## Quick start with docker
|
||||||
|
|
||||||
|
Freqtrade provides a docker-compose file which starts up a jupyter lab server.
|
||||||
|
You can run this server using the following command: `docker-compose -f docker/docker-compose-jupyter.yml up`
|
||||||
|
|
||||||
|
This will create a dockercontainer running jupyter lab, which will be accessible using `https://127.0.0.1:8888/lab`.
|
||||||
|
Please use the link that's printed in the console after startup for simplified login.
|
||||||
|
|
||||||
|
For more information, Please visit the [Data analysis with Docker](docker_quickstart.md#data-analayis-using-docker-compose) section.
|
||||||
|
|
||||||
|
### Pro tips
|
||||||
|
|
||||||
* See [jupyter.org](https://jupyter.org/documentation) for usage instructions.
|
* See [jupyter.org](https://jupyter.org/documentation) for usage instructions.
|
||||||
* Don't forget to start a Jupyter notebook server from within your conda or venv environment or use [nb_conda_kernels](https://github.com/Anaconda-Platform/nb_conda_kernels)*
|
* Don't forget to start a Jupyter notebook server from within your conda or venv environment or use [nb_conda_kernels](https://github.com/Anaconda-Platform/nb_conda_kernels)*
|
||||||
* Copy the example notebook before use so your changes don't get clobbered with the next freqtrade update.
|
* Copy the example notebook before use so your changes don't get overwritten with the next freqtrade update.
|
||||||
|
|
||||||
## Fine print
|
### Using virtual environment with system-wide Jupyter installation
|
||||||
|
|
||||||
Some tasks don't work especially well in notebooks. For example, anything using asynchronous execution is a problem for Jupyter. Also, freqtrade's primary entry point is the shell cli, so using pure python in a notebook bypasses arguments that provide required objects and parameters to helper functions. You may need to set those values or create expected objects manually.
|
Sometimes it can be desired to use a system-wide installation of Jupyter notebook, and use a jupyter kernel from the virtual environment.
|
||||||
|
This prevents you from installing the full jupyter suite multiple times per system, and provides an easy way to switch between tasks (freqtrade / other analytics tasks).
|
||||||
|
|
||||||
|
For this to work, first activate your virtual environment and run the following commands:
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
# Activate virtual environment
|
||||||
|
source .env/bin/activate
|
||||||
|
|
||||||
|
pip install ipykernel
|
||||||
|
ipython kernel install --user --name=freqtrade
|
||||||
|
# Restart jupyter (lab / notebook)
|
||||||
|
# select kernel "freqtrade" in the notebook
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
This section is provided for completeness, the Freqtrade Team won't provide full support for problems with this setup and will recommend to install Jupyter in the virtual environment directly, as that is the easiest way to get jupyter notebooks up and running. For help with this setup please refer to the [Project Jupyter](https://jupyter.org/) [documentation](https://jupyter.org/documentation) or [help channels](https://jupyter.org/community).
|
||||||
|
|
||||||
|
!!! Warning
|
||||||
|
Some tasks don't work especially well in notebooks. For example, anything using asynchronous execution is a problem for Jupyter. Also, freqtrade's primary entry point is the shell cli, so using pure python in a notebook bypasses arguments that provide required objects and parameters to helper functions. You may need to set those values or create expected objects manually.
|
||||||
|
|
||||||
## Recommended workflow
|
## Recommended workflow
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,250 @@ If no additional parameter is specified, freqtrade will download data for `"1m"`
|
|||||||
Exchange and pairs will come from `config.json` (if specified using `-c/--config`).
|
Exchange and pairs will come from `config.json` (if specified using `-c/--config`).
|
||||||
Otherwise `--exchange` becomes mandatory.
|
Otherwise `--exchange` becomes mandatory.
|
||||||
|
|
||||||
!!! Tip Updating existing data
|
You can use a relative timerange (`--days 20`) or an absolute starting point (`--timerange 20200101`). For incremental downloads, the relative approach should be used.
|
||||||
|
|
||||||
|
!!! Tip "Tip: Updating existing data"
|
||||||
If you already have backtesting data available in your data-directory and would like to refresh this data up to today, use `--days xx` with a number slightly higher than the missing number of days. Freqtrade will keep the available data and only download the missing data.
|
If you already have backtesting data available in your data-directory and would like to refresh this data up to today, use `--days xx` with a number slightly higher than the missing number of days. Freqtrade will keep the available data and only download the missing data.
|
||||||
Be carefull though: If the number is too small (which would result in a few missing days), the whole dataset will be removed and only xx days will be downloaded.
|
Be careful though: If the number is too small (which would result in a few missing days), the whole dataset will be removed and only xx days will be downloaded.
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
```
|
||||||
|
usage: freqtrade download-data [-h] [-v] [--logfile FILE] [-V] [-c PATH]
|
||||||
|
[-d PATH] [--userdir PATH]
|
||||||
|
[-p PAIRS [PAIRS ...]] [--pairs-file FILE]
|
||||||
|
[--days INT] [--timerange TIMERANGE]
|
||||||
|
[--dl-trades] [--exchange EXCHANGE]
|
||||||
|
[-t {1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,2w,1M,1y} [{1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,2w,1M,1y} ...]]
|
||||||
|
[--erase]
|
||||||
|
[--data-format-ohlcv {json,jsongz,hdf5}]
|
||||||
|
[--data-format-trades {json,jsongz,hdf5}]
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
||||||
|
Show profits for only these pairs. Pairs are space-
|
||||||
|
separated.
|
||||||
|
--pairs-file FILE File containing a list of pairs to download.
|
||||||
|
--days INT Download data for given number of days.
|
||||||
|
--timerange TIMERANGE
|
||||||
|
Specify what timerange of data to use.
|
||||||
|
--dl-trades Download trades instead of OHLCV data. The bot will
|
||||||
|
resample trades to the desired timeframe as specified
|
||||||
|
as --timeframes/-t.
|
||||||
|
--exchange EXCHANGE Exchange name (default: `bittrex`). Only valid if no
|
||||||
|
config is provided.
|
||||||
|
-t {1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,2w,1M,1y} [{1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,2w,1M,1y} ...], --timeframes {1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,2w,1M,1y} [{1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,2w,1M,1y} ...]
|
||||||
|
Specify which tickers to download. Space-separated
|
||||||
|
list. Default: `1m 5m`.
|
||||||
|
--erase Clean all existing data for the selected
|
||||||
|
exchange/pairs/timeframes.
|
||||||
|
--data-format-ohlcv {json,jsongz,hdf5}
|
||||||
|
Storage format for downloaded candle (OHLCV) data.
|
||||||
|
(default: `json`).
|
||||||
|
--data-format-trades {json,jsongz,hdf5}
|
||||||
|
Storage format for downloaded trades data. (default:
|
||||||
|
`jsongz`).
|
||||||
|
|
||||||
|
Common arguments:
|
||||||
|
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
||||||
|
--logfile FILE Log to the file specified. Special values are:
|
||||||
|
'syslog', 'journald'. See the documentation for more
|
||||||
|
details.
|
||||||
|
-V, --version show program's version number and exit
|
||||||
|
-c PATH, --config PATH
|
||||||
|
Specify configuration file (default:
|
||||||
|
`userdir/config.json` or `config.json` whichever
|
||||||
|
exists). Multiple --config options may be used. Can be
|
||||||
|
set to `-` to read config from stdin.
|
||||||
|
-d PATH, --datadir PATH
|
||||||
|
Path to directory with historical backtesting data.
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Note "Startup period"
|
||||||
|
`download-data` is a strategy-independent command. The idea is to download a big chunk of data once, and then iteratively increase the amount of data stored.
|
||||||
|
|
||||||
|
For that reason, `download-data` does not care about the "startup-period" defined in a strategy. It's up to the user to download additional days if the backtest should start at a specific point in time (while respecting startup period).
|
||||||
|
|
||||||
|
### Data format
|
||||||
|
|
||||||
|
Freqtrade currently supports 3 data-formats for both OHLCV and trades data:
|
||||||
|
|
||||||
|
* `json` (plain "text" json files)
|
||||||
|
* `jsongz` (a gzip-zipped version of json files)
|
||||||
|
* `hdf5` (a high performance datastore)
|
||||||
|
|
||||||
|
By default, OHLCV data is stored as `json` data, while trades data is stored as `jsongz` data.
|
||||||
|
|
||||||
|
This can be changed via the `--data-format-ohlcv` and `--data-format-trades` command line arguments respectively.
|
||||||
|
To persist this change, you can should also add the following snippet to your configuration, so you don't have to insert the above arguments each time:
|
||||||
|
|
||||||
|
``` jsonc
|
||||||
|
// ...
|
||||||
|
"dataformat_ohlcv": "hdf5",
|
||||||
|
"dataformat_trades": "hdf5",
|
||||||
|
// ...
|
||||||
|
```
|
||||||
|
|
||||||
|
If the default data-format has been changed during download, then the keys `dataformat_ohlcv` and `dataformat_trades` in the configuration file need to be adjusted to the selected dataformat as well.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
You can convert between data-formats using the [convert-data](#sub-command-convert-data) and [convert-trade-data](#sub-command-convert-trade-data) methods.
|
||||||
|
|
||||||
|
#### Sub-command convert data
|
||||||
|
|
||||||
|
```
|
||||||
|
usage: freqtrade convert-data [-h] [-v] [--logfile FILE] [-V] [-c PATH]
|
||||||
|
[-d PATH] [--userdir PATH]
|
||||||
|
[-p PAIRS [PAIRS ...]] --format-from
|
||||||
|
{json,jsongz,hdf5} --format-to
|
||||||
|
{json,jsongz,hdf5} [--erase]
|
||||||
|
[-t {1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,2w,1M,1y} [{1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,2w,1M,1y} ...]]
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
||||||
|
Show profits for only these pairs. Pairs are space-
|
||||||
|
separated.
|
||||||
|
--format-from {json,jsongz,hdf5}
|
||||||
|
Source format for data conversion.
|
||||||
|
--format-to {json,jsongz,hdf5}
|
||||||
|
Destination format for data conversion.
|
||||||
|
--erase Clean all existing data for the selected
|
||||||
|
exchange/pairs/timeframes.
|
||||||
|
-t {1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,2w,1M,1y} [{1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,2w,1M,1y} ...], --timeframes {1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,2w,1M,1y} [{1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,2w,1M,1y} ...]
|
||||||
|
Specify which tickers to download. Space-separated
|
||||||
|
list. Default: `1m 5m`.
|
||||||
|
|
||||||
|
Common arguments:
|
||||||
|
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
||||||
|
--logfile FILE Log to the file specified. Special values are:
|
||||||
|
'syslog', 'journald'. See the documentation for more
|
||||||
|
details.
|
||||||
|
-V, --version show program's version number and exit
|
||||||
|
-c PATH, --config PATH
|
||||||
|
Specify configuration file (default:
|
||||||
|
`userdir/config.json` or `config.json` whichever
|
||||||
|
exists). Multiple --config options may be used. Can be
|
||||||
|
set to `-` to read config from stdin.
|
||||||
|
-d PATH, --datadir PATH
|
||||||
|
Path to directory with historical backtesting data.
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Example converting data
|
||||||
|
|
||||||
|
The following command will convert all candle (OHLCV) data available in `~/.freqtrade/data/binance` from json to jsongz, saving diskspace in the process.
|
||||||
|
It'll also remove original json data files (`--erase` parameter).
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
freqtrade convert-data --format-from json --format-to jsongz --datadir ~/.freqtrade/data/binance -t 5m 15m --erase
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Sub-command convert trade data
|
||||||
|
|
||||||
|
```
|
||||||
|
usage: freqtrade convert-trade-data [-h] [-v] [--logfile FILE] [-V] [-c PATH]
|
||||||
|
[-d PATH] [--userdir PATH]
|
||||||
|
[-p PAIRS [PAIRS ...]] --format-from
|
||||||
|
{json,jsongz,hdf5} --format-to
|
||||||
|
{json,jsongz,hdf5} [--erase]
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
||||||
|
Show profits for only these pairs. Pairs are space-
|
||||||
|
separated.
|
||||||
|
--format-from {json,jsongz,hdf5}
|
||||||
|
Source format for data conversion.
|
||||||
|
--format-to {json,jsongz,hdf5}
|
||||||
|
Destination format for data conversion.
|
||||||
|
--erase Clean all existing data for the selected
|
||||||
|
exchange/pairs/timeframes.
|
||||||
|
|
||||||
|
Common arguments:
|
||||||
|
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
||||||
|
--logfile FILE Log to the file specified. Special values are:
|
||||||
|
'syslog', 'journald'. See the documentation for more
|
||||||
|
details.
|
||||||
|
-V, --version show program's version number and exit
|
||||||
|
-c PATH, --config PATH
|
||||||
|
Specify configuration file (default:
|
||||||
|
`userdir/config.json` or `config.json` whichever
|
||||||
|
exists). Multiple --config options may be used. Can be
|
||||||
|
set to `-` to read config from stdin.
|
||||||
|
-d PATH, --datadir PATH
|
||||||
|
Path to directory with historical backtesting data.
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Example converting trades
|
||||||
|
|
||||||
|
The following command will convert all available trade-data in `~/.freqtrade/data/kraken` from jsongz to json.
|
||||||
|
It'll also remove original jsongz data files (`--erase` parameter).
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
freqtrade convert-trade-data --format-from jsongz --format-to json --datadir ~/.freqtrade/data/kraken --erase
|
||||||
|
```
|
||||||
|
|
||||||
|
### Sub-command list-data
|
||||||
|
|
||||||
|
You can get a list of downloaded data using the `list-data` sub-command.
|
||||||
|
|
||||||
|
```
|
||||||
|
usage: freqtrade list-data [-h] [-v] [--logfile FILE] [-V] [-c PATH] [-d PATH]
|
||||||
|
[--userdir PATH] [--exchange EXCHANGE]
|
||||||
|
[--data-format-ohlcv {json,jsongz,hdf5}]
|
||||||
|
[-p PAIRS [PAIRS ...]]
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
--exchange EXCHANGE Exchange name (default: `bittrex`). Only valid if no
|
||||||
|
config is provided.
|
||||||
|
--data-format-ohlcv {json,jsongz,hdf5}
|
||||||
|
Storage format for downloaded candle (OHLCV) data.
|
||||||
|
(default: `json`).
|
||||||
|
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
||||||
|
Show profits for only these pairs. Pairs are space-
|
||||||
|
separated.
|
||||||
|
|
||||||
|
Common arguments:
|
||||||
|
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
||||||
|
--logfile FILE Log to the file specified. Special values are:
|
||||||
|
'syslog', 'journald'. See the documentation for more
|
||||||
|
details.
|
||||||
|
-V, --version show program's version number and exit
|
||||||
|
-c PATH, --config PATH
|
||||||
|
Specify configuration file (default:
|
||||||
|
`userdir/config.json` or `config.json` whichever
|
||||||
|
exists). Multiple --config options may be used. Can be
|
||||||
|
set to `-` to read config from stdin.
|
||||||
|
-d PATH, --datadir PATH
|
||||||
|
Path to directory with historical backtesting data.
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Example list-data
|
||||||
|
|
||||||
|
```bash
|
||||||
|
> freqtrade list-data --userdir ~/.freqtrade/user_data/
|
||||||
|
|
||||||
|
Found 33 pair / timeframe combinations.
|
||||||
|
pairs timeframe
|
||||||
|
---------- -----------------------------------------
|
||||||
|
ADA/BTC 5m, 15m, 30m, 1h, 2h, 4h, 6h, 12h, 1d
|
||||||
|
ADA/ETH 5m, 15m, 30m, 1h, 2h, 4h, 6h, 12h, 1d
|
||||||
|
ETH/BTC 5m, 15m, 30m, 1h, 2h, 4h, 6h, 12h, 1d
|
||||||
|
ETH/USDT 5m, 15m, 30m, 1h, 2h, 4h
|
||||||
|
```
|
||||||
|
|
||||||
### Pairs file
|
### Pairs file
|
||||||
|
|
||||||
@@ -46,20 +287,21 @@ Then run:
|
|||||||
freqtrade download-data --exchange binance
|
freqtrade download-data --exchange binance
|
||||||
```
|
```
|
||||||
|
|
||||||
This will download ticker data for all the currency pairs you defined in `pairs.json`.
|
This will download historical candle (OHLCV) data for all the currency pairs you defined in `pairs.json`.
|
||||||
|
|
||||||
### Other Notes
|
### Other Notes
|
||||||
|
|
||||||
- To use a different directory than the exchange specific default, use `--datadir user_data/data/some_directory`.
|
- To use a different directory than the exchange specific default, use `--datadir user_data/data/some_directory`.
|
||||||
- To change the exchange used to download the tickers, please use a different configuration file (you'll probably need to adjust ratelimits etc.)
|
- To change the exchange used to download the historical data from, please use a different configuration file (you'll probably need to adjust rate limits etc.)
|
||||||
- To use `pairs.json` from some other directory, use `--pairs-file some_other_dir/pairs.json`.
|
- To use `pairs.json` from some other directory, use `--pairs-file some_other_dir/pairs.json`.
|
||||||
- To download ticker data for only 10 days, use `--days 10` (defaults to 30 days).
|
- To download historical candle (OHLCV) data for only 10 days, use `--days 10` (defaults to 30 days).
|
||||||
- Use `--timeframes` to specify which tickers to download. Default is `--timeframes 1m 5m` which will download 1-minute and 5-minute tickers.
|
- To download historical candle (OHLCV) data from a fixed starting point, use `--timerange 20200101-` - which will download all data from January 1st, 2020. Eventually set end dates are ignored.
|
||||||
|
- Use `--timeframes` to specify what timeframe download the historical candle (OHLCV) data for. Default is `--timeframes 1m 5m` which will download 1-minute and 5-minute data.
|
||||||
- To use exchange, timeframe and list of pairs as defined in your configuration file, use the `-c/--config` option. With this, the script uses the whitelist defined in the config as the list of currency pairs to download data for and does not require the pairs.json file. You can combine `-c/--config` with most other options.
|
- To use exchange, timeframe and list of pairs as defined in your configuration file, use the `-c/--config` option. With this, the script uses the whitelist defined in the config as the list of currency pairs to download data for and does not require the pairs.json file. You can combine `-c/--config` with most other options.
|
||||||
|
|
||||||
### Trades (tick) data
|
### Trades (tick) data
|
||||||
|
|
||||||
By default, `download-data` subcommand downloads Candles (OHLCV) data. Some exchanges also provide historic trade-data via their API.
|
By default, `download-data` sub-command downloads Candles (OHLCV) data. Some exchanges also provide historic trade-data via their API.
|
||||||
This data can be useful if you need many different timeframes, since it is only downloaded once, and then resampled locally to the desired timeframes.
|
This data can be useful if you need many different timeframes, since it is only downloaded once, and then resampled locally to the desired timeframes.
|
||||||
|
|
||||||
Since this data is large by default, the files use gzip by default. They are stored in your data-directory with the naming convention of `<pair>-trades.json.gz` (`ETH_BTC-trades.json.gz`). Incremental mode is also supported, as for historic OHLCV data, so downloading the data once per week with `--days 8` will create an incremental data-repository.
|
Since this data is large by default, the files use gzip by default. They are stored in your data-directory with the naming convention of `<pair>-trades.json.gz` (`ETH_BTC-trades.json.gz`). Incremental mode is also supported, as for historic OHLCV data, so downloading the data once per week with `--days 8` will create an incremental data-repository.
|
||||||
@@ -78,10 +320,8 @@ freqtrade download-data --exchange binance --pairs XRP/ETH ETH/BTC --days 20 --d
|
|||||||
!!! Warning
|
!!! Warning
|
||||||
The historic trades are not available during Freqtrade dry-run and live trade modes because all exchanges tested provide this data with a delay of few 100 candles, so it's not suitable for real-time trading.
|
The historic trades are not available during Freqtrade dry-run and live trade modes because all exchanges tested provide this data with a delay of few 100 candles, so it's not suitable for real-time trading.
|
||||||
|
|
||||||
### Historic Kraken data
|
!!! Note "Kraken user"
|
||||||
|
Kraken users should read [this](exchanges.md#historic-kraken-data) before starting to download data.
|
||||||
The Kraken API does only provide 720 historic candles, which is sufficient for FreqTrade dry-run and live trade modes, but is a problem for backtesting.
|
|
||||||
To download data for the Kraken exchange, using `--dl-trades` is mandatory, otherwise the bot will download the same 720 candles over and over, and you'll not have enough backtest data.
|
|
||||||
|
|
||||||
## Next step
|
## Next step
|
||||||
|
|
||||||
|
|||||||
@@ -9,18 +9,27 @@ and are no longer supported. Please avoid their usage in your configuration.
|
|||||||
### the `--refresh-pairs-cached` command line option
|
### the `--refresh-pairs-cached` command line option
|
||||||
|
|
||||||
`--refresh-pairs-cached` in the context of backtesting, hyperopt and edge allows to refresh candle data for backtesting.
|
`--refresh-pairs-cached` in the context of backtesting, hyperopt and edge allows to refresh candle data for backtesting.
|
||||||
Since this leads to much confusion, and slows down backtesting (while not being part of backtesting) this has been singled out
|
Since this leads to much confusion, and slows down backtesting (while not being part of backtesting) this has been singled out as a separate freqtrade sub-command `freqtrade download-data`.
|
||||||
as a seperate freqtrade subcommand `freqtrade download-data`.
|
|
||||||
|
|
||||||
This command line option was deprecated in 2019.7-dev (develop branch) and removed in 2019.9 (master branch).
|
This command line option was deprecated in 2019.7-dev (develop branch) and removed in 2019.9.
|
||||||
|
|
||||||
### The **--dynamic-whitelist** command line option
|
### The **--dynamic-whitelist** command line option
|
||||||
|
|
||||||
This command line option was deprecated in 2018 and removed freqtrade 2019.6-dev (develop branch)
|
This command line option was deprecated in 2018 and removed freqtrade 2019.6-dev (develop branch)
|
||||||
and in freqtrade 2019.7 (master branch).
|
and in freqtrade 2019.7.
|
||||||
|
|
||||||
### the `--live` command line option
|
### the `--live` command line option
|
||||||
|
|
||||||
`--live` in the context of backtesting allowed to download the latest tick data for backtesting.
|
`--live` in the context of backtesting allowed to download the latest tick data for backtesting.
|
||||||
Did only download the latest 500 candles, so was ineffective in getting good backtest data.
|
Did only download the latest 500 candles, so was ineffective in getting good backtest data.
|
||||||
Removed in 2019-7-dev (develop branch) and in freqtrade 2019-8 (master branch)
|
Removed in 2019-7-dev (develop branch) and in freqtrade 2019.8.
|
||||||
|
|
||||||
|
### Allow running multiple pairlists in sequence
|
||||||
|
|
||||||
|
The former `"pairlist"` section in the configuration has been removed, and is replaced by `"pairlists"` - being a list to specify a sequence of pairlists.
|
||||||
|
|
||||||
|
The old section of configuration parameters (`"pairlist"`) has been deprecated in 2019.11 and has been removed in 2020.4.
|
||||||
|
|
||||||
|
### deprecation of bidVolume and askVolume from volume-pairlist
|
||||||
|
|
||||||
|
Since only quoteVolume can be compared between assets, the other options (bidVolume, askVolume) have been deprecated in 2020.4, and have been removed in 2020.9.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Development Help
|
# Development Help
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
All contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas are welcome. We [track issues](https://github.com/freqtrade/freqtrade/issues) on [GitHub](https://github.com) and also have a dev channel in [slack](https://join.slack.com/t/highfrequencybot/shared_invite/enQtNjU5ODcwNjI1MDU3LTU1MTgxMjkzNmYxNWE1MDEzYzQ3YmU4N2MwZjUyNjJjODRkMDVkNjg4YTAyZGYzYzlhOTZiMTE4ZjQ4YzM0OGE) where you can ask questions.
|
All contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas are welcome. We [track issues](https://github.com/freqtrade/freqtrade/issues) on [GitHub](https://github.com) and also have a dev channel in [slack](https://join.slack.com/t/highfrequencybot/shared_invite/enQtNjU5ODcwNjI1MDU3LTU1MTgxMjkzNmYxNWE1MDEzYzQ3YmU4N2MwZjUyNjJjODRkMDVkNjg4YTAyZGYzYzlhOTZiMTE4ZjQ4YzM0OGE) where you can ask questions.
|
||||||
|
|
||||||
@@ -10,13 +10,35 @@ Documentation is available at [https://freqtrade.io](https://www.freqtrade.io/)
|
|||||||
|
|
||||||
Special fields for the documentation (like Note boxes, ...) can be found [here](https://squidfunk.github.io/mkdocs-material/extensions/admonition/).
|
Special fields for the documentation (like Note boxes, ...) can be found [here](https://squidfunk.github.io/mkdocs-material/extensions/admonition/).
|
||||||
|
|
||||||
|
To test the documentation locally use the following commands.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
pip install -r docs/requirements-docs.txt
|
||||||
|
mkdocs serve
|
||||||
|
```
|
||||||
|
|
||||||
|
This will spin up a local server (usually on port 8000) so you can see if everything looks as you'd like it to.
|
||||||
|
|
||||||
## Developer setup
|
## Developer setup
|
||||||
|
|
||||||
To configure a development environment, best use the `setup.sh` script and answer "y" when asked "Do you want to install dependencies for dev [y/N]? ".
|
To configure a development environment, you can either use the provided [DevContainer](#devcontainer-setup), or use the `setup.sh` script and answer "y" when asked "Do you want to install dependencies for dev [y/N]? ".
|
||||||
Alternatively (if your system is not supported by the setup.sh script), follow the manual installation process and run `pip3 install -e .[all]`.
|
Alternatively (e.g. if your system is not supported by the setup.sh script), follow the manual installation process and run `pip3 install -e .[all]`.
|
||||||
|
|
||||||
This will install all required tools for development, including `pytest`, `flake8`, `mypy`, and `coveralls`.
|
This will install all required tools for development, including `pytest`, `flake8`, `mypy`, and `coveralls`.
|
||||||
|
|
||||||
|
### Devcontainer setup
|
||||||
|
|
||||||
|
The fastest and easiest way to get started is to use [VSCode](https://code.visualstudio.com/) with the Remote container extension.
|
||||||
|
This gives developers the ability to start the bot with all required dependencies *without* needing to install any freqtrade specific dependencies on your local machine.
|
||||||
|
|
||||||
|
#### Devcontainer dependencies
|
||||||
|
|
||||||
|
* [VSCode](https://code.visualstudio.com/)
|
||||||
|
* [docker](https://docs.docker.com/install/)
|
||||||
|
* [Remote container extension documentation](https://code.visualstudio.com/docs/remote)
|
||||||
|
|
||||||
|
For more information about the [Remote container extension](https://code.visualstudio.com/docs/remote), best consult the documentation.
|
||||||
|
|
||||||
### Tests
|
### Tests
|
||||||
|
|
||||||
New code should be covered by basic unittests. Depending on the complexity of the feature, Reviewers may request more in-depth unittests.
|
New code should be covered by basic unittests. Depending on the complexity of the feature, Reviewers may request more in-depth unittests.
|
||||||
@@ -41,44 +63,36 @@ def test_method_to_test(caplog):
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Local docker usage
|
## ErrorHandling
|
||||||
|
|
||||||
The fastest and easiest way to start up is to use docker-compose.develop which gives developers the ability to start the bot up with all the required dependencies, *without* needing to install any freqtrade specific dependencies on your local machine.
|
Freqtrade Exceptions all inherit from `FreqtradeException`.
|
||||||
|
This general class of error should however not be used directly. Instead, multiple specialized sub-Exceptions exist.
|
||||||
|
|
||||||
#### Install
|
Below is an outline of exception inheritance hierarchy:
|
||||||
* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
|
|
||||||
* [docker](https://docs.docker.com/install/)
|
|
||||||
* [docker-compose](https://docs.docker.com/compose/install/)
|
|
||||||
|
|
||||||
#### Starting the bot
|
|
||||||
##### Use the develop dockerfile
|
|
||||||
``` bash
|
|
||||||
rm docker-compose.yml && mv docker-compose.develop.yml docker-compose.yml
|
|
||||||
```
|
```
|
||||||
#### Docker Compose
|
+ FreqtradeException
|
||||||
|
|
|
||||||
##### Starting
|
+---+ OperationalException
|
||||||
|
|
|
||||||
``` bash
|
+---+ DependencyException
|
||||||
docker-compose up
|
| |
|
||||||
|
| +---+ PricingError
|
||||||
|
| |
|
||||||
|
| +---+ ExchangeError
|
||||||
|
| |
|
||||||
|
| +---+ TemporaryError
|
||||||
|
| |
|
||||||
|
| +---+ DDosProtection
|
||||||
|
| |
|
||||||
|
| +---+ InvalidOrderException
|
||||||
|
| |
|
||||||
|
| +---+ RetryableOrderError
|
||||||
|
| |
|
||||||
|
| +---+ InsufficientFundsError
|
||||||
|
|
|
||||||
|
+---+ StrategyError
|
||||||
```
|
```
|
||||||

|
|
||||||
|
|
||||||
##### Rebuilding
|
|
||||||
``` bash
|
|
||||||
docker-compose build
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Execing (effectively SSH into the container)
|
|
||||||
|
|
||||||
The `exec` command requires that the container already be running, if you want to start it
|
|
||||||
that can be effected by `docker-compose up` or `docker-compose run freqtrade_develop`
|
|
||||||
|
|
||||||
``` bash
|
|
||||||
docker-compose exec freqtrade_develop /bin/bash
|
|
||||||
```
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
## Modules
|
## Modules
|
||||||
|
|
||||||
@@ -87,67 +101,79 @@ docker-compose exec freqtrade_develop /bin/bash
|
|||||||
You have a great idea for a new pair selection algorithm you would like to try out? Great.
|
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.
|
Hopefully you also want to contribute this back upstream.
|
||||||
|
|
||||||
Whatever your motivations are - This should get you off the ground in trying to develop a new Pairlist provider.
|
Whatever your motivations are - This should get you off the ground in trying to develop a new Pairlist Handler.
|
||||||
|
|
||||||
First of all, have a look at the [VolumePairList](https://github.com/freqtrade/freqtrade/blob/develop/freqtrade/pairlist/VolumePairList.py) provider, and best copy this file with a name of your new Pairlist Provider.
|
First of all, have a look at the [VolumePairList](https://github.com/freqtrade/freqtrade/blob/develop/freqtrade/pairlist/VolumePairList.py) Handler, and best copy this file with a name of your new Pairlist Handler.
|
||||||
|
|
||||||
This is a simple provider, which however serves as a good example on how to start developing.
|
This is a simple Handler, which however serves as a good example on how to start developing.
|
||||||
|
|
||||||
Next, modify the classname of the provider (ideally align this with the Filename).
|
Next, modify the class-name of the Handler (ideally align this with the module filename).
|
||||||
|
|
||||||
The base-class provides the an instance of the bot (`self._freqtrade`), as well as the configuration (`self._config`), and initiates both `_blacklist` and `_whitelist`.
|
The base-class provides an instance of the exchange (`self._exchange`) the pairlist manager (`self._pairlistmanager`), as well as the main configuration (`self._config`), the pairlist dedicated configuration (`self._pairlistconfig`) and the absolute position within the list of pairlists.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
self._freqtrade = freqtrade
|
self._exchange = exchange
|
||||||
|
self._pairlistmanager = pairlistmanager
|
||||||
self._config = config
|
self._config = config
|
||||||
self._whitelist = self._config['exchange']['pair_whitelist']
|
self._pairlistconfig = pairlistconfig
|
||||||
self._blacklist = self._config['exchange'].get('pair_blacklist', [])
|
self._pairlist_pos = pairlist_pos
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
Now, let's step through the methods which require actions:
|
Now, let's step through the methods which require actions:
|
||||||
|
|
||||||
#### configuration
|
#### Pairlist configuration
|
||||||
|
|
||||||
Configuration for PairListProvider is done in the bot configuration file in the element `"pairlist"`.
|
Configuration for the chain of Pairlist Handlers is done in the bot configuration file in the element `"pairlists"`, an array of configuration parameters for each Pairlist Handlers in the chain.
|
||||||
This Pairlist-object may contain a `"config"` dict with additional configurations for the configured pairlist.
|
|
||||||
By convention, `"number_assets"` is used to specify the maximum number of pairs to keep in the whitelist. Please follow this to ensure a consistent user experience.
|
|
||||||
|
|
||||||
Additional elements can be configured as needed. `VolumePairList` uses `"sort_key"` to specify the sorting value - however feel free to specify whatever is necessary for your great algorithm to be successfull and dynamic.
|
By convention, `"number_assets"` is used to specify the maximum number of pairs to keep in the pairlist. Please follow this to ensure a consistent user experience.
|
||||||
|
|
||||||
|
Additional parameters can be configured as needed. For instance, `VolumePairList` uses `"sort_key"` to specify the sorting value - however feel free to specify whatever is necessary for your great algorithm to be successful and dynamic.
|
||||||
|
|
||||||
#### short_desc
|
#### short_desc
|
||||||
|
|
||||||
Returns a description used for Telegram messages.
|
Returns a description used for Telegram messages.
|
||||||
This should contain the name of the Provider, as well as a short description containing the number of assets. Please follow the format `"PairlistName - top/bottom X pairs"`.
|
|
||||||
|
|
||||||
#### refresh_pairlist
|
This should contain the name of the Pairlist Handler, as well as a short description containing the number of assets. Please follow the format `"PairlistName - top/bottom X pairs"`.
|
||||||
|
|
||||||
|
#### gen_pairlist
|
||||||
|
|
||||||
|
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 `StaticPairList` and `VolumePairList`.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
It must return the resulting pairlist (which may then be passed into the chain of Pairlist Handlers).
|
||||||
|
|
||||||
|
Validations are optional, the parent class exposes a `_verify_blacklist(pairlist)` and `_whitelist_for_active_markets(pairlist)` 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.
|
||||||
|
|
||||||
|
#### filter_pairlist
|
||||||
|
|
||||||
|
This method is called for each Pairlist Handler in the chain by the pairlist manager.
|
||||||
|
|
||||||
Override this method and run all calculations needed in this method.
|
|
||||||
This is called with each iteration of the bot - so consider implementing caching for compute/network heavy calculations.
|
This is called with each iteration of the bot - so consider implementing caching for compute/network heavy calculations.
|
||||||
|
|
||||||
Assign the resulting whiteslist to `self._whitelist` and `self._blacklist` respectively. These will then be used to run the bot in this iteration. Pairs with open trades will be added to the whitelist to have the sell-methods run correctly.
|
It gets passed a pairlist (which can be the result of previous pairlists) as well as `tickers`, a pre-fetched version of `get_tickers()`.
|
||||||
|
|
||||||
Please also run `self._validate_whitelist(pairs)` and to check and remove pairs with inactive markets. This function is available in the Parent class (`StaticPairList`) and should ideally not be overwritten.
|
The default implementation in the base class simply calls the `_validate_pair()` method for each pair in the pairlist, but you may override it. So you should either implement the `_validate_pair()` in your Pairlist Handler or override `filter_pairlist()` to do something else.
|
||||||
|
|
||||||
|
If overridden, it must return the resulting pairlist (which may then be passed into the next Pairlist Handler in the chain).
|
||||||
|
|
||||||
|
Validations are optional, the parent class exposes a `_verify_blacklist(pairlist)` and `_whitelist_for_active_markets(pairlist)` 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.
|
||||||
|
|
||||||
|
In `VolumePairList`, this implements different methods of sorting, does early validation so only the expected number of pairs is returned.
|
||||||
|
|
||||||
##### sample
|
##### sample
|
||||||
|
|
||||||
``` python
|
``` python
|
||||||
def refresh_pairlist(self) -> None:
|
def filter_pairlist(self, pairlist: List[str], tickers: Dict) -> List[str]:
|
||||||
# Generate dynamic whitelist
|
# Generate dynamic whitelist
|
||||||
pairs = self._gen_pair_whitelist(self._config['stake_currency'], self._sort_key)
|
pairs = self._calculate_pairlist(pairlist, tickers)
|
||||||
# Validate whitelist to only have active market pairs
|
return pairs
|
||||||
self._whitelist = self._validate_whitelist(pairs)[:self._number_pairs]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### _gen_pair_whitelist
|
|
||||||
|
|
||||||
This is a simple method used by `VolumePairList` - however serves as a good example.
|
|
||||||
It implements caching (`@cached(TTLCache(maxsize=1, ttl=1800))`) as well as a configuration option to allow different (but similar) strategies to work with the same PairListProvider.
|
|
||||||
|
|
||||||
## Implement a new Exchange (WIP)
|
## Implement a new Exchange (WIP)
|
||||||
|
|
||||||
!!! Note
|
!!! Note
|
||||||
This section is a Work in Progress and is not a complete guide on how to test a new exchange with FreqTrade.
|
This section is a Work in Progress and is not a complete guide on how to test a new exchange with Freqtrade.
|
||||||
|
|
||||||
Most exchanges supported by CCXT should work out of the box.
|
Most exchanges supported by CCXT should work out of the box.
|
||||||
|
|
||||||
@@ -155,11 +181,11 @@ Most exchanges supported by CCXT should work out of the box.
|
|||||||
|
|
||||||
Check if the new exchange supports Stoploss on Exchange orders through their API.
|
Check if the new exchange supports Stoploss on Exchange orders through their API.
|
||||||
|
|
||||||
Since CCXT does not provide unification for Stoploss On Exchange yet, we'll need to implement the exchange-specific parameters ourselfs. Best look at `binance.py` 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. [CCXT Issues](https://github.com/ccxt/ccxt/issues) may also provide great help, since others may have implemented something similar for their projects.
|
Since CCXT does not provide unification for Stoploss On Exchange yet, we'll need to implement the exchange-specific parameters ourselves. Best look at `binance.py` 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. [CCXT Issues](https://github.com/ccxt/ccxt/issues) may also provide great help, since others may have implemented something similar for their projects.
|
||||||
|
|
||||||
### Incomplete candles
|
### Incomplete candles
|
||||||
|
|
||||||
While fetching OHLCV data, we're may end up getting incomplete candles (Depending on the exchange).
|
While fetching candle (OHLCV) data, we may end up getting incomplete candles (depending on the exchange).
|
||||||
To demonstrate this, we'll use daily candles (`"1d"`) to keep things simple.
|
To demonstrate this, we'll use daily candles (`"1d"`) to keep things simple.
|
||||||
We query the api (`ct.fetch_ohlcv()`) 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.
|
We query the api (`ct.fetch_ohlcv()`) 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.
|
||||||
|
|
||||||
@@ -168,74 +194,121 @@ To check how the new exchange behaves, you can use the following snippet:
|
|||||||
``` python
|
``` python
|
||||||
import ccxt
|
import ccxt
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from freqtrade.data.converter import parse_ticker_dataframe
|
from freqtrade.data.converter import ohlcv_to_dataframe
|
||||||
ct = ccxt.binance()
|
ct = ccxt.binance()
|
||||||
timeframe = "1d"
|
timeframe = "1d"
|
||||||
pair = "XLM/BTC" # Make sure to use a pair that exists on that exchange!
|
pair = "XLM/BTC" # Make sure to use a pair that exists on that exchange!
|
||||||
raw = ct.fetch_ohlcv(pair, timeframe=timeframe)
|
raw = ct.fetch_ohlcv(pair, timeframe=timeframe)
|
||||||
|
|
||||||
# convert to dataframe
|
# convert to dataframe
|
||||||
df1 = parse_ticker_dataframe(raw, timeframe, pair=pair, drop_incomplete=False)
|
df1 = ohlcv_to_dataframe(raw, timeframe, pair=pair, drop_incomplete=False)
|
||||||
|
|
||||||
print(df1["date"].tail(1))
|
print(df1.tail(1))
|
||||||
print(datetime.utcnow())
|
print(datetime.utcnow())
|
||||||
```
|
```
|
||||||
|
|
||||||
``` output
|
``` output
|
||||||
19 2019-06-08 00:00:00+00:00
|
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
|
2019-06-09 12:30:27.873327
|
||||||
```
|
```
|
||||||
|
|
||||||
The output will show the last entry from the Exchange as well as the current UTC date.
|
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 `"ohlcv_partial_candle"` from the exchange-class untouched / True). Otherwise, set `"ohlcv_partial_candle"` to `False` to not drop Candles (shown in the example above).
|
If the day shows the same day, then the last candle can be assumed as incomplete and should be dropped (leave the setting `"ohlcv_partial_candle"` from the exchange-class untouched / True). Otherwise, set `"ohlcv_partial_candle"` to `False` 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).
|
||||||
|
|
||||||
## Updating example notebooks
|
## Updating example notebooks
|
||||||
|
|
||||||
To keep the jupyter notebooks aligned with the documentation, the following should be ran after updating a example notebook.
|
To keep the jupyter notebooks aligned with the documentation, the following should be ran after updating a example notebook.
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace user_data/notebooks/strategy_analysis_example.ipynb
|
jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace freqtrade/templates/strategy_analysis_example.ipynb
|
||||||
jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to markdown user_data/notebooks/strategy_analysis_example.ipynb --stdout > docs/strategy_analysis_example.md
|
jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to markdown freqtrade/templates/strategy_analysis_example.ipynb --stdout > docs/strategy_analysis_example.md
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Continuous integration
|
||||||
|
|
||||||
|
This documents some decisions taken for the CI Pipeline.
|
||||||
|
|
||||||
|
* CI runs on all OS variants, Linux (ubuntu), macOS and Windows.
|
||||||
|
* Docker images are build for the branches `stable` and `develop`.
|
||||||
|
* Docker images containing Plot dependencies are also available as `stable_plot` and `develop_plot`.
|
||||||
|
* Raspberry PI Docker images are postfixed with `_pi` - so tags will be `:stable_pi` and `develop_pi`.
|
||||||
|
* Docker images contain a file, `/freqtrade/freqtrade_commit` containing the commit this image is based of.
|
||||||
|
* Full docker image rebuilds are run once a week via schedule.
|
||||||
|
* Deployments run on ubuntu.
|
||||||
|
* ta-lib binaries are contained in the build_helpers directory to avoid fails related to external unavailability.
|
||||||
|
* All tests must pass for a PR to be merged to `stable` or `develop`.
|
||||||
|
|
||||||
## Creating a release
|
## Creating a release
|
||||||
|
|
||||||
This part of the documentation is aimed at maintainers, and shows how to create a release.
|
This part of the documentation is aimed at maintainers, and shows how to create a release.
|
||||||
|
|
||||||
### Create release branch
|
### Create release branch
|
||||||
|
|
||||||
``` bash
|
First, pick a commit that's about one week old (to not include latest additions to releases).
|
||||||
# make sure you're in develop branch
|
|
||||||
git checkout develop
|
|
||||||
|
|
||||||
|
``` bash
|
||||||
# create new branch
|
# create new branch
|
||||||
git checkout -b new_release
|
git checkout -b new_release <commitid>
|
||||||
```
|
```
|
||||||
|
|
||||||
* Edit `freqtrade/__init__.py` and add the version matching the current date (for example `2019.7` for July 2019). Minor versions can be `2019.7-1` should we need to do a second release that month.
|
Determine if crucial bugfixes have been made between this commit and the current state, and eventually cherry-pick these.
|
||||||
|
|
||||||
|
* Merge the release branch (stable) into this branch.
|
||||||
|
* Edit `freqtrade/__init__.py` and add the version matching the current date (for example `2019.7` for July 2019). Minor versions can be `2019.7.1` should we need to do a second release that month. Version numbers must follow allowed versions from PEP0440 to avoid failures pushing to pypi.
|
||||||
* Commit this part
|
* Commit this part
|
||||||
* push that branch to the remote and create a PR against the master branch
|
* push that branch to the remote and create a PR against the stable branch
|
||||||
|
|
||||||
### Create changelog from git commits
|
### Create changelog from git commits
|
||||||
|
|
||||||
!!! Note
|
!!! Note
|
||||||
Make sure that both master and develop are up-todate!.
|
Make sure that the `stable` branch is up-to-date!
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
# Needs to be done before merging / pulling that branch.
|
# Needs to be done before merging / pulling that branch.
|
||||||
git log --oneline --no-decorate --no-merges master..develop
|
git log --oneline --no-decorate --no-merges stable..new_release
|
||||||
|
```
|
||||||
|
|
||||||
|
To keep the release-log short, best wrap the full git changelog into a collapsible details section.
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
<details>
|
||||||
|
<summary>Expand full changelog</summary>
|
||||||
|
|
||||||
|
... Full git changelog
|
||||||
|
|
||||||
|
</details>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Create github release / tag
|
### Create github release / tag
|
||||||
|
|
||||||
Once the PR against master is merged (best right after merging):
|
Once the PR against stable is merged (best right after merging):
|
||||||
|
|
||||||
* Use the button "Draft a new release" in the Github UI (subsection releases)
|
* Use the button "Draft a new release" in the Github UI (subsection releases).
|
||||||
* Use the version-number specified as tag.
|
* Use the version-number specified as tag.
|
||||||
* Use "master" as reference (this step comes after the above PR is merged).
|
* Use "stable" as reference (this step comes after the above PR is merged).
|
||||||
* Use the above changelog as release comment (as codeblock)
|
* Use the above changelog as release comment (as codeblock)
|
||||||
|
|
||||||
### After-release
|
## Releases
|
||||||
|
|
||||||
* Update version in develop by postfixing that with `-dev` (`2019.6 -> 2019.6-dev`).
|
### pypi
|
||||||
* Create a PR against develop to update that branch.
|
|
||||||
|
!!! Note
|
||||||
|
This process is now automated as part of Github Actions.
|
||||||
|
|
||||||
|
To create a pypi release, please run the following commands:
|
||||||
|
|
||||||
|
Additional requirement: `wheel`, `twine` (for uploading), account on pypi with proper permissions.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
python setup.py sdist bdist_wheel
|
||||||
|
|
||||||
|
# For pypi test (to check if some change to the installation did work)
|
||||||
|
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
|
||||||
|
|
||||||
|
# For production:
|
||||||
|
twine upload dist/*
|
||||||
|
```
|
||||||
|
|
||||||
|
Please don't push non-releases to the productive / real pypi instance.
|
||||||
|
|||||||
105
docs/docker.md
105
docs/docker.md
@@ -1,33 +1,26 @@
|
|||||||
# Using FreqTrade with Docker
|
## Freqtrade with docker without docker-compose
|
||||||
|
|
||||||
## Install Docker
|
!!! Warning
|
||||||
|
The below documentation is provided for completeness and assumes that you are familiar with running docker containers. If you're just starting out with Docker, we recommend to follow the [Quickstart](docker.md) instructions.
|
||||||
|
|
||||||
Start by downloading and installing Docker CE for your platform:
|
### Download the official Freqtrade docker image
|
||||||
|
|
||||||
* [Mac](https://docs.docker.com/docker-for-mac/install/)
|
|
||||||
* [Windows](https://docs.docker.com/docker-for-windows/install/)
|
|
||||||
* [Linux](https://docs.docker.com/install/)
|
|
||||||
|
|
||||||
Once you have Docker installed, simply prepare the config file (e.g. `config.json`) and run the image for `freqtrade` as explained below.
|
|
||||||
|
|
||||||
## Download the official FreqTrade docker image
|
|
||||||
|
|
||||||
Pull the image from docker hub.
|
Pull the image from docker hub.
|
||||||
|
|
||||||
Branches / tags available can be checked out on [Dockerhub](https://hub.docker.com/r/freqtradeorg/freqtrade/tags/).
|
Branches / tags available can be checked out on [Dockerhub tags page](https://hub.docker.com/r/freqtradeorg/freqtrade/tags/).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker pull freqtradeorg/freqtrade:develop
|
docker pull freqtradeorg/freqtrade:stable
|
||||||
# Optionally tag the repository so the run-commands remain shorter
|
# Optionally tag the repository so the run-commands remain shorter
|
||||||
docker tag freqtradeorg/freqtrade:develop freqtrade
|
docker tag freqtradeorg/freqtrade:stable freqtrade
|
||||||
```
|
```
|
||||||
|
|
||||||
To update the image, simply run the above commands again and restart your running container.
|
To update the image, simply run the above commands again and restart your running container.
|
||||||
|
|
||||||
Should you require additional libraries, please [build the image yourself](#build-your-own-docker-image).
|
Should you require additional libraries, please [build the image yourself](#build-your-own-docker-image).
|
||||||
|
|
||||||
!!! Note Docker image update frequency
|
!!! Note "Docker image update frequency"
|
||||||
The official docker images with tags `master`, `develop` and `latest` are automatically rebuild once a week to keep the base image uptodate.
|
The official docker images with tags `stable`, `develop` and `latest` are automatically rebuild once a week to keep the base image up-to-date.
|
||||||
In addition to that, every merge to `develop` will trigger a rebuild for `develop` and `latest`.
|
In addition to that, every merge to `develop` will trigger a rebuild for `develop` and `latest`.
|
||||||
|
|
||||||
### Prepare the configuration files
|
### Prepare the configuration files
|
||||||
@@ -59,39 +52,38 @@ cp -n config.json.example config.json
|
|||||||
|
|
||||||
#### Create your database file
|
#### Create your database file
|
||||||
|
|
||||||
Production
|
=== "Dry-Run"
|
||||||
|
``` bash
|
||||||
|
touch tradesv3.dryrun.sqlite
|
||||||
|
```
|
||||||
|
|
||||||
```bash
|
=== "Production"
|
||||||
touch tradesv3.sqlite
|
``` bash
|
||||||
````
|
touch tradesv3.sqlite
|
||||||
|
```
|
||||||
|
|
||||||
Dry-Run
|
|
||||||
|
|
||||||
```bash
|
!!! Warning "Database File Path"
|
||||||
touch tradesv3.dryrun.sqlite
|
Make sure to use the path to the correct database file when starting the bot in Docker.
|
||||||
```
|
|
||||||
|
|
||||||
!!! Note
|
|
||||||
Make sure to use the path to this file when starting the bot in docker.
|
|
||||||
|
|
||||||
### Build your own Docker image
|
### Build your own Docker image
|
||||||
|
|
||||||
Best start by pulling the official docker image from dockerhub as explained [here](#download-the-official-docker-image) to speed up building.
|
Best start by pulling the official docker image from dockerhub as explained [here](#download-the-official-docker-image) to speed up building.
|
||||||
|
|
||||||
To add additional libraries to your docker image, best check out [Dockerfile.technical](https://github.com/freqtrade/freqtrade/blob/develop/Dockerfile.technical) which adds the [technical](https://github.com/freqtrade/technical) module to the image.
|
To add additional libraries to your docker image, best check out [Dockerfile.technical](https://github.com/freqtrade/freqtrade/blob/develop/docker/Dockerfile.technical) which adds the [technical](https://github.com/freqtrade/technical) module to the image.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker build -t freqtrade -f Dockerfile.technical .
|
docker build -t freqtrade -f docker/Dockerfile.technical .
|
||||||
```
|
```
|
||||||
|
|
||||||
If you are developing using Docker, use `Dockerfile.develop` to build a dev Docker image, which will also set up develop dependencies:
|
If you are developing using Docker, use `docker/Dockerfile.develop` to build a dev Docker image, which will also set up develop dependencies:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker build -f Dockerfile.develop -t freqtrade-dev .
|
docker build -f docker/Dockerfile.develop -t freqtrade-dev .
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! Note
|
!!! Warning "Include your config file manually"
|
||||||
For security reasons, your configuration file will not be included in the image, you will need to bind mount it. It is also advised to bind mount an SQLite database file (see the "5. Run a restartable docker image" section) to keep it between updates.
|
For security reasons, your configuration file will not be included in the image, you will need to bind mount it. It is also advised to bind mount an SQLite database file (see [5. Run a restartable docker image](#run-a-restartable-docker-image)") to keep it between updates.
|
||||||
|
|
||||||
#### Verify the Docker image
|
#### Verify the Docker image
|
||||||
|
|
||||||
@@ -112,37 +104,36 @@ docker run --rm -v `pwd`/config.json:/freqtrade/config.json -it freqtrade
|
|||||||
```
|
```
|
||||||
|
|
||||||
!!! Warning
|
!!! Warning
|
||||||
In this example, the database will be created inside the docker instance and will be lost when you will refresh your image.
|
In this example, the database will be created inside the docker instance and will be lost when you refresh your image.
|
||||||
|
|
||||||
#### Adjust timezone
|
#### Adjust timezone
|
||||||
|
|
||||||
By default, the container will use UTC timezone.
|
By default, the container will use UTC timezone.
|
||||||
Should you find this irritating please add the following to your docker commands:
|
If you would like to change the timezone use the following commands:
|
||||||
|
|
||||||
##### Linux
|
=== "Linux"
|
||||||
|
``` bash
|
||||||
|
-v /etc/timezone:/etc/timezone:ro
|
||||||
|
|
||||||
``` bash
|
# Complete command:
|
||||||
-v /etc/timezone:/etc/timezone:ro
|
docker run --rm -v /etc/timezone:/etc/timezone:ro -v `pwd`/config.json:/freqtrade/config.json -it freqtrade
|
||||||
|
```
|
||||||
|
|
||||||
# Complete command:
|
=== "MacOS"
|
||||||
docker run --rm -v /etc/timezone:/etc/timezone:ro -v `pwd`/config.json:/freqtrade/config.json -it freqtrade
|
```bash
|
||||||
```
|
docker run --rm -e TZ=`ls -la /etc/localtime | cut -d/ -f8-9` -v `pwd`/config.json:/freqtrade/config.json -it freqtrade
|
||||||
|
```
|
||||||
|
|
||||||
##### MacOS
|
!!! Note "MacOS Issues"
|
||||||
|
The OSX Docker versions after 17.09.1 have a known issue whereby `/etc/localtime` cannot be shared causing Docker to not start.<br>
|
||||||
There is known issue in OSX Docker versions after 17.09.1, whereby `/etc/localtime` cannot be shared causing Docker to not start. A work-around for this is to start with the following cmd.
|
A work-around for this is to start with the MacOS command above
|
||||||
|
More information on this docker issue and work-around can be read [here](https://github.com/docker/for-mac/issues/2396).
|
||||||
```bash
|
|
||||||
docker run --rm -e TZ=`ls -la /etc/localtime | cut -d/ -f8-9` -v `pwd`/config.json:/freqtrade/config.json -it freqtrade
|
|
||||||
```
|
|
||||||
|
|
||||||
More information on this docker issue and work-around can be read [here](https://github.com/docker/for-mac/issues/2396).
|
|
||||||
|
|
||||||
### Run a restartable docker image
|
### Run a restartable docker image
|
||||||
|
|
||||||
To run a restartable instance in the background (feel free to place your configuration and database files wherever it feels comfortable on your filesystem).
|
To run a restartable instance in the background (feel free to place your configuration and database files wherever it feels comfortable on your filesystem).
|
||||||
|
|
||||||
#### Move your config file and database
|
#### 1. Move your config file and database
|
||||||
|
|
||||||
The following will assume that you place your configuration / database files to `~/.freqtrade`, which is a hidden directory in your home directory. Feel free to use a different directory and replace the directory in the upcomming commands.
|
The following will assume that you place your configuration / database files to `~/.freqtrade`, which is a hidden directory in your home directory. Feel free to use a different directory and replace the directory in the upcomming commands.
|
||||||
|
|
||||||
@@ -152,7 +143,7 @@ mv config.json ~/.freqtrade
|
|||||||
mv tradesv3.sqlite ~/.freqtrade
|
mv tradesv3.sqlite ~/.freqtrade
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Run the docker image
|
#### 2. Run the docker image
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run -d \
|
docker run -d \
|
||||||
@@ -160,16 +151,18 @@ docker run -d \
|
|||||||
-v ~/.freqtrade/config.json:/freqtrade/config.json \
|
-v ~/.freqtrade/config.json:/freqtrade/config.json \
|
||||||
-v ~/.freqtrade/user_data/:/freqtrade/user_data \
|
-v ~/.freqtrade/user_data/:/freqtrade/user_data \
|
||||||
-v ~/.freqtrade/tradesv3.sqlite:/freqtrade/tradesv3.sqlite \
|
-v ~/.freqtrade/tradesv3.sqlite:/freqtrade/tradesv3.sqlite \
|
||||||
freqtrade --db-url sqlite:///tradesv3.sqlite --strategy MyAwesomeStrategy
|
freqtrade trade --db-url sqlite:///tradesv3.sqlite --strategy MyAwesomeStrategy
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! Note
|
!!! Note
|
||||||
db-url defaults to `sqlite:///tradesv3.sqlite` but it defaults to `sqlite://` if `dry_run=True` is being used.
|
When using docker, it's best to specify `--db-url` explicitly to ensure that the database URL and the mounted database file match.
|
||||||
To override this behaviour use a custom db-url value: i.e.: `--db-url sqlite:///tradesv3.dryrun.sqlite`
|
|
||||||
|
|
||||||
!!! Note
|
!!! Note
|
||||||
All available bot command line parameters can be added to the end of the `docker run` command.
|
All available bot command line parameters can be added to the end of the `docker run` command.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
You can define a [restart policy](https://docs.docker.com/config/containers/start-containers-automatically/) in docker. It can be useful in some cases to use the `--restart unless-stopped` flag (crash of freqtrade or reboot of your system).
|
||||||
|
|
||||||
### Monitor your Docker instance
|
### Monitor your Docker instance
|
||||||
|
|
||||||
You can use the following commands to monitor and manage your container:
|
You can use the following commands to monitor and manage your container:
|
||||||
@@ -199,7 +192,7 @@ docker run -d \
|
|||||||
-v ~/.freqtrade/config.json:/freqtrade/config.json \
|
-v ~/.freqtrade/config.json:/freqtrade/config.json \
|
||||||
-v ~/.freqtrade/tradesv3.sqlite:/freqtrade/tradesv3.sqlite \
|
-v ~/.freqtrade/tradesv3.sqlite:/freqtrade/tradesv3.sqlite \
|
||||||
-v ~/.freqtrade/user_data/:/freqtrade/user_data/ \
|
-v ~/.freqtrade/user_data/:/freqtrade/user_data/ \
|
||||||
freqtrade --strategy AwsomelyProfitableStrategy backtesting
|
freqtrade backtesting --strategy AwsomelyProfitableStrategy
|
||||||
```
|
```
|
||||||
|
|
||||||
Head over to the [Backtesting Documentation](backtesting.md) for more details.
|
Head over to the [Backtesting Documentation](backtesting.md) for more details.
|
||||||
|
|||||||
191
docs/docker_quickstart.md
Normal file
191
docs/docker_quickstart.md
Normal file
@@ -0,0 +1,191 @@
|
|||||||
|
# Using Freqtrade with Docker
|
||||||
|
|
||||||
|
## Install Docker
|
||||||
|
|
||||||
|
Start by downloading and installing Docker CE for your platform:
|
||||||
|
|
||||||
|
* [Mac](https://docs.docker.com/docker-for-mac/install/)
|
||||||
|
* [Windows](https://docs.docker.com/docker-for-windows/install/)
|
||||||
|
* [Linux](https://docs.docker.com/install/)
|
||||||
|
|
||||||
|
Optionally, [`docker-compose`](https://docs.docker.com/compose/install/) should be installed and available to follow the [docker quick start guide](#docker-quick-start).
|
||||||
|
|
||||||
|
Once you have Docker installed, simply prepare the config file (e.g. `config.json`) and run the image for `freqtrade` as explained below.
|
||||||
|
|
||||||
|
## Freqtrade with docker-compose
|
||||||
|
|
||||||
|
Freqtrade provides an official Docker image on [Dockerhub](https://hub.docker.com/r/freqtradeorg/freqtrade/), as well as a [docker-compose file](https://github.com/freqtrade/freqtrade/blob/develop/docker-compose.yml) ready for usage.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
- The following section assumes that `docker` and `docker-compose` are installed and available to the logged in user.
|
||||||
|
- All below commands use relative directories and will have to be executed from the directory containing the `docker-compose.yml` file.
|
||||||
|
|
||||||
|
### Docker quick start
|
||||||
|
|
||||||
|
Create a new directory and place the [docker-compose file](https://github.com/freqtrade/freqtrade/blob/develop/docker-compose.yml) in this directory.
|
||||||
|
|
||||||
|
=== "PC/MAC/Linux"
|
||||||
|
``` bash
|
||||||
|
mkdir ft_userdata
|
||||||
|
cd ft_userdata/
|
||||||
|
# Download the docker-compose file from the repository
|
||||||
|
curl https://raw.githubusercontent.com/freqtrade/freqtrade/stable/docker-compose.yml -o docker-compose.yml
|
||||||
|
|
||||||
|
# Pull the freqtrade image
|
||||||
|
docker-compose pull
|
||||||
|
|
||||||
|
# Create user directory structure
|
||||||
|
docker-compose run --rm freqtrade create-userdir --userdir user_data
|
||||||
|
|
||||||
|
# Create configuration - Requires answering interactive questions
|
||||||
|
docker-compose run --rm freqtrade new-config --config user_data/config.json
|
||||||
|
```
|
||||||
|
|
||||||
|
=== "RaspberryPi"
|
||||||
|
``` bash
|
||||||
|
mkdir ft_userdata
|
||||||
|
cd ft_userdata/
|
||||||
|
# Download the docker-compose file from the repository
|
||||||
|
curl https://raw.githubusercontent.com/freqtrade/freqtrade/stable/docker-compose.yml -o docker-compose.yml
|
||||||
|
|
||||||
|
# Pull the freqtrade image
|
||||||
|
docker-compose pull
|
||||||
|
|
||||||
|
# Create user directory structure
|
||||||
|
docker-compose run --rm freqtrade create-userdir --userdir user_data
|
||||||
|
|
||||||
|
# Create configuration - Requires answering interactive questions
|
||||||
|
docker-compose run --rm freqtrade new-config --config user_data/config.json
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Note "Change your docker Image"
|
||||||
|
You have to change the docker image in the docker-compose file for your Raspberry build to work properly.
|
||||||
|
``` yml
|
||||||
|
image: freqtradeorg/freqtrade:stable_pi
|
||||||
|
# image: freqtradeorg/freqtrade:develop_pi
|
||||||
|
```
|
||||||
|
|
||||||
|
The above snippet creates a new directory called `ft_userdata`, downloads the latest compose file and pulls the freqtrade image.
|
||||||
|
The last 2 steps in the snippet create the directory with `user_data`, as well as (interactively) the default configuration based on your selections.
|
||||||
|
|
||||||
|
!!! Question "How to edit the bot configuration?"
|
||||||
|
You can edit the configuration at any time, which is available as `user_data/config.json` (within the directory `ft_userdata`) when using the above configuration.
|
||||||
|
|
||||||
|
You can also change the both Strategy and commands by editing the `docker-compose.yml` file.
|
||||||
|
|
||||||
|
#### Adding a custom strategy
|
||||||
|
|
||||||
|
1. The configuration is now available as `user_data/config.json`
|
||||||
|
2. Copy a custom strategy to the directory `user_data/strategies/`
|
||||||
|
3. add the Strategy' class name to the `docker-compose.yml` file
|
||||||
|
|
||||||
|
The `SampleStrategy` is run by default.
|
||||||
|
|
||||||
|
!!! Warning "`SampleStrategy` is just a demo!"
|
||||||
|
The `SampleStrategy` is there for your reference and give you ideas for your own strategy.
|
||||||
|
Please always backtest the strategy and use dry-run for some time before risking real money!
|
||||||
|
|
||||||
|
Once this is done, you're ready to launch the bot in trading mode (Dry-run or Live-trading, depending on your answer to the corresponding question you made above).
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Docker-compose logs
|
||||||
|
|
||||||
|
Logs will be located at: `user_data/logs/freqtrade.log`.
|
||||||
|
You can check the latest log with the command `docker-compose logs -f`.
|
||||||
|
|
||||||
|
#### Database
|
||||||
|
|
||||||
|
The database will be at: `user_data/tradesv3.sqlite`
|
||||||
|
|
||||||
|
#### Updating freqtrade with docker-compose
|
||||||
|
|
||||||
|
To update freqtrade when using `docker-compose` is as simple as running the following 2 commands:
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
# Download the latest image
|
||||||
|
docker-compose pull
|
||||||
|
# Restart the image
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
This will first pull the latest image, and will then restart the container with the just pulled version.
|
||||||
|
|
||||||
|
!!! Warning "Check the Changelog"
|
||||||
|
You should always check the changelog for breaking changes / manual interventions required and make sure the bot starts correctly after the update.
|
||||||
|
|
||||||
|
### Editing the docker-compose file
|
||||||
|
|
||||||
|
Advanced users may edit the docker-compose file further to include all possible options or arguments.
|
||||||
|
|
||||||
|
All possible freqtrade arguments will be available by running `docker-compose run --rm freqtrade <command> <optional arguments>`.
|
||||||
|
|
||||||
|
!!! Note "`docker-compose run --rm`"
|
||||||
|
Including `--rm` will clean up the container after completion, and is highly recommended for all modes except trading mode (running with `freqtrade trade` command).
|
||||||
|
|
||||||
|
#### Example: Download data with docker-compose
|
||||||
|
|
||||||
|
Download backtesting data for 5 days for the pair ETH/BTC and 1h timeframe from Binance. The data will be stored in the directory `user_data/data/` on the host.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
docker-compose run --rm freqtrade download-data --pairs ETH/BTC --exchange binance --days 5 -t 1h
|
||||||
|
```
|
||||||
|
|
||||||
|
Head over to the [Data Downloading Documentation](data-download.md) for more details on downloading data.
|
||||||
|
|
||||||
|
#### Example: Backtest with docker-compose
|
||||||
|
|
||||||
|
Run backtesting in docker-containers for SampleStrategy and specified timerange of historical data, on 5m timeframe:
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
docker-compose run --rm freqtrade backtesting --config user_data/config.json --strategy SampleStrategy --timerange 20190801-20191001 -i 5m
|
||||||
|
```
|
||||||
|
|
||||||
|
Head over to the [Backtesting Documentation](backtesting.md) to learn more.
|
||||||
|
|
||||||
|
### Additional dependencies with docker-compose
|
||||||
|
|
||||||
|
If your strategy requires dependencies not included in the default image (like [technical](https://github.com/freqtrade/technical)) - it will be necessary to build the image on your host.
|
||||||
|
For this, please create a Dockerfile containing installation steps for the additional dependencies (have a look at [docker/Dockerfile.technical](https://github.com/freqtrade/freqtrade/blob/develop/docker/Dockerfile.technical) for an example).
|
||||||
|
|
||||||
|
You'll then also need to modify the `docker-compose.yml` file and uncomment the build step, as well as rename the image to avoid naming collisions.
|
||||||
|
|
||||||
|
``` yaml
|
||||||
|
image: freqtrade_custom
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: "./Dockerfile.<yourextension>"
|
||||||
|
```
|
||||||
|
|
||||||
|
You can then run `docker-compose build` to build the docker image, and run it using the commands described above.
|
||||||
|
|
||||||
|
## Plotting with docker-compose
|
||||||
|
|
||||||
|
Commands `freqtrade plot-profit` and `freqtrade plot-dataframe` ([Documentation](plotting.md)) are available by changing the image to `*_plot` in your docker-compose.yml file.
|
||||||
|
You can then use these commands as follows:
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
docker-compose run --rm freqtrade plot-dataframe --strategy AwesomeStrategy -p BTC/ETH --timerange=20180801-20180805
|
||||||
|
```
|
||||||
|
|
||||||
|
The output will be stored in the `user_data/plot` directory, and can be opened with any modern browser.
|
||||||
|
|
||||||
|
## Data analayis using docker compose
|
||||||
|
|
||||||
|
Freqtrade provides a docker-compose file which starts up a jupyter lab server.
|
||||||
|
You can run this server using the following command:
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
docker-compose --rm -f docker/docker-compose-jupyter.yml up
|
||||||
|
```
|
||||||
|
|
||||||
|
This will create a dockercontainer running jupyter lab, which will be accessible using `https://127.0.0.1:8888/lab`.
|
||||||
|
Please use the link that's printed in the console after startup for simplified login.
|
||||||
|
|
||||||
|
Since part of this image is built on your machine, it is recommended to rebuild the image from time to time to keep freqtrade (and dependencies) uptodate.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
docker-compose -f docker/docker-compose-jupyter.yml build --no-cache
|
||||||
|
```
|
||||||
320
docs/edge.md
320
docs/edge.md
@@ -1,75 +1,146 @@
|
|||||||
# Edge positioning
|
# Edge positioning
|
||||||
|
|
||||||
This page explains how to use Edge Positioning module in your bot in order to enter into a trade only if the trade has a reasonable win rate and risk reward ratio, and consequently adjust your position size and stoploss.
|
The `Edge Positioning` module uses probability to calculate your win rate and risk reward ration. It will use these statistics to control your strategy trade entry points, position side and, stoploss.
|
||||||
|
|
||||||
!!! Warning
|
!!! Warning
|
||||||
Edge positioning is not compatible with dynamic (volume-based) whitelist.
|
`Edge positioning` is not compatible with dynamic (volume-based) whitelist.
|
||||||
|
|
||||||
!!! Note
|
!!! Note
|
||||||
Edge does not consider anything else than buy/sell/stoploss signals. So trailing stoploss, ROI, and everything else are ignored in its calculation.
|
`Edge Positioning` only considers *its own* buy/sell/stoploss signals. It ignores the stoploss, trailing stoploss, and ROI settings in the strategy configuration file.
|
||||||
|
`Edge Positioning` improves the performance of some trading strategies and *decreases* the performance of others.
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
Trading is all about probability. No one can claim that he has a strategy working all the time. You have to assume that sometimes you lose.
|
|
||||||
|
|
||||||
But it doesn't mean there is no rule, it only means rules should work "most of the time". Let's play a game: we toss a coin, heads: I give you 10$, tails: you give me 10$. Is it an interesting game? No, it's quite boring, isn't it?
|
Trading strategies are not perfect. They are frameworks that are susceptible to the market and its indicators. Because the market is not at all predictable, sometimes a strategy will win and sometimes the same strategy will lose.
|
||||||
|
|
||||||
But let's say the probability that we have heads is 80% (because our coin has the displaced distribution of mass or other defect), and the probability that we have tails is 20%. Now it is becoming interesting...
|
To obtain an edge in the market, a strategy has to make more money than it loses. Making money in trading is not only about *how often* the strategy makes or loses money.
|
||||||
|
|
||||||
That means 10$ X 80% versus 10$ X 20%. 8$ versus 2$. That means over time you will win 8$ risking only 2$ on each toss of coin.
|
!!! tip "It doesn't matter how often, but how much!"
|
||||||
|
A bad strategy might make 1 penny in *ten* transactions but lose 1 dollar in *one* transaction. If one only checks the number of winning trades, it would be misleading to think that the strategy is actually making a profit.
|
||||||
|
|
||||||
Let's complicate it more: you win 80% of the time but only 2$, I win 20% of the time but 8$. The calculation is: 80% X 2$ versus 20% X 8$. It is becoming boring again because overtime you win $1.6$ (80% X 2$) and me $1.6 (20% X 8$) too.
|
The Edge Positioning module seeks to improve a strategy's winning probability and the money that the strategy will make *on the long run*.
|
||||||
|
|
||||||
The question is: How do you calculate that? How do you know if you wanna play?
|
We raise the following question[^1]:
|
||||||
|
|
||||||
The answer comes to two factors:
|
!!! Question "Which trade is a better option?"
|
||||||
- Win Rate
|
a) A trade with 80% of chance of losing $100 and 20% chance of winning $200<br/>
|
||||||
- Risk Reward Ratio
|
b) A trade with 100% of chance of losing $30
|
||||||
|
|
||||||
### Win Rate
|
???+ Info "Answer"
|
||||||
Win Rate (*W*) is is the mean over some amount of trades (*N*) what is the percentage of winning trades to total number of trades (note that we don't consider how much you gained but only if you won or not).
|
The expected value of *a)* is smaller than the expected value of *b)*.<br/>
|
||||||
|
Hence, *b*) represents a smaller loss in the long run.<br/>
|
||||||
|
However, the answer is: *it depends*
|
||||||
|
|
||||||
W = (Number of winning trades) / (Total number of trades) = (Number of winning trades) / N
|
Another way to look at it is to ask a similar question:
|
||||||
|
|
||||||
Complementary Loss Rate (*L*) is defined as
|
!!! Question "Which trade is a better option?"
|
||||||
|
a) A trade with 80% of chance of winning 100 and 20% chance of losing $200<br/>
|
||||||
|
b) A trade with 100% of chance of winning $30
|
||||||
|
|
||||||
L = (Number of losing trades) / (Total number of trades) = (Number of losing trades) / N
|
Edge positioning tries to answer the hard questions about risk/reward and position size automatically, seeking to minimizes the chances of losing of a given strategy.
|
||||||
|
|
||||||
or, which is the same, as
|
### Trading, winning and losing
|
||||||
|
|
||||||
L = 1 – W
|
Let's call $o$ the return of a single transaction $o$ where $o \in \mathbb{R}$. The collection $O = \{o_1, o_2, ..., o_N\}$ is the set of all returns of transactions made during a trading session. We say that $N$ is the cardinality of $O$, or, in lay terms, it is the number of transactions made in a trading session.
|
||||||
|
|
||||||
|
!!! Example
|
||||||
|
In a session where a strategy made three transactions we can say that $O = \{3.5, -1, 15\}$. That means that $N = 3$ and $o_1 = 3.5$, $o_2 = -1$, $o_3 = 15$.
|
||||||
|
|
||||||
|
A winning trade is a trade where a strategy *made* money. Making money means that the strategy closed the position in a value that returned a profit, after all deducted fees. Formally, a winning trade will have a return $o_i > 0$. Similarly, a losing trade will have a return $o_j \leq 0$. With that, we can discover the set of all winning trades, $T_{win}$, as follows:
|
||||||
|
|
||||||
|
$$ T_{win} = \{ o \in O | o > 0 \} $$
|
||||||
|
|
||||||
|
Similarly, we can discover the set of losing trades $T_{lose}$ as follows:
|
||||||
|
|
||||||
|
$$ T_{lose} = \{o \in O | o \leq 0\} $$
|
||||||
|
|
||||||
|
!!! Example
|
||||||
|
In a section where a strategy made three transactions $O = \{3.5, -1, 15, 0\}$:<br>
|
||||||
|
$T_{win} = \{3.5, 15\}$<br>
|
||||||
|
$T_{lose} = \{-1, 0\}$<br>
|
||||||
|
|
||||||
|
### Win Rate and Lose Rate
|
||||||
|
|
||||||
|
The win rate $W$ is the proportion of winning trades with respect to all the trades made by a strategy. We use the following function to compute the win rate:
|
||||||
|
|
||||||
|
$$W = \frac{|T_{win}|}{N}$$
|
||||||
|
|
||||||
|
Where $W$ is the win rate, $N$ is the number of trades and, $T_{win}$ is the set of all trades where the strategy made money.
|
||||||
|
|
||||||
|
Similarly, we can compute the rate of losing trades:
|
||||||
|
|
||||||
|
$$
|
||||||
|
L = \frac{|T_{lose}|}{N}
|
||||||
|
$$
|
||||||
|
|
||||||
|
Where $L$ is the lose rate, $N$ is the amount of trades made and, $T_{lose}$ is the set of all trades where the strategy lost money. Note that the above formula is the same as calculating $L = 1 – W$ or $W = 1 – L$
|
||||||
|
|
||||||
### Risk Reward Ratio
|
### Risk Reward Ratio
|
||||||
Risk Reward Ratio (*R*) is a formula used to measure the expected gains of a given investment against the risk of loss. It is basically what you potentially win divided by what you potentially lose:
|
|
||||||
|
|
||||||
R = Profit / Loss
|
Risk Reward Ratio ($R$) is a formula used to measure the expected gains of a given investment against the risk of loss. It is basically what you potentially win divided by what you potentially lose. Formally:
|
||||||
|
|
||||||
Over time, on many trades, you can calculate your risk reward by dividing your average profit on winning trades by your average loss on losing trades:
|
$$ R = \frac{\text{potential_profit}}{\text{potential_loss}} $$
|
||||||
|
|
||||||
Average profit = (Sum of profits) / (Number of winning trades)
|
???+ Example "Worked example of $R$ calculation"
|
||||||
|
Let's say that you think that the price of *stonecoin* today is $10.0. You believe that, because they will start mining stonecoin, it will go up to $15.0 tomorrow. There is the risk that the stone is too hard, and the GPUs can't mine it, so the price might go to $0 tomorrow. You are planning to invest $100.<br>
|
||||||
|
Your potential profit is calculated as:<br>
|
||||||
|
$\begin{aligned}
|
||||||
|
\text{potential_profit} &= (\text{potential_price} - \text{cost_per_unit}) * \frac{\text{investment}}{\text{cost_per_unit}} \\
|
||||||
|
&= (15 - 10) * \frac{100}{15}\\
|
||||||
|
&= 33.33
|
||||||
|
\end{aligned}$<br>
|
||||||
|
Since the price might go to $0, the $100 dolars invested could turn into 0. We can compute the Risk Reward Ratio as follows:<br>
|
||||||
|
$\begin{aligned}
|
||||||
|
R &= \frac{\text{potential_profit}}{\text{potential_loss}}\\
|
||||||
|
&= \frac{33.33}{100}\\
|
||||||
|
&= 0.333...
|
||||||
|
\end{aligned}$<br>
|
||||||
|
What it effectivelly means is that the strategy have the potential to make $0.33 for each $1 invested.
|
||||||
|
|
||||||
Average loss = (Sum of losses) / (Number of losing trades)
|
On a long horizon, that is, on many trades, we can calculate the risk reward by dividing the strategy' average profit on winning trades by the strategy' average loss on losing trades. We can calculate the average profit, $\mu_{win}$, as follows:
|
||||||
|
|
||||||
|
$$ \text{average_profit} = \mu_{win} = \frac{\text{sum_of_profits}}{\text{count_winning_trades}} = \frac{\sum^{o \in T_{win}} o}{|T_{win}|} $$
|
||||||
|
|
||||||
|
Similarly, we can calculate the average loss, $\mu_{lose}$, as follows:
|
||||||
|
|
||||||
|
$$ \text{average_loss} = \mu_{lose} = \frac{\text{sum_of_losses}}{\text{count_losing_trades}} = \frac{\sum^{o \in T_{lose}} o}{|T_{lose}|} $$
|
||||||
|
|
||||||
|
Finally, we can calculate the Risk Reward ratio, $R$, as follows:
|
||||||
|
|
||||||
|
$$ R = \frac{\text{average_profit}}{\text{average_loss}} = \frac{\mu_{win}}{\mu_{lose}}\\ $$
|
||||||
|
|
||||||
|
|
||||||
|
???+ Example "Worked example of $R$ calculation using mean profit/loss"
|
||||||
|
Let's say the strategy that we are using makes an average win $\mu_{win} = 2.06$ and an average loss $\mu_{loss} = 4.11$.<br>
|
||||||
|
We calculate the risk reward ratio as follows:<br>
|
||||||
|
$R = \frac{\mu_{win}}{\mu_{loss}} = \frac{2.06}{4.11} = 0.5012...$
|
||||||
|
|
||||||
R = (Average profit) / (Average loss)
|
|
||||||
|
|
||||||
### Expectancy
|
### Expectancy
|
||||||
At this point we can combine *W* and *R* to create an expectancy ratio. This is a simple process of multiplying the risk reward ratio by the percentage of winning trades and subtracting the percentage of losing trades, which is calculated as follows:
|
|
||||||
|
|
||||||
Expectancy Ratio = (Risk Reward Ratio X Win Rate) – Loss Rate = (R X W) – L
|
By combining the Win Rate $W$ and and the Risk Reward ratio $R$ to create an expectancy ratio $E$. A expectance ratio is the expected return of the investment made in a trade. We can compute the value of $E$ as follows:
|
||||||
|
|
||||||
So lets say your Win rate is 28% and your Risk Reward Ratio is 5:
|
$$E = R * W - L$$
|
||||||
|
|
||||||
Expectancy = (5 X 0.28) – 0.72 = 0.68
|
!!! Example "Calculating $E$"
|
||||||
|
Let's say that a strategy has a win rate $W = 0.28$ and a risk reward ratio $R = 5$. What this means is that the strategy is expected to make 5 times the investment around on 28% of the trades it makes. Working out the example:<br>
|
||||||
|
$E = R * W - L = 5 * 0.28 - 0.72 = 0.68$
|
||||||
|
<br>
|
||||||
|
|
||||||
Superficially, this means that on average you expect this strategy’s trades to return .68 times the size of your loses. This is important for two reasons: First, it may seem obvious, but you know right away that you have a positive return. Second, you now have a number you can compare to other candidate systems to make decisions about which ones you employ.
|
The expectancy worked out in the example above means that, on average, this strategy' trades will return 1.68 times the size of its losses. Said another way, the strategy makes $1.68 for every $1 it loses, on average.
|
||||||
|
|
||||||
|
This is important for two reasons: First, it may seem obvious, but you know right away that you have a positive return. Second, you now have a number you can compare to other candidate systems to make decisions about which ones you employ.
|
||||||
|
|
||||||
It is important to remember that any system with an expectancy greater than 0 is profitable using past data. The key is finding one that will be profitable in the future.
|
It is important to remember that any system with an expectancy greater than 0 is profitable using past data. The key is finding one that will be profitable in the future.
|
||||||
|
|
||||||
You can also use this value to evaluate the effectiveness of modifications to this system.
|
You can also use this value to evaluate the effectiveness of modifications to this system.
|
||||||
|
|
||||||
**NOTICE:** It's important to keep in mind that Edge is testing your expectancy using historical data, there's no guarantee that you will have a similar edge in the future. It's still vital to do this testing in order to build confidence in your methodology, but be wary of "curve-fitting" your approach to the historical data as things are unlikely to play out the exact same way for future trades.
|
!!! Note
|
||||||
|
It's important to keep in mind that Edge is testing your expectancy using historical data, there's no guarantee that you will have a similar edge in the future. It's still vital to do this testing in order to build confidence in your methodology but be wary of "curve-fitting" your approach to the historical data as things are unlikely to play out the exact same way for future trades.
|
||||||
|
|
||||||
## How does it work?
|
## How does it work?
|
||||||
If enabled in config, Edge will go through historical data with a range of stoplosses in order to find buy and sell/stoploss signals. It then calculates win rate and expectancy over *N* trades for each stoploss. Here is an example:
|
|
||||||
|
Edge combines dynamic stoploss, dynamic positions, and whitelist generation into one isolated module which is then applied to the trading strategy. If enabled in config, Edge will go through historical data with a range of stoplosses in order to find buy and sell/stoploss signals. It then calculates win rate and expectancy over *N* trades for each stoploss. Here is an example:
|
||||||
|
|
||||||
| Pair | Stoploss | Win Rate | Risk Reward Ratio | Expectancy |
|
| Pair | Stoploss | Win Rate | Risk Reward Ratio | Expectancy |
|
||||||
|----------|:-------------:|-------------:|------------------:|-----------:|
|
|----------|:-------------:|-------------:|------------------:|-----------:|
|
||||||
@@ -78,164 +149,108 @@ If enabled in config, Edge will go through historical data with a range of stopl
|
|||||||
| XZC/ETH | -0.03 | 0.52 |1.359670 | 0.228 |
|
| XZC/ETH | -0.03 | 0.52 |1.359670 | 0.228 |
|
||||||
| XZC/ETH | -0.04 | 0.51 |1.234539 | 0.117 |
|
| XZC/ETH | -0.04 | 0.51 |1.234539 | 0.117 |
|
||||||
|
|
||||||
The goal here is to find the best stoploss for the strategy in order to have the maximum expectancy. In the above example stoploss at 3% leads to the maximum expectancy according to historical data.
|
The goal here is to find the best stoploss for the strategy in order to have the maximum expectancy. In the above example stoploss at $3%$ leads to the maximum expectancy according to historical data.
|
||||||
|
|
||||||
Edge module then forces stoploss value it evaluated to your strategy dynamically.
|
Edge module then forces stoploss value it evaluated to your strategy dynamically.
|
||||||
|
|
||||||
### Position size
|
### Position size
|
||||||
Edge also dictates the stake amount for each trade to the bot according to the following factors:
|
|
||||||
|
Edge dictates the amount at stake for each trade to the bot according to the following factors:
|
||||||
|
|
||||||
- Allowed capital at risk
|
- Allowed capital at risk
|
||||||
- Stoploss
|
- Stoploss
|
||||||
|
|
||||||
Allowed capital at risk is calculated as follows:
|
Allowed capital at risk is calculated as follows:
|
||||||
|
|
||||||
Allowed capital at risk = (Capital available_percentage) X (Allowed risk per trade)
|
```
|
||||||
|
Allowed capital at risk = (Capital available_percentage) X (Allowed risk per trade)
|
||||||
|
```
|
||||||
|
|
||||||
Stoploss is calculated as described above against historical data.
|
Stoploss is calculated as described above with respect to historical data.
|
||||||
|
|
||||||
Your position size then will be:
|
The position size is calculated as follows:
|
||||||
|
|
||||||
Position size = (Allowed capital at risk) / Stoploss
|
```
|
||||||
|
Position size = (Allowed capital at risk) / Stoploss
|
||||||
|
```
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
Let's say the stake currency is ETH and you have 10 ETH on the exchange, your capital available percentage is 50% and you would allow 1% of risk for each trade. thus your available capital for trading is **10 x 0.5 = 5 ETH** and allowed capital at risk would be **5 x 0.01 = 0.05 ETH**.
|
Let's say the stake currency is **ETH** and there is $10$ **ETH** on the wallet. The capital available percentage is $50%$ and the allowed risk per trade is $1\%$. Thus, the available capital for trading is $10 * 0.5 = 5$ **ETH** and the allowed capital at risk would be $5 * 0.01 = 0.05$ **ETH**.
|
||||||
|
|
||||||
Let's assume Edge has calculated that for **XLM/ETH** market your stoploss should be at 2%. So your position size will be **0.05 / 0.02 = 2.5 ETH**.
|
- **Trade 1:** The strategy detects a new buy signal in the **XLM/ETH** market. `Edge Positioning` calculates a stoploss of $2\%$ and a position of $0.05 / 0.02 = 2.5$ **ETH**. The bot takes a position of $2.5$ **ETH** in the **XLM/ETH** market.
|
||||||
|
|
||||||
Bot takes a position of 2.5 ETH on XLM/ETH (call it trade 1). Up next, you receive another buy signal while trade 1 is still open. This time on **BTC/ETH** market. Edge calculated stoploss for this market at 4%. So your position size would be 0.05 / 0.04 = 1.25 ETH (call it trade 2).
|
- **Trade 2:** The strategy detects a buy signal on the **BTC/ETH** market while **Trade 1** is still open. `Edge Positioning` calculates the stoploss of $4\%$ on this market. Thus, **Trade 2** position size is $0.05 / 0.04 = 1.25$ **ETH**.
|
||||||
|
|
||||||
Note that available capital for trading didn’t change for trade 2 even if you had already trade 1. The available capital doesn’t mean the free amount on your wallet.
|
!!! Tip "Available Capital $\neq$ Available in wallet"
|
||||||
|
The available capital for trading didn't change in **Trade 2** even with **Trade 1** still open. The available capital **is not** the free amount in the wallet.
|
||||||
|
|
||||||
Now you have two trades open. The bot receives yet another buy signal for another market: **ADA/ETH**. This time the stoploss is calculated at 1%. So your position size is **0.05 / 0.01 = 5 ETH**. But there are already 3.75 ETH blocked in two previous trades. So the position size for this third trade would be **5 – 3.75 = 1.25 ETH**.
|
- **Trade 3:** The strategy detects a buy signal in the **ADA/ETH** market. `Edge Positioning` calculates a stoploss of $1\%$ and a position of $0.05 / 0.01 = 5$ **ETH**. Since **Trade 1** has $2.5$ **ETH** blocked and **Trade 2** has $1.25$ **ETH** blocked, there is only $5 - 1.25 - 2.5 = 1.25$ **ETH** available. Hence, the position size of **Trade 3** is $1.25$ **ETH**.
|
||||||
|
|
||||||
Available capital doesn’t change before a position is sold. Let’s assume that trade 1 receives a sell signal and it is sold with a profit of 1 ETH. Your total capital on exchange would be 11 ETH and the available capital for trading becomes 5.5 ETH.
|
!!! Tip "Available Capital Updates"
|
||||||
|
The available capital does not change before a position is sold. After a trade is closed the Available Capital goes up if the trade was profitable or goes down if the trade was a loss.
|
||||||
|
|
||||||
So the Bot receives another buy signal for trade 4 with a stoploss at 2% then your position size would be **0.055 / 0.02 = 2.75 ETH**.
|
- The strategy detects a sell signal in the **XLM/ETH** market. The bot exits **Trade 1** for a profit of $1$ **ETH**. The total capital in the wallet becomes $11$ **ETH** and the available capital for trading becomes $5.5$ **ETH**.
|
||||||
|
|
||||||
|
- **Trade 4** The strategy detects a new buy signal int the **XLM/ETH** market. `Edge Positioning` calculates the stoploss of $2%$, and the position size of $0.055 / 0.02 = 2.75$ **ETH**.
|
||||||
|
|
||||||
## Configurations
|
## Configurations
|
||||||
|
|
||||||
Edge module has following configuration options:
|
Edge module has following configuration options:
|
||||||
|
|
||||||
#### enabled
|
| Parameter | Description |
|
||||||
If true, then Edge will run periodically.
|
|------------|-------------|
|
||||||
|
| `enabled` | If true, then Edge will run periodically. <br>*Defaults to `false`.* <br> **Datatype:** Boolean
|
||||||
(defaults to false)
|
| `process_throttle_secs` | How often should Edge run in seconds. <br>*Defaults to `3600` (once per hour).* <br> **Datatype:** Integer
|
||||||
|
| `calculate_since_number_of_days` | Number of days of data against which Edge calculates Win Rate, Risk Reward and Expectancy. <br> **Note** that it downloads historical data so increasing this number would lead to slowing down the bot. <br>*Defaults to `7`.* <br> **Datatype:** Integer
|
||||||
#### process_throttle_secs
|
| `allowed_risk` | Ratio of allowed risk per trade. <br>*Defaults to `0.01` (1%)).* <br> **Datatype:** Float
|
||||||
How often should Edge run in seconds?
|
| `stoploss_range_min` | Minimum stoploss. <br>*Defaults to `-0.01`.* <br> **Datatype:** Float
|
||||||
|
| `stoploss_range_max` | Maximum stoploss. <br>*Defaults to `-0.10`.* <br> **Datatype:** Float
|
||||||
(defaults to 3600 so one hour)
|
| `stoploss_range_step` | As an example if this is set to -0.01 then Edge will test the strategy for `[-0.01, -0,02, -0,03 ..., -0.09, -0.10]` ranges. <br> **Note** than having a smaller step means having a bigger range which could lead to slow calculation. <br> If you set this parameter to -0.001, you then slow down the Edge calculation by a factor of 10. <br>*Defaults to `-0.001`.* <br> **Datatype:** Float
|
||||||
|
| `minimum_winrate` | It filters out pairs which don't have at least minimum_winrate. <br>This comes handy if you want to be conservative and don't comprise win rate in favour of risk reward ratio. <br>*Defaults to `0.60`.* <br> **Datatype:** Float
|
||||||
#### calculate_since_number_of_days
|
| `minimum_expectancy` | It filters out pairs which have the expectancy lower than this number. <br>Having an expectancy of 0.20 means if you put 10$ on a trade you expect a 12$ return. <br>*Defaults to `0.20`.* <br> **Datatype:** Float
|
||||||
Number of days of data against which Edge calculates Win Rate, Risk Reward and Expectancy
|
| `min_trade_number` | When calculating *W*, *R* and *E* (expectancy) against historical data, you always want to have a minimum number of trades. The more this number is the more Edge is reliable. <br>Having a win rate of 100% on a single trade doesn't mean anything at all. But having a win rate of 70% over past 100 trades means clearly something. <br>*Defaults to `10` (it is highly recommended not to decrease this number).* <br> **Datatype:** Integer
|
||||||
Note that it downloads historical data so increasing this number would lead to slowing down the bot.
|
| `max_trade_duration_minute` | Edge will filter out trades with long duration. If a trade is profitable after 1 month, it is hard to evaluate the strategy based on it. But if most of trades are profitable and they have maximum duration of 30 minutes, then it is clearly a good sign.<br>**NOTICE:** While configuring this value, you should take into consideration your timeframe. As an example filtering out trades having duration less than one day for a strategy which has 4h interval does not make sense. Default value is set assuming your strategy interval is relatively small (1m or 5m, etc.).<br>*Defaults to `1440` (one day).* <br> **Datatype:** Integer
|
||||||
|
| `remove_pumps` | Edge will remove sudden pumps in a given market while going through historical data. However, given that pumps happen very often in crypto markets, we recommend you keep this off.<br>*Defaults to `false`.* <br> **Datatype:** Boolean
|
||||||
(defaults to 7)
|
|
||||||
|
|
||||||
#### capital_available_percentage
|
|
||||||
This is the percentage of the total capital on exchange in stake currency.
|
|
||||||
|
|
||||||
As an example if you have 10 ETH available in your wallet on the exchange and this value is 0.5 (which is 50%), then the bot will use a maximum amount of 5 ETH for trading and considers it as available capital.
|
|
||||||
|
|
||||||
(defaults to 0.5)
|
|
||||||
|
|
||||||
#### allowed_risk
|
|
||||||
Percentage of allowed risk per trade.
|
|
||||||
|
|
||||||
(defaults to 0.01 so 1%)
|
|
||||||
|
|
||||||
#### stoploss_range_min
|
|
||||||
|
|
||||||
Minimum stoploss.
|
|
||||||
|
|
||||||
(defaults to -0.01)
|
|
||||||
|
|
||||||
#### stoploss_range_max
|
|
||||||
|
|
||||||
Maximum stoploss.
|
|
||||||
|
|
||||||
(defaults to -0.10)
|
|
||||||
|
|
||||||
#### stoploss_range_step
|
|
||||||
|
|
||||||
As an example if this is set to -0.01 then Edge will test the strategy for \[-0.01, -0,02, -0,03 ..., -0.09, -0.10\] ranges.
|
|
||||||
Note than having a smaller step means having a bigger range which could lead to slow calculation.
|
|
||||||
|
|
||||||
If you set this parameter to -0.001, you then slow down the Edge calculation by a factor of 10.
|
|
||||||
|
|
||||||
(defaults to -0.01)
|
|
||||||
|
|
||||||
#### minimum_winrate
|
|
||||||
|
|
||||||
It filters out pairs which don't have at least minimum_winrate.
|
|
||||||
|
|
||||||
This comes handy if you want to be conservative and don't comprise win rate in favour of risk reward ratio.
|
|
||||||
|
|
||||||
(defaults to 0.60)
|
|
||||||
|
|
||||||
#### minimum_expectancy
|
|
||||||
|
|
||||||
It filters out pairs which have the expectancy lower than this number.
|
|
||||||
|
|
||||||
Having an expectancy of 0.20 means if you put 10$ on a trade you expect a 12$ return.
|
|
||||||
|
|
||||||
(defaults to 0.20)
|
|
||||||
|
|
||||||
#### min_trade_number
|
|
||||||
|
|
||||||
When calculating *W*, *R* and *E* (expectancy) against historical data, you always want to have a minimum number of trades. The more this number is the more Edge is reliable.
|
|
||||||
|
|
||||||
Having a win rate of 100% on a single trade doesn't mean anything at all. But having a win rate of 70% over past 100 trades means clearly something.
|
|
||||||
|
|
||||||
(defaults to 10, it is highly recommended not to decrease this number)
|
|
||||||
|
|
||||||
#### max_trade_duration_minute
|
|
||||||
|
|
||||||
Edge will filter out trades with long duration. If a trade is profitable after 1 month, it is hard to evaluate the strategy based on it. But if most of trades are profitable and they have maximum duration of 30 minutes, then it is clearly a good sign.
|
|
||||||
|
|
||||||
**NOTICE:** While configuring this value, you should take into consideration your ticker interval. As an example filtering out trades having duration less than one day for a strategy which has 4h interval does not make sense. Default value is set assuming your strategy interval is relatively small (1m or 5m, etc.).
|
|
||||||
|
|
||||||
(defaults to 1 day, i.e. to 60 * 24 = 1440 minutes)
|
|
||||||
|
|
||||||
#### remove_pumps
|
|
||||||
|
|
||||||
Edge will remove sudden pumps in a given market while going through historical data. However, given that pumps happen very often in crypto markets, we recommend you keep this off.
|
|
||||||
|
|
||||||
(defaults to false)
|
|
||||||
|
|
||||||
## Running Edge independently
|
## Running Edge independently
|
||||||
|
|
||||||
You can run Edge independently in order to see in details the result. Here is an example:
|
You can run Edge independently in order to see in details the result. Here is an example:
|
||||||
|
|
||||||
```bash
|
``` bash
|
||||||
freqtrade edge
|
freqtrade edge
|
||||||
```
|
```
|
||||||
|
|
||||||
An example of its output:
|
An example of its output:
|
||||||
|
|
||||||
| pair | stoploss | win rate | risk reward ratio | required risk reward | expectancy | total number of trades | average duration (min) |
|
| **pair** | **stoploss** | **win rate** | **risk reward ratio** | **required risk reward** | **expectancy** | **total number of trades** | **average duration (min)** |
|
||||||
|:----------|-----------:|-----------:|--------------------:|-----------------------:|-------------:|-------------------------:|-------------------------:|
|
|:----------|-----------:|-----------:|--------------------:|-----------------------:|-------------:|-----------------:|---------------:|
|
||||||
| AGI/BTC | -0.02 | 0.64 | 5.86 | 0.56 | 3.41 | 14 | 54 |
|
| **AGI/BTC** | -0.02 | 0.64 | 5.86 | 0.56 | 3.41 | 14 | 54 |
|
||||||
| NXS/BTC | -0.03 | 0.64 | 2.99 | 0.57 | 1.54 | 11 | 26 |
|
| **NXS/BTC** | -0.03 | 0.64 | 2.99 | 0.57 | 1.54 | 11 | 26 |
|
||||||
| LEND/BTC | -0.02 | 0.82 | 2.05 | 0.22 | 1.50 | 11 | 36 |
|
| **LEND/BTC** | -0.02 | 0.82 | 2.05 | 0.22 | 1.50 | 11 | 36 |
|
||||||
| VIA/BTC | -0.01 | 0.55 | 3.01 | 0.83 | 1.19 | 11 | 48 |
|
| **VIA/BTC** | -0.01 | 0.55 | 3.01 | 0.83 | 1.19 | 11 | 48 |
|
||||||
| MTH/BTC | -0.09 | 0.56 | 2.82 | 0.80 | 1.12 | 18 | 52 |
|
| **MTH/BTC** | -0.09 | 0.56 | 2.82 | 0.80 | 1.12 | 18 | 52 |
|
||||||
| ARDR/BTC | -0.04 | 0.42 | 3.14 | 1.40 | 0.73 | 12 | 42 |
|
| **ARDR/BTC** | -0.04 | 0.42 | 3.14 | 1.40 | 0.73 | 12 | 42 |
|
||||||
| BCPT/BTC | -0.01 | 0.71 | 1.34 | 0.40 | 0.67 | 14 | 30 |
|
| **BCPT/BTC** | -0.01 | 0.71 | 1.34 | 0.40 | 0.67 | 14 | 30 |
|
||||||
| WINGS/BTC | -0.02 | 0.56 | 1.97 | 0.80 | 0.65 | 27 | 42 |
|
| **WINGS/BTC** | -0.02 | 0.56 | 1.97 | 0.80 | 0.65 | 27 | 42 |
|
||||||
| VIBE/BTC | -0.02 | 0.83 | 0.91 | 0.20 | 0.59 | 12 | 35 |
|
| **VIBE/BTC** | -0.02 | 0.83 | 0.91 | 0.20 | 0.59 | 12 | 35 |
|
||||||
| MCO/BTC | -0.02 | 0.79 | 0.97 | 0.27 | 0.55 | 14 | 31 |
|
| **MCO/BTC** | -0.02 | 0.79 | 0.97 | 0.27 | 0.55 | 14 | 31 |
|
||||||
| GNT/BTC | -0.02 | 0.50 | 2.06 | 1.00 | 0.53 | 18 | 24 |
|
| **GNT/BTC** | -0.02 | 0.50 | 2.06 | 1.00 | 0.53 | 18 | 24 |
|
||||||
| HOT/BTC | -0.01 | 0.17 | 7.72 | 4.81 | 0.50 | 209 | 7 |
|
| **HOT/BTC** | -0.01 | 0.17 | 7.72 | 4.81 | 0.50 | 209 | 7 |
|
||||||
| SNM/BTC | -0.03 | 0.71 | 1.06 | 0.42 | 0.45 | 17 | 38 |
|
| **SNM/BTC** | -0.03 | 0.71 | 1.06 | 0.42 | 0.45 | 17 | 38 |
|
||||||
| APPC/BTC | -0.02 | 0.44 | 2.28 | 1.27 | 0.44 | 25 | 43 |
|
| **APPC/BTC** | -0.02 | 0.44 | 2.28 | 1.27 | 0.44 | 25 | 43 |
|
||||||
| NEBL/BTC | -0.03 | 0.63 | 1.29 | 0.58 | 0.44 | 19 | 59 |
|
| **NEBL/BTC** | -0.03 | 0.63 | 1.29 | 0.58 | 0.44 | 19 | 59 |
|
||||||
|
|
||||||
|
Edge produced the above table by comparing `calculate_since_number_of_days` to `minimum_expectancy` to find `min_trade_number` historical information based on the config file. The timerange Edge uses for its comparisons can be further limited by using the `--timerange` switch.
|
||||||
|
|
||||||
|
In live and dry-run modes, after the `process_throttle_secs` has passed, Edge will again process `calculate_since_number_of_days` against `minimum_expectancy` to find `min_trade_number`. If no `min_trade_number` is found, the bot will return "whitelist empty". Depending on the trade strategy being deployed, "whitelist empty" may be return much of the time - or *all* of the time. The use of Edge may also cause trading to occur in bursts, though this is rare.
|
||||||
|
|
||||||
|
If you encounter "whitelist empty" a lot, condsider tuning `calculate_since_number_of_days`, `minimum_expectancy` and `min_trade_number` to align to the trading frequency of your strategy.
|
||||||
|
|
||||||
### Update cached pairs with the latest data
|
### Update cached pairs with the latest data
|
||||||
|
|
||||||
Edge requires historic data the same way as backtesting does.
|
Edge requires historic data the same way as backtesting does.
|
||||||
Please refer to the [download section](backtesting.md#Getting-data-for-backtesting-and-hyperopt) of the documentation for details.
|
Please refer to the [Data Downloading](data-download.md) section of the documentation for details.
|
||||||
|
|
||||||
### Precising stoploss range
|
### Precising stoploss range
|
||||||
|
|
||||||
@@ -257,3 +272,6 @@ The full timerange specification:
|
|||||||
* Use tickframes since 2018/01/31: `--timerange=20180131-`
|
* Use tickframes since 2018/01/31: `--timerange=20180131-`
|
||||||
* Use tickframes since 2018/01/31 till 2018/03/01 : `--timerange=20180131-20180301`
|
* Use tickframes since 2018/01/31 till 2018/03/01 : `--timerange=20180131-20180301`
|
||||||
* Use tickframes between POSIX timestamps 1527595200 1527618600: `--timerange=1527595200-1527618600`
|
* Use tickframes between POSIX timestamps 1527595200 1527618600: `--timerange=1527595200-1527618600`
|
||||||
|
|
||||||
|
|
||||||
|
[^1]: Question extracted from MIT Opencourseware S096 - Mathematics with applications in Finance: https://ocw.mit.edu/courses/mathematics/18-s096-topics-in-mathematics-with-applications-in-finance-fall-2013/
|
||||||
|
|||||||
119
docs/exchanges.md
Normal file
119
docs/exchanges.md
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
# Exchange-specific Notes
|
||||||
|
|
||||||
|
This page combines common gotchas and informations which are exchange-specific and most likely don't apply to other exchanges.
|
||||||
|
|
||||||
|
## Binance
|
||||||
|
|
||||||
|
!!! Tip "Stoploss on Exchange"
|
||||||
|
Binance supports `stoploss_on_exchange` and uses stop-loss-limit orders. It provides great advantages, so we recommend to benefit from it.
|
||||||
|
|
||||||
|
### Blacklists
|
||||||
|
|
||||||
|
For Binance, please add `"BNB/<STAKE>"` to your blacklist to avoid issues.
|
||||||
|
Accounts having BNB accounts use this to pay for fees - if your first trade happens to be on `BNB`, further trades will consume this position and make the initial BNB order unsellable as the expected amount is not there anymore.
|
||||||
|
|
||||||
|
### Binance sites
|
||||||
|
|
||||||
|
Binance has been split into 3, and users must use the correct ccxt exchange ID for their exchange, otherwise API keys are not recognized.
|
||||||
|
|
||||||
|
* [binance.com](https://www.binance.com/) - International users. Use exchange id: `binance`.
|
||||||
|
* [binance.us](https://www.binance.us/) - US based users. Use exchange id: `binanceus`.
|
||||||
|
* [binance.je](https://www.binance.je/) - Binance Jersey, trading fiat currencies. Use exchange id: `binanceje`.
|
||||||
|
|
||||||
|
## Kraken
|
||||||
|
|
||||||
|
!!! Tip "Stoploss on Exchange"
|
||||||
|
Kraken supports `stoploss_on_exchange` and uses stop-loss-market orders. It provides great advantages, so we recommend to benefit from it, however since the resulting order is a stoploss-market order, sell-rates are not guaranteed, which makes this feature less secure than on other exchanges. This limitation is based on kraken's policy [source](https://blog.kraken.com/post/1234/announcement-delisting-pairs-and-temporary-suspension-of-advanced-order-types/) and [source2](https://blog.kraken.com/post/1494/kraken-enables-advanced-orders-and-adds-10-currency-pairs/) - which has stoploss-limit orders disabled.
|
||||||
|
|
||||||
|
### Historic Kraken data
|
||||||
|
|
||||||
|
The Kraken API does only provide 720 historic candles, which is sufficient for Freqtrade dry-run and live trade modes, but is a problem for backtesting.
|
||||||
|
To download data for the Kraken exchange, using `--dl-trades` is mandatory, otherwise the bot will download the same 720 candles over and over, and you'll not have enough backtest data.
|
||||||
|
|
||||||
|
Due to the heavy rate-limiting applied by Kraken, the following configuration section should be used to download data:
|
||||||
|
|
||||||
|
``` json
|
||||||
|
"ccxt_async_config": {
|
||||||
|
"enableRateLimit": true,
|
||||||
|
"rateLimit": 3100
|
||||||
|
},
|
||||||
|
```
|
||||||
|
|
||||||
|
## Bittrex
|
||||||
|
|
||||||
|
### Order types
|
||||||
|
|
||||||
|
Bittrex does not support market orders. If you have a message at the bot startup about this, you should change order type values set in your configuration and/or in the strategy from `"market"` to `"limit"`. See some more details on this [here in the FAQ](faq.md#im-getting-the-exchange-bittrex-does-not-support-market-orders-message-and-cannot-run-my-strategy).
|
||||||
|
|
||||||
|
### Restricted markets
|
||||||
|
|
||||||
|
Bittrex split its exchange into US and International versions.
|
||||||
|
The International version has more pairs available, however the API always returns all pairs, so there is currently no automated way to detect if you're affected by the restriction.
|
||||||
|
|
||||||
|
If you have restricted pairs in your whitelist, you'll get a warning message in the log on Freqtrade startup for each restricted pair.
|
||||||
|
|
||||||
|
The warning message will look similar to the following:
|
||||||
|
|
||||||
|
``` output
|
||||||
|
[...] Message: bittrex {"success":false,"message":"RESTRICTED_MARKET","result":null,"explanation":null}"
|
||||||
|
```
|
||||||
|
|
||||||
|
If you're an "International" customer on the Bittrex exchange, then this warning will probably not impact you.
|
||||||
|
If you're a US customer, the bot will fail to create orders for these pairs, and you should remove them from your whitelist.
|
||||||
|
|
||||||
|
You can get a list of restricted markets by using the following snippet:
|
||||||
|
|
||||||
|
``` python
|
||||||
|
import ccxt
|
||||||
|
ct = ccxt.bittrex()
|
||||||
|
_ = ct.load_markets()
|
||||||
|
res = [ f"{x['MarketCurrency']}/{x['BaseCurrency']}" for x in ct.publicGetMarkets()['result'] if x['IsRestricted']]
|
||||||
|
print(res)
|
||||||
|
```
|
||||||
|
|
||||||
|
## FTX
|
||||||
|
|
||||||
|
!!! Tip "Stoploss on Exchange"
|
||||||
|
FTX supports `stoploss_on_exchange` and can use both stop-loss-market and stop-loss-limit orders. It provides great advantages, so we recommend to benefit from it.
|
||||||
|
You can use either `"limit"` or `"market"` in the `order_types.stoploss` configuration setting to decide.
|
||||||
|
|
||||||
|
|
||||||
|
### Using subaccounts
|
||||||
|
|
||||||
|
To use subaccounts with FTX, you need to edit the configuration and add the following:
|
||||||
|
|
||||||
|
``` json
|
||||||
|
"exchange": {
|
||||||
|
"ccxt_config": {
|
||||||
|
"headers": {
|
||||||
|
"FTX-SUBACCOUNT": "name"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
Older versions of freqtrade may require this key to be added to `"ccxt_async_config"` as well.
|
||||||
|
|
||||||
|
## All exchanges
|
||||||
|
|
||||||
|
Should you experience constant errors with Nonce (like `InvalidNonce`), it is best to regenerate the API keys. Resetting Nonce is difficult and it's usually easier to regenerate the API keys.
|
||||||
|
|
||||||
|
|
||||||
|
## Random notes for other exchanges
|
||||||
|
|
||||||
|
* The Ocean (exchange id: `theocean`) exchange uses Web3 functionality and requires `web3` python package to be installed:
|
||||||
|
```shell
|
||||||
|
$ pip3 install web3
|
||||||
|
```
|
||||||
|
|
||||||
|
### Getting latest price / Incomplete candles
|
||||||
|
|
||||||
|
Most exchanges return current incomplete candle via their OHLCV/klines API interface.
|
||||||
|
By default, Freqtrade assumes that incomplete candle is fetched from the exchange and removes the last candle assuming it's the incomplete candle.
|
||||||
|
|
||||||
|
Whether your exchange returns incomplete candles or not can be checked using [the helper script](developer.md#Incomplete-candles) from the Contributor documentation.
|
||||||
|
|
||||||
|
Due to the danger of repainting, Freqtrade does not allow you to use this incomplete candle.
|
||||||
|
|
||||||
|
However, if it is based on the need for the latest price for your strategy - then this requirement can be acquired using the [data provider](strategy-customization.md#possible-options-for-dataprovider) from within the strategy.
|
||||||
113
docs/faq.md
113
docs/faq.md
@@ -1,10 +1,14 @@
|
|||||||
# Freqtrade FAQ
|
# Freqtrade FAQ
|
||||||
|
|
||||||
|
## Beginner Tips & Tricks
|
||||||
|
|
||||||
|
* When you work with your strategy & hyperopt file you should use a proper code editor like vscode or Pycharm. A good code editor will provide syntax highlighting as well as line numbers, making it easy to find syntax errors (most likely, pointed out by Freqtrade during startup).
|
||||||
|
|
||||||
## Freqtrade common issues
|
## Freqtrade common issues
|
||||||
|
|
||||||
### The bot does not start
|
### The bot does not start
|
||||||
|
|
||||||
Running the bot with `freqtrade --config config.json` does show the output `freqtrade: command not found`.
|
Running the bot with `freqtrade trade --config config.json` does show the output `freqtrade: command not found`.
|
||||||
|
|
||||||
This could have the following reasons:
|
This could have the following reasons:
|
||||||
|
|
||||||
@@ -15,10 +19,12 @@ This could have the following reasons:
|
|||||||
|
|
||||||
### I have waited 5 minutes, why hasn't the bot made any trades yet?!
|
### I have waited 5 minutes, why hasn't the bot made any trades yet?!
|
||||||
|
|
||||||
Depending on the buy strategy, the amount of whitelisted coins, the
|
* Depending on the buy strategy, the amount of whitelisted coins, the
|
||||||
situation of the market etc, it can take up to hours to find good entry
|
situation of the market etc, it can take up to hours to find good entry
|
||||||
position for a trade. Be patient!
|
position for a trade. Be patient!
|
||||||
|
|
||||||
|
* Or it may because of a configuration error? Best check the logs, it's usually telling you if the bot is simply not getting buy signals (only heartbeat messages), or if there is something wrong (errors / exceptions in the log).
|
||||||
|
|
||||||
### I have made 12 trades already, why is my total profit negative?!
|
### I have made 12 trades already, why is my total profit negative?!
|
||||||
|
|
||||||
I understand your disappointment but unfortunately 12 trades is just
|
I understand your disappointment but unfortunately 12 trades is just
|
||||||
@@ -45,15 +51,79 @@ the tutorial [here|Testing-new-strategies-with-Hyperopt](bot-usage.md#hyperopt-c
|
|||||||
|
|
||||||
You can use the `/forcesell all` command from Telegram.
|
You can use the `/forcesell all` command from Telegram.
|
||||||
|
|
||||||
### I get the message "RESTRICTED_MARKET"
|
### I want to run multiple bots on the same machine
|
||||||
|
|
||||||
|
Please look at the [advanced setup documentation Page](advanced-setup.md#running-multiple-instances-of-freqtrade).
|
||||||
|
|
||||||
|
### I'm getting "Missing data fillup" messages in the log
|
||||||
|
|
||||||
|
This message is just a warning that the latest candles had missing candles in them.
|
||||||
|
Depending on the exchange, this can indicate that the pair didn't have a trade for the timeframe you are using - and the exchange does only return candles with volume.
|
||||||
|
On low volume pairs, this is a rather common occurance.
|
||||||
|
|
||||||
|
If this happens for all pairs in the pairlist, this might indicate a recent exchange downtime. Please check your exchange's public channels for details.
|
||||||
|
|
||||||
|
Irrespectively of the reason, Freqtrade will fill up these candles with "empty" candles, where open, high, low and close are set to the previous candle close - and volume is empty. In a chart, this will look like a `_` - and is aligned with how exchanges usually represent 0 volume candles.
|
||||||
|
|
||||||
|
### I'm getting the "RESTRICTED_MARKET" message in the log
|
||||||
|
|
||||||
Currently known to happen for US Bittrex users.
|
Currently known to happen for US Bittrex users.
|
||||||
Bittrex split its exchange into US and International versions.
|
|
||||||
The International version has more pairs available, however the API always returns all pairs, so there is currently no automated way to detect if you're affected by the restriction.
|
|
||||||
|
|
||||||
If you have restricted pairs in your whitelist, you'll get a warning message in the log on FreqTrade startup for each restricted pair.
|
Read [the Bittrex section about restricted markets](exchanges.md#restricted-markets) for more information.
|
||||||
If you're an "International" Customer on the Bittrex exchange, then this warning will probably not impact you.
|
|
||||||
If you're a US customer, the bot will fail to create orders for these pairs, and you should remove them from your Whitelist.
|
### I'm getting the "Exchange Bittrex does not support market orders." message and cannot run my strategy
|
||||||
|
|
||||||
|
As the message says, Bittrex does not support market orders and you have one of the [order types](configuration.md/#understand-order_types) set to "market". Probably your strategy was written with other exchanges in mind and sets "market" orders for "stoploss" orders, which is correct and preferable for most of the exchanges supporting market orders (but not for Bittrex).
|
||||||
|
|
||||||
|
To fix it for Bittrex, redefine order types in the strategy to use "limit" instead of "market":
|
||||||
|
|
||||||
|
```
|
||||||
|
order_types = {
|
||||||
|
...
|
||||||
|
'stoploss': 'limit',
|
||||||
|
...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Same fix should be done in the configuration file, if order types are defined in your custom config rather than in the strategy.
|
||||||
|
|
||||||
|
### How do I search the bot logs for something?
|
||||||
|
|
||||||
|
By default, the bot writes its log into stderr stream. This is implemented this way so that you can easily separate the bot's diagnostics messages from Backtesting, Edge and Hyperopt results, output from other various Freqtrade utility sub-commands, as well as from the output of your custom `print()`'s you may have inserted into your strategy. So if you need to search the log messages with the grep utility, you need to redirect stderr to stdout and disregard stdout.
|
||||||
|
|
||||||
|
* In unix shells, this normally can be done as simple as:
|
||||||
|
```shell
|
||||||
|
$ freqtrade --some-options 2>&1 >/dev/null | grep 'something'
|
||||||
|
```
|
||||||
|
(note, `2>&1` and `>/dev/null` should be written in this order)
|
||||||
|
|
||||||
|
* Bash interpreter also supports so called process substitution syntax, you can grep the log for a string with it as:
|
||||||
|
```shell
|
||||||
|
$ freqtrade --some-options 2> >(grep 'something') >/dev/null
|
||||||
|
```
|
||||||
|
or
|
||||||
|
```shell
|
||||||
|
$ freqtrade --some-options 2> >(grep -v 'something' 1>&2)
|
||||||
|
```
|
||||||
|
|
||||||
|
* You can also write the copy of Freqtrade log messages to a file with the `--logfile` option:
|
||||||
|
```shell
|
||||||
|
$ freqtrade --logfile /path/to/mylogfile.log --some-options
|
||||||
|
```
|
||||||
|
and then grep it as:
|
||||||
|
```shell
|
||||||
|
$ cat /path/to/mylogfile.log | grep 'something'
|
||||||
|
```
|
||||||
|
or even on the fly, as the bot works and the log file grows:
|
||||||
|
```shell
|
||||||
|
$ tail -f /path/to/mylogfile.log | grep 'something'
|
||||||
|
```
|
||||||
|
from a separate terminal window.
|
||||||
|
|
||||||
|
On Windows, the `--logfile` option is also supported by Freqtrade and you can use the `findstr` command to search the log for the string of interest:
|
||||||
|
```
|
||||||
|
> type \path\to\mylogfile.log | findstr "something"
|
||||||
|
```
|
||||||
|
|
||||||
## Hyperopt module
|
## Hyperopt module
|
||||||
|
|
||||||
@@ -65,25 +135,27 @@ to find a great result (unless if you are very lucky), so you probably
|
|||||||
have to run it for 10.000 or more. But it will take an eternity to
|
have to run it for 10.000 or more. But it will take an eternity to
|
||||||
compute.
|
compute.
|
||||||
|
|
||||||
We recommend you to run it at least 10.000 epochs:
|
Since hyperopt uses Bayesian search, running for too many epochs may not produce greater results.
|
||||||
|
|
||||||
|
It's therefore recommended to run between 500-1000 epochs over and over until you hit at least 10.000 epochs in total (or are satisfied with the result). You can best judge by looking at the results - if the bot keeps discovering better strategies, it's best to keep on going.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
freqtrade hyperopt -e 10000
|
freqtrade hyperopt -e 1000
|
||||||
```
|
```
|
||||||
|
|
||||||
or if you want intermediate result to see
|
or if you want intermediate result to see
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
for i in {1..100}; do freqtrade hyperopt -e 100; done
|
for i in {1..100}; do freqtrade hyperopt -e 1000; done
|
||||||
```
|
```
|
||||||
|
|
||||||
### Why it is so long to run hyperopt?
|
### Why does it take a long time to run hyperopt?
|
||||||
|
|
||||||
Finding a great Hyperopt results takes time.
|
* Discovering a great strategy with Hyperopt takes time. Study www.freqtrade.io, the Freqtrade Documentation page, join the Freqtrade [Slack community](https://join.slack.com/t/highfrequencybot/shared_invite/enQtNjU5ODcwNjI1MDU3LTU1MTgxMjkzNmYxNWE1MDEzYzQ3YmU4N2MwZjUyNjJjODRkMDVkNjg4YTAyZGYzYzlhOTZiMTE4ZjQ4YzM0OGE) - or the Freqtrade [discord community](https://discord.gg/X89cVG). While you patiently wait for the most advanced, free crypto bot in the world, to hand you a possible golden strategy specially designed just for you.
|
||||||
|
|
||||||
If you wonder why it takes a while to find great hyperopt results
|
* If you wonder why it can take from 20 minutes to days to do 1000 epochs here are some answers:
|
||||||
|
|
||||||
This answer was written during the under the release 0.15.1, when we had:
|
This answer was written during the release 0.15.1, when we had:
|
||||||
|
|
||||||
- 8 triggers
|
- 8 triggers
|
||||||
- 9 guards: let's say we evaluate even 10 values from each
|
- 9 guards: let's say we evaluate even 10 values from each
|
||||||
@@ -93,7 +165,14 @@ The following calculation is still very rough and not very precise
|
|||||||
but it will give the idea. With only these triggers and guards there is
|
but it will give the idea. With only these triggers and guards there is
|
||||||
already 8\*10^9\*10 evaluations. A roughly total of 80 billion evals.
|
already 8\*10^9\*10 evaluations. A roughly total of 80 billion evals.
|
||||||
Did you run 100 000 evals? Congrats, you've done roughly 1 / 100 000 th
|
Did you run 100 000 evals? Congrats, you've done roughly 1 / 100 000 th
|
||||||
of the search space.
|
of the search space, assuming that the bot never tests the same parameters more than once.
|
||||||
|
|
||||||
|
* The time it takes to run 1000 hyperopt epochs depends on things like: The available cpu, hard-disk, ram, timeframe, timerange, indicator settings, indicator count, amount of coins that hyperopt test strategies on and the resulting trade count - which can be 650 trades in a year or 10.0000 trades depending if the strategy aims for big profits by trading rarely or for many low profit trades.
|
||||||
|
|
||||||
|
Example: 4% profit 650 times vs 0,3% profit a trade 10.000 times in a year. If we assume you set the --timerange to 365 days.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
`freqtrade --config config.json --strategy SampleStrategy --hyperopt SampleHyperopt -e 1000 --timerange 20190601-20200601`
|
||||||
|
|
||||||
## Edge module
|
## Edge module
|
||||||
|
|
||||||
@@ -101,7 +180,7 @@ of the search space.
|
|||||||
|
|
||||||
The Edge module is mostly a result of brainstorming of [@mishaker](https://github.com/mishaker) and [@creslinux](https://github.com/creslinux) freqtrade team members.
|
The Edge module is mostly a result of brainstorming of [@mishaker](https://github.com/mishaker) and [@creslinux](https://github.com/creslinux) freqtrade team members.
|
||||||
|
|
||||||
You can find further info on expectancy, winrate, risk management and position size in the following sources:
|
You can find further info on expectancy, win rate, risk management and position size in the following sources:
|
||||||
|
|
||||||
- https://www.tradeciety.com/ultimate-math-guide-for-traders/
|
- https://www.tradeciety.com/ultimate-math-guide-for-traders/
|
||||||
- http://www.vantharp.com/tharp-concepts/expectancy.asp
|
- http://www.vantharp.com/tharp-concepts/expectancy.asp
|
||||||
|
|||||||
280
docs/hyperopt.md
280
docs/hyperopt.md
@@ -6,39 +6,82 @@ algorithms included in the `scikit-optimize` package to accomplish this. The
|
|||||||
search will burn all your CPU cores, make your laptop sound like a fighter jet
|
search will burn all your CPU cores, make your laptop sound like a fighter jet
|
||||||
and still take a long time.
|
and still take a long time.
|
||||||
|
|
||||||
|
In general, the search for best parameters starts with a few random combinations (see [below](#reproducible-results) for more details) and then uses Bayesian search with a ML regressor algorithm (currently ExtraTreesRegressor) to quickly find a combination of parameters in the search hyperspace that minimizes the value of the [loss function](#loss-functions).
|
||||||
|
|
||||||
Hyperopt requires historic data to be available, just as backtesting does.
|
Hyperopt requires historic data to be available, just as backtesting does.
|
||||||
To learn how to get data for the pairs and exchange you're interrested in, head over to the [Data Downloading](data-download.md) section of the documentation.
|
To learn how to get data for the pairs and exchange you're interested in, head over to the [Data Downloading](data-download.md) section of the documentation.
|
||||||
|
|
||||||
!!! Bug
|
!!! Bug
|
||||||
Hyperopt can crash when used with only 1 CPU Core as found out in [Issue #1133](https://github.com/freqtrade/freqtrade/issues/1133)
|
Hyperopt can crash when used with only 1 CPU Core as found out in [Issue #1133](https://github.com/freqtrade/freqtrade/issues/1133)
|
||||||
|
|
||||||
|
## Install hyperopt dependencies
|
||||||
|
|
||||||
|
Since Hyperopt dependencies are not needed to run the bot itself, are heavy, can not be easily built on some platforms (like Raspberry PI), they are not installed by default. Before you run Hyperopt, you need to install the corresponding dependencies, as described in this section below.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
Since Hyperopt is a resource intensive process, running it on a Raspberry Pi is not recommended nor supported.
|
||||||
|
|
||||||
|
### Docker
|
||||||
|
|
||||||
|
The docker-image includes hyperopt dependencies, no further action needed.
|
||||||
|
|
||||||
|
### Easy installation script (setup.sh) / Manual installation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
source .env/bin/activate
|
||||||
|
pip install -r requirements-hyperopt.txt
|
||||||
|
```
|
||||||
|
|
||||||
## Prepare Hyperopting
|
## Prepare Hyperopting
|
||||||
|
|
||||||
Before we start digging into Hyperopt, we recommend you to take a look at
|
Before we start digging into Hyperopt, we recommend you to take a look at
|
||||||
the sample hyperopt file located in [user_data/hyperopts/](https://github.com/freqtrade/freqtrade/blob/develop/user_data/hyperopts/sample_hyperopt.py).
|
the sample hyperopt file located in [user_data/hyperopts/](https://github.com/freqtrade/freqtrade/blob/develop/freqtrade/templates/sample_hyperopt.py).
|
||||||
|
|
||||||
Configuring hyperopt is similar to writing your own strategy, and many tasks will be similar and a lot of code can be copied across from the strategy.
|
Configuring hyperopt is similar to writing your own strategy, and many tasks will be similar and a lot of code can be copied across from the strategy.
|
||||||
|
|
||||||
|
The simplest way to get started is to use `freqtrade new-hyperopt --hyperopt AwesomeHyperopt`.
|
||||||
|
This will create a new hyperopt file from a template, which will be located under `user_data/hyperopts/AwesomeHyperopt.py`.
|
||||||
|
|
||||||
### Checklist on all tasks / possibilities in hyperopt
|
### Checklist on all tasks / possibilities in hyperopt
|
||||||
|
|
||||||
Depending on the space you want to optimize, only some of the below are required:
|
Depending on the space you want to optimize, only some of the below are required:
|
||||||
|
|
||||||
* fill `populate_indicators` - probably a copy from your strategy
|
|
||||||
* fill `buy_strategy_generator` - for buy signal optimization
|
* fill `buy_strategy_generator` - for buy signal optimization
|
||||||
* fill `indicator_space` - for buy signal optimzation
|
* fill `indicator_space` - for buy signal optimization
|
||||||
* fill `sell_strategy_generator` - for sell signal optimization
|
* fill `sell_strategy_generator` - for sell signal optimization
|
||||||
* fill `sell_indicator_space` - for sell signal optimzation
|
* fill `sell_indicator_space` - for sell signal optimization
|
||||||
|
|
||||||
Optional, but recommended:
|
!!! Note
|
||||||
|
`populate_indicators` needs to create all indicators any of thee spaces may use, otherwise hyperopt will not work.
|
||||||
|
|
||||||
|
Optional - can also be loaded from a strategy:
|
||||||
|
|
||||||
|
* copy `populate_indicators` from your strategy - otherwise default-strategy will be used
|
||||||
* copy `populate_buy_trend` from your strategy - otherwise default-strategy will be used
|
* copy `populate_buy_trend` from your strategy - otherwise default-strategy will be used
|
||||||
* copy `populate_sell_trend` from your strategy - otherwise default-strategy will be used
|
* copy `populate_sell_trend` from your strategy - otherwise default-strategy will be used
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
Assuming the optional methods are not in your hyperopt file, please use `--strategy AweSomeStrategy` which contains these methods so hyperopt can use these methods instead.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
You always have to provide a strategy to Hyperopt, even if your custom Hyperopt class contains all methods.
|
||||||
|
|
||||||
Rarely you may also need to override:
|
Rarely you may also need to override:
|
||||||
|
|
||||||
* `roi_space` - for custom ROI optimization (if you need the ranges for the ROI parameters in the optimization hyperspace that differ from default)
|
* `roi_space` - for custom ROI optimization (if you need the ranges for the ROI parameters in the optimization hyperspace that differ from default)
|
||||||
* `generate_roi_table` - for custom ROI optimization (if you need more than 4 entries in the ROI table)
|
* `generate_roi_table` - for custom ROI optimization (if you need the ranges for the values in the ROI table that differ from default or the number of entries (steps) in the ROI table which differs from the default 4 steps)
|
||||||
* `stoploss_space` - for custom stoploss optimization (if you need the range for the stoploss parameter in the optimization hyperspace that differs from default)
|
* `stoploss_space` - for custom stoploss optimization (if you need the range for the stoploss parameter in the optimization hyperspace that differs from default)
|
||||||
|
* `trailing_space` - for custom trailing stop optimization (if you need the ranges for the trailing stop parameters in the optimization hyperspace that differ from default)
|
||||||
|
|
||||||
|
!!! Tip "Quickly optimize ROI, stoploss and trailing stoploss"
|
||||||
|
You can quickly optimize the spaces `roi`, `stoploss` and `trailing` without changing anything (i.e. without creation of a "complete" Hyperopt class with dimensions, parameters, triggers and guards, as described in this document) from the default hyperopt template by relying on your strategy to do most of the calculations.
|
||||||
|
|
||||||
|
```python
|
||||||
|
# Have a working strategy at hand.
|
||||||
|
freqtrade new-hyperopt --hyperopt EmptyHyperopt
|
||||||
|
|
||||||
|
freqtrade hyperopt --hyperopt EmptyHyperopt --spaces roi stoploss trailing --strategy MyWorkingStrategy --config config.json -e 100
|
||||||
|
```
|
||||||
|
|
||||||
### 1. Install a Custom Hyperopt File
|
### 1. Install a Custom Hyperopt File
|
||||||
|
|
||||||
@@ -51,17 +94,17 @@ Copy the file `user_data/hyperopts/sample_hyperopt.py` into `user_data/hyperopts
|
|||||||
|
|
||||||
There are two places you need to change in your hyperopt file to add a new buy hyperopt for testing:
|
There are two places you need to change in your hyperopt file to add a new buy hyperopt for testing:
|
||||||
|
|
||||||
- Inside `indicator_space()` - the parameters hyperopt shall be optimizing.
|
* Inside `indicator_space()` - the parameters hyperopt shall be optimizing.
|
||||||
- Inside `populate_buy_trend()` - applying the parameters.
|
* Inside `populate_buy_trend()` - applying the parameters.
|
||||||
|
|
||||||
There you have two different types of indicators: 1. `guards` and 2. `triggers`.
|
There you have two different types of indicators: 1. `guards` and 2. `triggers`.
|
||||||
|
|
||||||
1. Guards are conditions like "never buy if ADX < 10", or never buy if current price is over EMA10.
|
1. Guards are conditions like "never buy if ADX < 10", or never buy if current price is over EMA10.
|
||||||
2. Triggers are ones that actually trigger buy in specific moment, like "buy when EMA5 crosses over EMA10" or "buy when close price touches lower bollinger band".
|
2. Triggers are ones that actually trigger buy in specific moment, like "buy when EMA5 crosses over EMA10" or "buy when close price touches lower Bollinger band".
|
||||||
|
|
||||||
Hyperoptimization will, for each eval round, pick one trigger and possibly
|
Hyperoptimization will, for each eval round, pick one trigger and possibly
|
||||||
multiple guards. The constructed strategy will be something like
|
multiple guards. The constructed strategy will be something like
|
||||||
"*buy exactly when close price touches lower bollinger band, BUT only if
|
"*buy exactly when close price touches lower Bollinger band, BUT only if
|
||||||
ADX > 10*".
|
ADX > 10*".
|
||||||
|
|
||||||
If you have updated the buy strategy, i.e. changed the contents of
|
If you have updated the buy strategy, i.e. changed the contents of
|
||||||
@@ -79,10 +122,11 @@ Place the corresponding settings into the following methods
|
|||||||
The configuration and rules are the same than for buy signals.
|
The configuration and rules are the same than for buy signals.
|
||||||
To avoid naming collisions in the search-space, please prefix all sell-spaces with `sell-`.
|
To avoid naming collisions in the search-space, please prefix all sell-spaces with `sell-`.
|
||||||
|
|
||||||
#### Using ticker-interval as part of the Strategy
|
#### Using timeframe as a part of the Strategy
|
||||||
|
|
||||||
The Strategy exposes the ticker-interval as `self.ticker_interval`. The same value is available as class-attribute `HyperoptName.ticker_interval`.
|
The Strategy class exposes the timeframe value as the `self.timeframe` attribute.
|
||||||
In the case of the linked sample-value this would be `SampleHyperOpt.ticker_interval`.
|
The same value is available as class-attribute `HyperoptName.timeframe`.
|
||||||
|
In the case of the linked sample-value this would be `SampleHyperOpt.timeframe`.
|
||||||
|
|
||||||
## Solving a Mystery
|
## Solving a Mystery
|
||||||
|
|
||||||
@@ -117,7 +161,7 @@ one we call `trigger` and use it to decide which buy trigger we want to use.
|
|||||||
|
|
||||||
So let's write the buy strategy using these values:
|
So let's write the buy strategy using these values:
|
||||||
|
|
||||||
``` python
|
```python
|
||||||
def populate_buy_trend(dataframe: DataFrame) -> DataFrame:
|
def populate_buy_trend(dataframe: DataFrame) -> DataFrame:
|
||||||
conditions = []
|
conditions = []
|
||||||
# GUARDS AND TRENDS
|
# GUARDS AND TRENDS
|
||||||
@@ -135,6 +179,9 @@ So let's write the buy strategy using these values:
|
|||||||
dataframe['macd'], dataframe['macdsignal']
|
dataframe['macd'], dataframe['macdsignal']
|
||||||
))
|
))
|
||||||
|
|
||||||
|
# Check that volume is not 0
|
||||||
|
conditions.append(dataframe['volume'] > 0)
|
||||||
|
|
||||||
if conditions:
|
if conditions:
|
||||||
dataframe.loc[
|
dataframe.loc[
|
||||||
reduce(lambda x, y: x & y, conditions),
|
reduce(lambda x, y: x & y, conditions),
|
||||||
@@ -148,21 +195,17 @@ So let's write the buy strategy using these values:
|
|||||||
Hyperopting will now call this `populate_buy_trend` as many times you ask it (`epochs`)
|
Hyperopting will now call this `populate_buy_trend` as many times you ask it (`epochs`)
|
||||||
with different value combinations. It will then use the given historical data and make
|
with different value combinations. It will then use the given historical data and make
|
||||||
buys based on the buy signals generated with the above function and based on the results
|
buys based on the buy signals generated with the above function and based on the results
|
||||||
it will end with telling you which paramter combination produced the best profits.
|
it will end with telling you which parameter combination produced the best profits.
|
||||||
|
|
||||||
The search for best parameters starts with a few random combinations and then uses a
|
|
||||||
regressor algorithm (currently ExtraTreesRegressor) to quickly find a parameter combination
|
|
||||||
that minimizes the value of the [loss function](#loss-functions).
|
|
||||||
|
|
||||||
The above setup expects to find ADX, RSI and Bollinger Bands in the populated indicators.
|
The above setup expects to find ADX, RSI and Bollinger Bands in the populated indicators.
|
||||||
When you want to test an indicator that isn't used by the bot currently, remember to
|
When you want to test an indicator that isn't used by the bot currently, remember to
|
||||||
add it to the `populate_indicators()` method in `hyperopt.py`.
|
add it to the `populate_indicators()` method in your custom hyperopt file.
|
||||||
|
|
||||||
## Loss-functions
|
## Loss-functions
|
||||||
|
|
||||||
Each hyperparameter tuning requires a target. This is usually defined as a loss function (sometimes also called objective function), which should decrease for more desirable results, and increase for bad results.
|
Each hyperparameter tuning requires a target. This is usually defined as a loss function (sometimes also called objective function), which should decrease for more desirable results, and increase for bad results.
|
||||||
|
|
||||||
By default, FreqTrade uses a loss function, which has been with freqtrade since the beginning and optimizes mostly for short trade duration and avoiding losses.
|
By default, Freqtrade uses a loss function, which has been with freqtrade since the beginning and optimizes mostly for short trade duration and avoiding losses.
|
||||||
|
|
||||||
A different loss function can be specified by using the `--hyperopt-loss <Class-name>` argument.
|
A different loss function can be specified by using the `--hyperopt-loss <Class-name>` argument.
|
||||||
This class should be in its own file within the `user_data/hyperopts/` directory.
|
This class should be in its own file within the `user_data/hyperopts/` directory.
|
||||||
@@ -171,65 +214,12 @@ Currently, the following loss functions are builtin:
|
|||||||
|
|
||||||
* `DefaultHyperOptLoss` (default legacy Freqtrade hyperoptimization loss function)
|
* `DefaultHyperOptLoss` (default legacy Freqtrade hyperoptimization loss function)
|
||||||
* `OnlyProfitHyperOptLoss` (which takes only amount of profit into consideration)
|
* `OnlyProfitHyperOptLoss` (which takes only amount of profit into consideration)
|
||||||
* `SharpeHyperOptLoss` (optimizes Sharpe Ratio calculated on the trade returns)
|
* `SharpeHyperOptLoss` (optimizes Sharpe Ratio calculated on trade returns relative to standard deviation)
|
||||||
|
* `SharpeHyperOptLossDaily` (optimizes Sharpe Ratio calculated on **daily** trade returns relative to standard deviation)
|
||||||
|
* `SortinoHyperOptLoss` (optimizes Sortino Ratio calculated on trade returns relative to **downside** standard deviation)
|
||||||
|
* `SortinoHyperOptLossDaily` (optimizes Sortino Ratio calculated on **daily** trade returns relative to **downside** standard deviation)
|
||||||
|
|
||||||
### Creating and using a custom loss function
|
Creation of a custom loss function is covered in the [Advanced Hyperopt](advanced-hyperopt.md) part of the documentation.
|
||||||
|
|
||||||
To use a custom loss function class, make sure that the function `hyperopt_loss_function` is defined in your custom hyperopt loss class.
|
|
||||||
For the sample below, you then need to add the command line parameter `--hyperopt-loss SuperDuperHyperOptLoss` to your hyperopt call so this fuction is being used.
|
|
||||||
|
|
||||||
A sample of this can be found below, which is identical to the Default Hyperopt loss implementation. A full sample can be found [user_data/hyperopts/](https://github.com/freqtrade/freqtrade/blob/develop/user_data/hyperopts/sample_hyperopt_loss.py)
|
|
||||||
|
|
||||||
``` python
|
|
||||||
from freqtrade.optimize.hyperopt import IHyperOptLoss
|
|
||||||
|
|
||||||
TARGET_TRADES = 600
|
|
||||||
EXPECTED_MAX_PROFIT = 3.0
|
|
||||||
MAX_ACCEPTED_TRADE_DURATION = 300
|
|
||||||
|
|
||||||
class SuperDuperHyperOptLoss(IHyperOptLoss):
|
|
||||||
"""
|
|
||||||
Defines the default loss function for hyperopt
|
|
||||||
"""
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def hyperopt_loss_function(results: DataFrame, trade_count: int,
|
|
||||||
min_date: datetime, max_date: datetime,
|
|
||||||
*args, **kwargs) -> float:
|
|
||||||
"""
|
|
||||||
Objective function, returns smaller number for better results
|
|
||||||
This is the legacy algorithm (used until now in freqtrade).
|
|
||||||
Weights are distributed as follows:
|
|
||||||
* 0.4 to trade duration
|
|
||||||
* 0.25: Avoiding trade loss
|
|
||||||
* 1.0 to total profit, compared to the expected value (`EXPECTED_MAX_PROFIT`) defined above
|
|
||||||
"""
|
|
||||||
total_profit = results.profit_percent.sum()
|
|
||||||
trade_duration = results.trade_duration.mean()
|
|
||||||
|
|
||||||
trade_loss = 1 - 0.25 * exp(-(trade_count - TARGET_TRADES) ** 2 / 10 ** 5.8)
|
|
||||||
profit_loss = max(0, 1 - total_profit / EXPECTED_MAX_PROFIT)
|
|
||||||
duration_loss = 0.4 * min(trade_duration / MAX_ACCEPTED_TRADE_DURATION, 1)
|
|
||||||
result = trade_loss + profit_loss + duration_loss
|
|
||||||
return result
|
|
||||||
```
|
|
||||||
|
|
||||||
Currently, the arguments are:
|
|
||||||
|
|
||||||
* `results`: DataFrame containing the result
|
|
||||||
The following columns are available in results (corresponds to the output-file of backtesting when used with `--export trades`):
|
|
||||||
`pair, profit_percent, profit_abs, open_time, close_time, open_index, close_index, trade_duration, open_at_end, open_rate, close_rate, sell_reason`
|
|
||||||
* `trade_count`: Amount of trades (identical to `len(results)`)
|
|
||||||
* `min_date`: Start date of the hyperopting TimeFrame
|
|
||||||
* `min_date`: End date of the hyperopting TimeFrame
|
|
||||||
|
|
||||||
This function needs to return a floating point number (`float`). Smaller numbers will be interpreted as better results. The parameters and balancing for this is up to you.
|
|
||||||
|
|
||||||
!!! Note
|
|
||||||
This function is called once per iteration - so please make sure to have this as optimized as possible to not slow hyperopt down unnecessarily.
|
|
||||||
|
|
||||||
!!! Note
|
|
||||||
Please keep the arguments `*args` and `**kwargs` in the interface to allow us to extend this interface later.
|
|
||||||
|
|
||||||
## Execute Hyperopt
|
## Execute Hyperopt
|
||||||
|
|
||||||
@@ -239,15 +229,15 @@ Because hyperopt tries a lot of combinations to find the best parameters it will
|
|||||||
We strongly recommend to use `screen` or `tmux` to prevent any connection loss.
|
We strongly recommend to use `screen` or `tmux` to prevent any connection loss.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
freqtrade -c config.json hyperopt --customhyperopt <hyperoptname> -e 5000 --spaces all
|
freqtrade hyperopt --config config.json --hyperopt <hyperoptname> -e 500 --spaces all
|
||||||
```
|
```
|
||||||
|
|
||||||
Use `<hyperoptname>` as the name of the custom hyperopt used.
|
Use `<hyperoptname>` as the name of the custom hyperopt used.
|
||||||
|
|
||||||
The `-e` flag will set how many evaluations hyperopt will do. We recommend
|
The `-e` option will set how many evaluations hyperopt will do. We recommend
|
||||||
running at least several thousand evaluations.
|
running at least several thousand evaluations.
|
||||||
|
|
||||||
The `--spaces all` flag determines that all possible parameters should be optimized. Possibilities are listed below.
|
The `--spaces all` option determines that all possible parameters should be optimized. Possibilities are listed below.
|
||||||
|
|
||||||
!!! Note
|
!!! Note
|
||||||
By default, hyperopt will erase previous results and start from scratch. Continuation can be archived by using `--continue`.
|
By default, hyperopt will erase previous results and start from scratch. Continuation can be archived by using `--continue`.
|
||||||
@@ -255,11 +245,11 @@ The `--spaces all` flag determines that all possible parameters should be optimi
|
|||||||
!!! Warning
|
!!! Warning
|
||||||
When switching parameters or changing configuration options, make sure to not use the argument `--continue` so temporary results can be removed.
|
When switching parameters or changing configuration options, make sure to not use the argument `--continue` so temporary results can be removed.
|
||||||
|
|
||||||
### Execute Hyperopt with Different Ticker-Data Source
|
### Execute Hyperopt with different historical data source
|
||||||
|
|
||||||
If you would like to hyperopt parameters using an alternate ticker data that
|
If you would like to hyperopt parameters using an alternate historical data set that
|
||||||
you have on-disk, use the `--datadir PATH` option. Default hyperopt will
|
you have on-disk, use the `--datadir PATH` option. By default, hyperopt
|
||||||
use data from directory `user_data/data`.
|
uses data from directory `user_data/data`.
|
||||||
|
|
||||||
### Running Hyperopt with Smaller Testset
|
### Running Hyperopt with Smaller Testset
|
||||||
|
|
||||||
@@ -270,9 +260,17 @@ For example, to use one month of data, pass the following parameter to the hyper
|
|||||||
freqtrade hyperopt --timerange 20180401-20180501
|
freqtrade hyperopt --timerange 20180401-20180501
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Running Hyperopt using methods from a strategy
|
||||||
|
|
||||||
|
Hyperopt can reuse `populate_indicators`, `populate_buy_trend`, `populate_sell_trend` from your strategy, assuming these methods are **not** in your custom hyperopt file, and a strategy is provided.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
freqtrade hyperopt --strategy SampleStrategy --hyperopt SampleHyperopt
|
||||||
|
```
|
||||||
|
|
||||||
### Running Hyperopt with Smaller Search Space
|
### Running Hyperopt with Smaller Search Space
|
||||||
|
|
||||||
Use the `--spaces` argument to limit the search space used by hyperopt.
|
Use the `--spaces` option to limit the search space used by hyperopt.
|
||||||
Letting Hyperopt optimize everything is a huuuuge search space. Often it
|
Letting Hyperopt optimize everything is a huuuuge search space. Often it
|
||||||
might make more sense to start by just searching for initial buy algorithm.
|
might make more sense to start by just searching for initial buy algorithm.
|
||||||
Or maybe you just want to optimize your stoploss or roi table for that awesome
|
Or maybe you just want to optimize your stoploss or roi table for that awesome
|
||||||
@@ -285,8 +283,12 @@ Legal values are:
|
|||||||
* `sell`: just search for a new sell strategy
|
* `sell`: just search for a new sell strategy
|
||||||
* `roi`: just optimize the minimal profit table for your strategy
|
* `roi`: just optimize the minimal profit table for your strategy
|
||||||
* `stoploss`: search for the best stoploss value
|
* `stoploss`: search for the best stoploss value
|
||||||
|
* `trailing`: search for the best trailing stop values
|
||||||
|
* `default`: `all` except `trailing`
|
||||||
* space-separated list of any of the above values for example `--spaces roi stoploss`
|
* space-separated list of any of the above values for example `--spaces roi stoploss`
|
||||||
|
|
||||||
|
The default Hyperopt Search Space, used when no `--space` command line option is specified, does not include the `trailing` hyperspace. We recommend you to run optimization for the `trailing` hyperspace separately, when the best parameters for other hyperspaces were found, validated and pasted into your custom strategy.
|
||||||
|
|
||||||
### Position stacking and disabling max market positions
|
### Position stacking and disabling max market positions
|
||||||
|
|
||||||
In some situations, you may need to run Hyperopt (and Backtesting) with the
|
In some situations, you may need to run Hyperopt (and Backtesting) with the
|
||||||
@@ -295,7 +297,7 @@ In some situations, you may need to run Hyperopt (and Backtesting) with the
|
|||||||
By default, hyperopt emulates the behavior of the Freqtrade Live Run/Dry Run, where only one
|
By default, hyperopt emulates the behavior of the Freqtrade Live Run/Dry Run, where only one
|
||||||
open trade is allowed for every traded pair. The total number of trades open for all pairs
|
open trade is allowed for every traded pair. The total number of trades open for all pairs
|
||||||
is also limited by the `max_open_trades` setting. During Hyperopt/Backtesting this may lead to
|
is also limited by the `max_open_trades` setting. During Hyperopt/Backtesting this may lead to
|
||||||
some potential trades to be hidden (or masked) by previosly open trades.
|
some potential trades to be hidden (or masked) by previously open trades.
|
||||||
|
|
||||||
The `--eps`/`--enable-position-stacking` argument allows emulation of buying the same pair multiple times,
|
The `--eps`/`--enable-position-stacking` argument allows emulation of buying the same pair multiple times,
|
||||||
while `--dmmp`/`--disable-max-market-positions` disables applying `max_open_trades`
|
while `--dmmp`/`--disable-max-market-positions` disables applying `max_open_trades`
|
||||||
@@ -308,6 +310,16 @@ number).
|
|||||||
You can also enable position stacking in the configuration file by explicitly setting
|
You can also enable position stacking in the configuration file by explicitly setting
|
||||||
`"position_stacking"=true`.
|
`"position_stacking"=true`.
|
||||||
|
|
||||||
|
### Reproducible results
|
||||||
|
|
||||||
|
The search for optimal parameters starts with a few (currently 30) random combinations in the hyperspace of parameters, random Hyperopt epochs. These random epochs are marked with an asterisk character (`*`) in the first column in the Hyperopt output.
|
||||||
|
|
||||||
|
The initial state for generation of these random values (random state) is controlled by the value of the `--random-state` command line option. You can set it to some arbitrary value of your choice to obtain reproducible results.
|
||||||
|
|
||||||
|
If you have not set this value explicitly in the command line options, Hyperopt seeds the random state with some random value for you. The random state value for each Hyperopt run is shown in the log, so you can copy and paste it into the `--random-state` command line option to repeat the set of the initial random epochs used.
|
||||||
|
|
||||||
|
If you have not changed anything in the command line options, configuration, timerange, Strategy and Hyperopt classes, historical data and the Loss Function -- you should obtain same hyperoptimization results with same random state value used.
|
||||||
|
|
||||||
## Understand the Hyperopt Result
|
## Understand the Hyperopt Result
|
||||||
|
|
||||||
Once Hyperopt is completed you can use the result to create a new strategy.
|
Once Hyperopt is completed you can use the result to create a new strategy.
|
||||||
@@ -337,12 +349,11 @@ method, what those values match to.
|
|||||||
|
|
||||||
So for example you had `rsi-value: 29.0` so we would look at `rsi`-block, that translates to the following code block:
|
So for example you had `rsi-value: 29.0` so we would look at `rsi`-block, that translates to the following code block:
|
||||||
|
|
||||||
``` python
|
```python
|
||||||
(dataframe['rsi'] < 29.0)
|
(dataframe['rsi'] < 29.0)
|
||||||
```
|
```
|
||||||
|
|
||||||
Translating your whole hyperopt result as the new buy-signal
|
Translating your whole hyperopt result as the new buy-signal would then look like:
|
||||||
would then look like:
|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
def populate_buy_trend(self, dataframe: DataFrame) -> DataFrame:
|
def populate_buy_trend(self, dataframe: DataFrame) -> DataFrame:
|
||||||
@@ -359,21 +370,18 @@ By default, hyperopt prints colorized results -- epochs with positive profit are
|
|||||||
|
|
||||||
You can use the `--print-all` command line option if you would like to see all results in the hyperopt output, not only the best ones. When `--print-all` is used, current best results are also colorized by default -- they are printed in bold (bright) style. This can also be switched off with the `--no-color` command line option.
|
You can use the `--print-all` command line option if you would like to see all results in the hyperopt output, not only the best ones. When `--print-all` is used, current best results are also colorized by default -- they are printed in bold (bright) style. This can also be switched off with the `--no-color` command line option.
|
||||||
|
|
||||||
|
!!! Note "Windows and color output"
|
||||||
|
Windows does not support color-output nativly, therefore it is automatically disabled. To have color-output for hyperopt running under windows, please consider using WSL.
|
||||||
|
|
||||||
### Understand Hyperopt ROI results
|
### Understand Hyperopt ROI results
|
||||||
|
|
||||||
If you are optimizing ROI (i.e. if optimization search-space contains 'all' or 'roi'), your result will look as follows and include a ROI table:
|
If you are optimizing ROI (i.e. if optimization search-space contains 'all', 'default' or 'roi'), your result will look as follows and include a ROI table:
|
||||||
|
|
||||||
```
|
```
|
||||||
Best result:
|
Best result:
|
||||||
|
|
||||||
44/100: 135 trades. Avg profit 0.57%. Total profit 0.03871918 BTC (0.7722Σ%). Avg duration 180.4 mins. Objective: 1.94367
|
44/100: 135 trades. Avg profit 0.57%. Total profit 0.03871918 BTC (0.7722Σ%). Avg duration 180.4 mins. Objective: 1.94367
|
||||||
|
|
||||||
Buy hyperspace params:
|
|
||||||
{ 'adx-value': 44,
|
|
||||||
'rsi-value': 29,
|
|
||||||
'adx-enabled': False,
|
|
||||||
'rsi-enabled': True,
|
|
||||||
'trigger': 'bb_lower'}
|
|
||||||
ROI table:
|
ROI table:
|
||||||
{ 0: 0.10674,
|
{ 0: 0.10674,
|
||||||
21: 0.09158,
|
21: 0.09158,
|
||||||
@@ -393,28 +401,29 @@ In order to use this best ROI table found by Hyperopt in backtesting and for liv
|
|||||||
118: 0
|
118: 0
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
As stated in the comment, you can also use it as the value of the `minimal_roi` setting in the configuration file.
|
As stated in the comment, you can also use it as the value of the `minimal_roi` setting in the configuration file.
|
||||||
|
|
||||||
#### Default ROI Search Space
|
#### Default ROI Search Space
|
||||||
|
|
||||||
If you are optimizing ROI, Freqtrade creates the 'roi' optimization hyperspace for you -- it's the hyperspace of components for the ROI tables. By default, each ROI table generated by the Freqtrade consists of 4 rows (steps). Hyperopt implements adaptive ranges for ROI tables with ranges for values in the ROI steps that depend on the ticker_interval used. By default the values can vary in the following ranges (for some of the most used ticker intervals, values are rounded to 5 digits after the decimal point):
|
If you are optimizing ROI, Freqtrade creates the 'roi' optimization hyperspace for you -- it's the hyperspace of components for the ROI tables. By default, each ROI table generated by the Freqtrade consists of 4 rows (steps). Hyperopt implements adaptive ranges for ROI tables with ranges for values in the ROI steps that depend on the timeframe used. By default the values vary in the following ranges (for some of the most used timeframes, values are rounded to 5 digits after the decimal point):
|
||||||
|
|
||||||
| # step | 1m | | 5m | | 1h | | 1d | |
|
| # step | 1m | | 5m | | 1h | | 1d | |
|
||||||
|---|---|---|---|---|---|---|---|---|
|
| ------ | ------ | ----------------- | -------- | ----------- | ---------- | ----------------- | ------------ | ----------------- |
|
||||||
| 1 | 0 | 0.01161...0.11992 | 0 | 0.03...0.31 | 0 | 0.06883...0.71124 | 0 | 0.12178...1.25835 |
|
| 1 | 0 | 0.01161...0.11992 | 0 | 0.03...0.31 | 0 | 0.06883...0.71124 | 0 | 0.12178...1.25835 |
|
||||||
| 2 | 2...8 | 0.00774...0.04255 | 10...40 | 0.02...0.11 | 120...480 | 0.04589...0.25238 | 2880...11520 | 0.08118...0.44651 |
|
| 2 | 2...8 | 0.00774...0.04255 | 10...40 | 0.02...0.11 | 120...480 | 0.04589...0.25238 | 2880...11520 | 0.08118...0.44651 |
|
||||||
| 3 | 4...20 | 0.00387...0.01547 | 20...100 | 0.01...0.04 | 240...1200 | 0.02294...0.09177 | 5760...28800 | 0.04059...0.16237 |
|
| 3 | 4...20 | 0.00387...0.01547 | 20...100 | 0.01...0.04 | 240...1200 | 0.02294...0.09177 | 5760...28800 | 0.04059...0.16237 |
|
||||||
| 4 | 6...44 | 0.0 | 30...220 | 0.0 | 360...2640 | 0.0 | 8640...63360 | 0.0 |
|
| 4 | 6...44 | 0.0 | 30...220 | 0.0 | 360...2640 | 0.0 | 8640...63360 | 0.0 |
|
||||||
|
|
||||||
These ranges should be sufficient in most cases. The minutes in the steps (ROI dict keys) are scaled linearly depending on the ticker interval used. The ROI values in the steps (ROI dict values) are scaled logarithmically depending on the ticker interval used.
|
These ranges should be sufficient in most cases. The minutes in the steps (ROI dict keys) are scaled linearly depending on the timeframe used. The ROI values in the steps (ROI dict values) are scaled logarithmically depending on the timeframe used.
|
||||||
|
|
||||||
If you have the `generate_roi_table()` and `roi_space()` methods in your custom hyperopt file, remove them in order to utilize these adaptive ROI tables and the ROI hyperoptimization space generated by Freqtrade by default.
|
If you have the `generate_roi_table()` and `roi_space()` methods in your custom hyperopt file, remove them in order to utilize these adaptive ROI tables and the ROI hyperoptimization space generated by Freqtrade by default.
|
||||||
|
|
||||||
Override the `roi_space()` method if you need components of the ROI tables to vary in other ranges. Override the `generate_roi_table()` and `roi_space()` methods and implement your own custom approach for generation of the ROI tables during hyperoptimization if you need a different structure of the ROI tables or other amount of rows (steps). A sample for these methods can be found in [user_data/hyperopts/sample_hyperopt_advanced.py](https://github.com/freqtrade/freqtrade/blob/develop/user_data/hyperopts/sample_hyperopt_advanced.py).
|
Override the `roi_space()` method if you need components of the ROI tables to vary in other ranges. Override the `generate_roi_table()` and `roi_space()` methods and implement your own custom approach for generation of the ROI tables during hyperoptimization if you need a different structure of the ROI tables or other amount of rows (steps). A sample for these methods can be found in [user_data/hyperopts/sample_hyperopt_advanced.py](https://github.com/freqtrade/freqtrade/blob/develop/freqtrade/templates/sample_hyperopt_advanced.py).
|
||||||
|
|
||||||
### Understand Hyperopt Stoploss results
|
### Understand Hyperopt Stoploss results
|
||||||
|
|
||||||
If you are optimizing stoploss values (i.e. if optimization search-space contains 'all' or 'stoploss'), your result will look as follows and include stoploss:
|
If you are optimizing stoploss values (i.e. if optimization search-space contains 'all', 'default' or 'stoploss'), your result will look as follows and include stoploss:
|
||||||
|
|
||||||
```
|
```
|
||||||
Best result:
|
Best result:
|
||||||
@@ -437,23 +446,58 @@ In order to use this best stoploss value found by Hyperopt in backtesting and fo
|
|||||||
# This attribute will be overridden if the config file contains "stoploss"
|
# This attribute will be overridden if the config file contains "stoploss"
|
||||||
stoploss = -0.27996
|
stoploss = -0.27996
|
||||||
```
|
```
|
||||||
|
|
||||||
As stated in the comment, you can also use it as the value of the `stoploss` setting in the configuration file.
|
As stated in the comment, you can also use it as the value of the `stoploss` setting in the configuration file.
|
||||||
|
|
||||||
#### Default Stoploss Search Space
|
#### Default Stoploss Search Space
|
||||||
|
|
||||||
If you are optimizing stoploss values, Freqtrade creates the 'stoploss' optimization hyperspace for you. By default, the stoploss values in that hyperspace can vary in the range -0.35...-0.02, which is sufficient in most cases.
|
If you are optimizing stoploss values, Freqtrade creates the 'stoploss' optimization hyperspace for you. By default, the stoploss values in that hyperspace vary in the range -0.35...-0.02, which is sufficient in most cases.
|
||||||
|
|
||||||
If you have the `stoploss_space()` method in your custom hyperopt file, remove it in order to utilize Stoploss hyperoptimization space generated by Freqtrade by default.
|
If you have the `stoploss_space()` method in your custom hyperopt file, remove it in order to utilize Stoploss hyperoptimization space generated by Freqtrade by default.
|
||||||
|
|
||||||
Override the `stoploss_space()` method and define the desired range in it if you need stoploss values to vary in other range during hyperoptimization. A sample for this method can be found in [user_data/hyperopts/sample_hyperopt_advanced.py](https://github.com/freqtrade/freqtrade/blob/develop/user_data/hyperopts/sample_hyperopt_advanced.py).
|
Override the `stoploss_space()` method and define the desired range in it if you need stoploss values to vary in other range during hyperoptimization. A sample for this method can be found in [user_data/hyperopts/sample_hyperopt_advanced.py](https://github.com/freqtrade/freqtrade/blob/develop/freqtrade/templates/sample_hyperopt_advanced.py).
|
||||||
|
|
||||||
### Validate backtesting results
|
### Understand Hyperopt Trailing Stop results
|
||||||
|
|
||||||
|
If you are optimizing trailing stop values (i.e. if optimization search-space contains 'all' or 'trailing'), your result will look as follows and include trailing stop parameters:
|
||||||
|
|
||||||
|
```
|
||||||
|
Best result:
|
||||||
|
|
||||||
|
45/100: 606 trades. Avg profit 1.04%. Total profit 0.31555614 BTC ( 630.48Σ%). Avg duration 150.3 mins. Objective: -1.10161
|
||||||
|
|
||||||
|
Trailing stop:
|
||||||
|
{ 'trailing_only_offset_is_reached': True,
|
||||||
|
'trailing_stop': True,
|
||||||
|
'trailing_stop_positive': 0.02001,
|
||||||
|
'trailing_stop_positive_offset': 0.06038}
|
||||||
|
```
|
||||||
|
|
||||||
|
In order to use these best trailing stop parameters found by Hyperopt in backtesting and for live trades/dry-run, copy-paste them as the values of the corresponding attributes of your custom strategy:
|
||||||
|
|
||||||
|
```
|
||||||
|
# Trailing stop
|
||||||
|
# These attributes will be overridden if the config file contains corresponding values.
|
||||||
|
trailing_stop = True
|
||||||
|
trailing_stop_positive = 0.02001
|
||||||
|
trailing_stop_positive_offset = 0.06038
|
||||||
|
trailing_only_offset_is_reached = True
|
||||||
|
```
|
||||||
|
|
||||||
|
As stated in the comment, you can also use it as the values of the corresponding settings in the configuration file.
|
||||||
|
|
||||||
|
#### Default Trailing Stop Search Space
|
||||||
|
|
||||||
|
If you are optimizing trailing stop values, Freqtrade creates the 'trailing' optimization hyperspace for you. By default, the `trailing_stop` parameter is always set to True in that hyperspace, the value of the `trailing_only_offset_is_reached` vary between True and False, the values of the `trailing_stop_positive` and `trailing_stop_positive_offset` parameters vary in the ranges 0.02...0.35 and 0.01...0.1 correspondingly, which is sufficient in most cases.
|
||||||
|
|
||||||
|
Override the `trailing_space()` method and define the desired range in it if you need values of the trailing stop parameters to vary in other ranges during hyperoptimization. A sample for this method can be found in [user_data/hyperopts/sample_hyperopt_advanced.py](https://github.com/freqtrade/freqtrade/blob/develop/freqtrade/templates/sample_hyperopt_advanced.py).
|
||||||
|
|
||||||
|
## Show details of Hyperopt results
|
||||||
|
|
||||||
|
After you run Hyperopt for the desired amount of epochs, you can later list all results for analysis, select only best or profitable once, and show the details for any of the epochs previously evaluated. This can be done with the `hyperopt-list` and `hyperopt-show` subcommands. The usage of these subcommands is described in the [Utils](utils.md#list-hyperopt-results) chapter.
|
||||||
|
|
||||||
|
## Validate backtesting results
|
||||||
|
|
||||||
Once the optimized strategy has been implemented into your strategy, you should backtest this strategy to make sure everything is working as expected.
|
Once the optimized strategy has been implemented into your strategy, you should backtest this strategy to make sure everything is working as expected.
|
||||||
|
|
||||||
To achieve same results (number of trades, their durations, profit, etc.) than during Hyperopt, please use same set of arguments `--dmmp`/`--disable-max-market-positions` and `--eps`/`--enable-position-stacking` for Backtesting.
|
To achieve same results (number of trades, their durations, profit, etc.) than during Hyperopt, please use same set of arguments `--dmmp`/`--disable-max-market-positions` and `--eps`/`--enable-position-stacking` for Backtesting.
|
||||||
|
|
||||||
## Next Step
|
|
||||||
|
|
||||||
Now you have a perfect bot and want to control it from Telegram. Your
|
|
||||||
next step is to learn the [Telegram usage](telegram-usage.md).
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Freqtrade
|
# Freqtrade
|
||||||
[](https://travis-ci.org/freqtrade/freqtrade)
|
[](https://github.com/freqtrade/freqtrade/actions/)
|
||||||
[](https://coveralls.io/github/freqtrade/freqtrade?branch=develop)
|
[](https://coveralls.io/github/freqtrade/freqtrade?branch=develop)
|
||||||
[](https://codeclimate.com/github/freqtrade/freqtrade/maintainability)
|
[](https://codeclimate.com/github/freqtrade/freqtrade/maintainability)
|
||||||
|
|
||||||
@@ -8,11 +8,13 @@
|
|||||||
<!-- Place this tag where you want the button to render. -->
|
<!-- Place this tag where you want the button to render. -->
|
||||||
<a class="github-button" href="https://github.com/freqtrade/freqtrade/fork" data-icon="octicon-repo-forked" data-size="large" aria-label="Fork freqtrade/freqtrade on GitHub">Fork</a>
|
<a class="github-button" href="https://github.com/freqtrade/freqtrade/fork" data-icon="octicon-repo-forked" data-size="large" aria-label="Fork freqtrade/freqtrade on GitHub">Fork</a>
|
||||||
<!-- Place this tag where you want the button to render. -->
|
<!-- Place this tag where you want the button to render. -->
|
||||||
<a class="github-button" href="https://github.com/freqtrade/freqtrade/archive/master.zip" data-icon="octicon-cloud-download" data-size="large" aria-label="Download freqtrade/freqtrade on GitHub">Download</a>
|
<a class="github-button" href="https://github.com/freqtrade/freqtrade/archive/stable.zip" data-icon="octicon-cloud-download" data-size="large" aria-label="Download freqtrade/freqtrade on GitHub">Download</a>
|
||||||
<!-- Place this tag where you want the button to render. -->
|
<!-- Place this tag where you want the button to render. -->
|
||||||
<a class="github-button" href="https://github.com/freqtrade" data-size="large" aria-label="Follow @freqtrade on GitHub">Follow @freqtrade</a>
|
<a class="github-button" href="https://github.com/freqtrade" data-size="large" aria-label="Follow @freqtrade on GitHub">Follow @freqtrade</a>
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
Freqtrade is a cryptocurrency trading bot written in Python.
|
|
||||||
|
Freqtrade is a crypto-currency algorithmic trading software developed in python (3.6+) and supported on Windows, macOS and Linux.
|
||||||
|
|
||||||
!!! Danger "DISCLAIMER"
|
!!! Danger "DISCLAIMER"
|
||||||
This software is for educational purposes only. Do not risk money which you are afraid to lose. USE THE SOFTWARE AT YOUR OWN RISK. THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS.
|
This software is for educational purposes only. Do not risk money which you are afraid to lose. USE THE SOFTWARE AT YOUR OWN RISK. THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS.
|
||||||
@@ -23,28 +25,21 @@ Freqtrade is a cryptocurrency trading bot written in Python.
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Based on Python 3.6+: For botting on any operating system — Windows, macOS and Linux.
|
- Develop your Strategy: Write your strategy in python, using [pandas](https://pandas.pydata.org/). Example strategies to inspire you are available in the [strategy repository](https://github.com/freqtrade/freqtrade-strategies).
|
||||||
- Persistence: Persistence is achieved through sqlite database.
|
- Download market data: Download historical data of the exchange and the markets your may want to trade with.
|
||||||
- Dry-run mode: Run the bot without playing money.
|
- Backtest: Test your strategy on downloaded historical data.
|
||||||
- Backtesting: Run a simulation of your buy/sell strategy with historical data.
|
- Optimize: Find the best parameters for your strategy using hyperoptimization which employs machining learning methods. You can optimize buy, sell, take profit (ROI), stop-loss and trailing stop-loss parameters for your strategy.
|
||||||
- Strategy Optimization by machine learning: Use machine learning to optimize your buy/sell strategy parameters with real exchange data.
|
- Select markets: Create your static list or use an automatic one based on top traded volumes and/or prices (not available during backtesting). You can also explicitly blacklist markets you don't want to trade.
|
||||||
- Edge position sizing: Calculate your win rate, risk reward ratio, the best stoploss and adjust your position size before taking a position for each specific market.
|
- Run: Test your strategy with simulated money (Dry-Run mode) or deploy it with real money (Live-Trade mode).
|
||||||
- Whitelist crypto-currencies: Select which crypto-currency you want to trade or use dynamic whitelists based on market (pair) trade volume.
|
- Run using Edge (optional module): The concept is to find the best historical [trade expectancy](edge.md#expectancy) by markets based on variation of the stop-loss and then allow/reject markets to trade. The sizing of the trade is based on a risk of a percentage of your capital.
|
||||||
- Blacklist crypto-currencies: Select which crypto-currency you want to avoid.
|
- Control/Monitor: Use Telegram or a REST API (start/stop the bot, show profit/loss, daily summary, current open trades results, etc.).
|
||||||
- Manageable via Telegram or REST APi: Manage the bot with Telegram or via the builtin REST API.
|
- Analyse: Further analysis can be performed on either Backtesting data or Freqtrade trading history (SQL database), including automated standard plots, and methods to load the data into [interactive environments](data-analysis.md).
|
||||||
- Display profit/loss in fiat: Display your profit/loss in any of 33 fiat currencies supported.
|
|
||||||
- Daily summary of profit/loss: Receive the daily summary of your profit/loss.
|
|
||||||
- Performance status report: Receive the performance status of your current trades.
|
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
### Up to date clock
|
|
||||||
|
|
||||||
The clock on the system running the bot must be accurate, synchronized to a NTP server frequently enough to avoid problems with communication to the exchanges.
|
|
||||||
|
|
||||||
### Hardware requirements
|
### Hardware requirements
|
||||||
|
|
||||||
To run this bot we recommend you a cloud instance with a minimum of:
|
To run this bot we recommend you a linux cloud instance with a minimum of:
|
||||||
|
|
||||||
- 2GB RAM
|
- 2GB RAM
|
||||||
- 1GB disk space
|
- 1GB disk space
|
||||||
@@ -52,20 +47,23 @@ To run this bot we recommend you a cloud instance with a minimum of:
|
|||||||
|
|
||||||
### Software requirements
|
### Software requirements
|
||||||
|
|
||||||
|
- Docker (Recommended)
|
||||||
|
|
||||||
|
Alternatively
|
||||||
|
|
||||||
- Python 3.6.x
|
- Python 3.6.x
|
||||||
- pip (pip3)
|
- pip (pip3)
|
||||||
- git
|
- git
|
||||||
- TA-Lib
|
- TA-Lib
|
||||||
- virtualenv (Recommended)
|
- virtualenv (Recommended)
|
||||||
- Docker (Recommended)
|
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
Help / Slack
|
### Help / Slack
|
||||||
For any questions not covered by the documentation or for further information about the bot, we encourage you to join our Slack channel.
|
For any questions not covered by the documentation or for further information about the bot, we encourage you to join our passionate Slack community.
|
||||||
|
|
||||||
Click [here](https://join.slack.com/t/highfrequencybot/shared_invite/enQtNjU5ODcwNjI1MDU3LTU1MTgxMjkzNmYxNWE1MDEzYzQ3YmU4N2MwZjUyNjJjODRkMDVkNjg4YTAyZGYzYzlhOTZiMTE4ZjQ4YzM0OGE) to join Slack channel.
|
Click [here](https://join.slack.com/t/highfrequencybot/shared_invite/enQtNjU5ODcwNjI1MDU3LTU1MTgxMjkzNmYxNWE1MDEzYzQ3YmU4N2MwZjUyNjJjODRkMDVkNjg4YTAyZGYzYzlhOTZiMTE4ZjQ4YzM0OGE) to join the Freqtrade Slack channel.
|
||||||
|
|
||||||
## Ready to try?
|
## Ready to try?
|
||||||
|
|
||||||
Begin by reading our installation guide [here](installation).
|
Begin by reading our installation guide [for docker](docker.md), or for [installation without docker](installation.md).
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
This page explains how to prepare your environment for running the bot.
|
This page explains how to prepare your environment for running the bot.
|
||||||
|
|
||||||
|
Please consider using the prebuilt [docker images](docker.md) to get started quickly while trying out freqtrade evaluating how it operates.
|
||||||
|
|
||||||
## Prerequisite
|
## Prerequisite
|
||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
@@ -11,70 +13,78 @@ Click each one for install guide:
|
|||||||
* [Python >= 3.6.x](http://docs.python-guide.org/en/latest/starting/installation/)
|
* [Python >= 3.6.x](http://docs.python-guide.org/en/latest/starting/installation/)
|
||||||
* [pip](https://pip.pypa.io/en/stable/installing/)
|
* [pip](https://pip.pypa.io/en/stable/installing/)
|
||||||
* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
|
* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
|
||||||
* [virtualenv](https://virtualenv.pypa.io/en/stable/installation/) (Recommended)
|
* [virtualenv](https://virtualenv.pypa.io/en/stable/installation.html) (Recommended)
|
||||||
* [TA-Lib](https://mrjbq7.github.io/ta-lib/install.html) (install instructions below)
|
* [TA-Lib](https://mrjbq7.github.io/ta-lib/install.html) (install instructions below)
|
||||||
|
|
||||||
### API keys
|
We also recommend a [Telegram bot](telegram-usage.md#setup-your-telegram-bot), which is optional but recommended.
|
||||||
|
|
||||||
Before running your bot in production you will need to setup few
|
!!! Warning "Up-to-date clock"
|
||||||
external API. In production mode, the bot will require valid Exchange API
|
The clock on the system running the bot must be accurate, synchronized to a NTP server frequently enough to avoid problems with communication to the exchanges.
|
||||||
credentials. We also recommend a [Telegram bot](telegram-usage.md#setup-your-telegram-bot) (optional but recommended).
|
|
||||||
|
|
||||||
### Setup your exchange account
|
|
||||||
|
|
||||||
You will need to create API Keys (Usually you get `key` and `secret`) from the Exchange website and insert this into the appropriate fields in the configuration or when asked by the installation script.
|
|
||||||
|
|
||||||
## Quick start
|
## Quick start
|
||||||
|
|
||||||
Freqtrade provides a Linux/MacOS script to install all dependencies and help you to configure the bot.
|
Freqtrade provides the Linux/MacOS Easy Installation script to install all dependencies and help you configure the bot.
|
||||||
|
|
||||||
!!! Note
|
|
||||||
Python3.6 or higher and the corresponding pip are assumed to be available. The install-script will warn and stop if that's not the case.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone git@github.com:freqtrade/freqtrade.git
|
|
||||||
cd freqtrade
|
|
||||||
git checkout develop
|
|
||||||
./setup.sh --install
|
|
||||||
```
|
|
||||||
|
|
||||||
!!! Note
|
!!! Note
|
||||||
Windows installation is explained [here](#windows).
|
Windows installation is explained [here](#windows).
|
||||||
|
|
||||||
## Easy Installation - Linux Script
|
The easiest way to install and run Freqtrade is to clone the bot Github repository and then run the Easy Installation script, if it's available for your platform.
|
||||||
|
|
||||||
If you are on Debian, Ubuntu or MacOS freqtrade provides a script to Install, Update, Configure, and Reset your bot.
|
!!! Note "Version considerations"
|
||||||
|
When cloning the repository the default working branch has the name `develop`. This branch contains all last features (can be considered as relatively stable, thanks to automated tests). The `stable` branch contains the code of the last release (done usually once per month on an approximately one week old snapshot of the `develop` branch to prevent packaging bugs, so potentially it's more stable).
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
Python3.6 or higher and the corresponding `pip` are assumed to be available. The install-script will warn you and stop if that's not the case. `git` is also needed to clone the Freqtrade repository.
|
||||||
|
|
||||||
|
This can be achieved with the following commands:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/freqtrade/freqtrade.git
|
||||||
|
cd freqtrade
|
||||||
|
# git checkout stable # Optional, see (1)
|
||||||
|
./setup.sh --install
|
||||||
|
```
|
||||||
|
|
||||||
|
(1) This command switches the cloned repository to the use of the `stable` branch. It's not needed if you wish to stay on the `develop` branch. You may later switch between branches at any time with the `git checkout stable`/`git checkout develop` commands.
|
||||||
|
|
||||||
|
## Easy Installation Script (Linux/MacOS)
|
||||||
|
|
||||||
|
If you are on Debian, Ubuntu or MacOS Freqtrade provides the script to install, update, configure and reset the codebase of your bot.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ ./setup.sh
|
$ ./setup.sh
|
||||||
usage:
|
usage:
|
||||||
-i,--install Install freqtrade from scratch
|
-i,--install Install freqtrade from scratch
|
||||||
-u,--update Command git pull to update.
|
-u,--update Command git pull to update.
|
||||||
-r,--reset Hard reset your develop/master branch.
|
-r,--reset Hard reset your develop/stable branch.
|
||||||
-c,--config Easy config generator (Will override your existing file).
|
-c,--config Easy config generator (Will override your existing file).
|
||||||
```
|
```
|
||||||
|
|
||||||
** --install **
|
** --install **
|
||||||
|
|
||||||
This script will install everything you need to run the bot:
|
With this option, the script will install the bot and most dependencies:
|
||||||
|
You will need to have git and python3.6+ installed beforehand for this to work.
|
||||||
|
|
||||||
* Mandatory software as: `ta-lib`
|
* Mandatory software as: `ta-lib`
|
||||||
* Setup your virtualenv
|
* Setup your virtualenv under `.env/`
|
||||||
* Configure your `config.json` file
|
|
||||||
|
|
||||||
This script is a combination of `install script` `--reset`, `--config`
|
This option is a combination of installation tasks, `--reset` and `--config`.
|
||||||
|
|
||||||
** --update **
|
** --update **
|
||||||
|
|
||||||
Update parameter will pull the last version of your current branch and update your virtualenv.
|
This option will pull the last version of your current branch and update your virtualenv. Run the script with this option periodically to update your bot.
|
||||||
|
|
||||||
** --reset **
|
** --reset **
|
||||||
|
|
||||||
Reset parameter will hard reset your branch (only if you are on `master` or `develop`) and recreate your virtualenv.
|
This option will hard reset your branch (only if you are on either `stable` or `develop`) and recreate your virtualenv.
|
||||||
|
|
||||||
** --config **
|
** --config **
|
||||||
|
|
||||||
Config parameter is a `config.json` configurator. This script will ask you questions to setup your bot and create your `config.json`.
|
DEPRECATED - use `freqtrade new-config -c config.json` instead.
|
||||||
|
|
||||||
|
### Activate your virtual environment
|
||||||
|
|
||||||
|
Each time you open a new terminal, you must run `source .env/bin/activate`.
|
||||||
|
|
||||||
------
|
------
|
||||||
|
|
||||||
@@ -86,44 +96,50 @@ OS Specific steps are listed first, the [Common](#common) section below is neces
|
|||||||
!!! Note
|
!!! Note
|
||||||
Python3.6 or higher and the corresponding pip are assumed to be available.
|
Python3.6 or higher and the corresponding pip are assumed to be available.
|
||||||
|
|
||||||
### Linux - Ubuntu 16.04
|
=== "Ubuntu 16.04"
|
||||||
|
#### Install necessary dependencies
|
||||||
|
|
||||||
#### Install necessary dependencies
|
```bash
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install build-essential git
|
||||||
|
```
|
||||||
|
|
||||||
```bash
|
=== "RaspberryPi/Raspbian"
|
||||||
sudo apt-get update
|
The following assumes the latest [Raspbian Buster lite image](https://www.raspberrypi.org/downloads/raspbian/) from at least September 2019.
|
||||||
sudo apt-get install build-essential git
|
This image comes with python3.7 preinstalled, making it easy to get freqtrade up and running.
|
||||||
```
|
|
||||||
|
|
||||||
#### Raspberry Pi / Raspbian
|
Tested using a Raspberry Pi 3 with the Raspbian Buster lite image, all updates applied.
|
||||||
|
|
||||||
Before installing FreqTrade on a Raspberry Pi running the official Raspbian Image, make sure you have at least Python 3.6 installed. The default image only provides Python 3.5. Probably the easiest way to get a recent version of python is [miniconda](https://repo.continuum.io/miniconda/).
|
``` bash
|
||||||
|
sudo apt-get install python3-venv libatlas-base-dev
|
||||||
|
git clone https://github.com/freqtrade/freqtrade.git
|
||||||
|
cd freqtrade
|
||||||
|
|
||||||
The following assumes that miniconda3 is installed and available in your environment. Since the last miniconda3 installation file uses python 3.4, we will update to python 3.6 on this installation.
|
bash setup.sh -i
|
||||||
It's recommended to use (mini)conda for this as installation/compilation of `numpy` and `pandas` takes a long time.
|
```
|
||||||
|
|
||||||
Additional package to install on your Raspbian, `libffi-dev` required by cryptography (from python-telegram-bot).
|
!!! Note "Installation duration"
|
||||||
|
Depending on your internet speed and the Raspberry Pi version, installation can take multiple hours to complete.
|
||||||
|
|
||||||
``` bash
|
!!! Note
|
||||||
conda config --add channels rpi
|
The above does not install hyperopt dependencies. To install these, please use `python3 -m pip install -e .[hyperopt]`.
|
||||||
conda install python=3.6
|
We do not advise to run hyperopt on a Raspberry Pi, since this is a very resource-heavy operation, which should be done on powerful machine.
|
||||||
conda create -n freqtrade python=3.6
|
|
||||||
conda activate freqtrade
|
|
||||||
conda install pandas numpy
|
|
||||||
|
|
||||||
sudo apt install libffi-dev
|
|
||||||
python3 -m pip install -r requirements-common.txt
|
|
||||||
python3 -m pip install -e .
|
|
||||||
```
|
|
||||||
|
|
||||||
!!! Note
|
|
||||||
This does not install hyperopt dependencies. To install these, please use `python3 -m pip install -e .[hyperopt]`.
|
|
||||||
We do not advise to run hyperopt on a Raspberry Pi, since this is a very resource-heavy operation, which should be done on powerful machine.
|
|
||||||
|
|
||||||
### Common
|
### Common
|
||||||
|
|
||||||
#### 1. Install TA-Lib
|
#### 1. Install TA-Lib
|
||||||
|
|
||||||
|
Use the provided ta-lib installation script
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo ./build_helpers/install_ta-lib.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
This will use the ta-lib tar.gz included in this repository.
|
||||||
|
|
||||||
|
##### TA-Lib manual installation
|
||||||
|
|
||||||
Official webpage: https://mrjbq7.github.io/ta-lib/install.html
|
Official webpage: https://mrjbq7.github.io/ta-lib/install.html
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -151,133 +167,79 @@ python3 -m venv .env
|
|||||||
source .env/bin/activate
|
source .env/bin/activate
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 3. Install FreqTrade
|
#### 3. Install Freqtrade
|
||||||
|
|
||||||
Clone the git repository:
|
Clone the git repository:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/freqtrade/freqtrade.git
|
git clone https://github.com/freqtrade/freqtrade.git
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
Optionally checkout the master branch to get the latest stable release:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git checkout master
|
|
||||||
```
|
|
||||||
|
|
||||||
#### 4. Initialize the configuration
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd freqtrade
|
cd freqtrade
|
||||||
cp config.json.example config.json
|
git checkout stable
|
||||||
```
|
```
|
||||||
|
|
||||||
> *To edit the config please refer to [Bot Configuration](configuration.md).*
|
#### 4. Install python dependencies
|
||||||
|
|
||||||
#### 5. Install python dependencies
|
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
python3 -m pip install --upgrade pip
|
python3 -m pip install --upgrade pip
|
||||||
python3 -m pip install -e .
|
python3 -m pip install -e .
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### 5. Initialize the configuration
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Initialize the user_directory
|
||||||
|
freqtrade create-userdir --userdir user_data/
|
||||||
|
|
||||||
|
# Create a new configuration file
|
||||||
|
freqtrade new-config --config config.json
|
||||||
|
```
|
||||||
|
|
||||||
|
> *To edit the config please refer to [Bot Configuration](configuration.md).*
|
||||||
|
|
||||||
#### 6. Run the Bot
|
#### 6. Run the Bot
|
||||||
|
|
||||||
If this is the first time you run the bot, ensure you are running it in Dry-run `"dry_run": true,` otherwise it will start to buy and sell coins.
|
If this is the first time you run the bot, ensure you are running it in Dry-run `"dry_run": true,` otherwise it will start to buy and sell coins.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
freqtrade -c config.json
|
freqtrade trade -c config.json
|
||||||
```
|
```
|
||||||
|
|
||||||
*Note*: If you run the bot on a server, you should consider using [Docker](docker.md) or a terminal multiplexer like `screen` or [`tmux`](https://en.wikipedia.org/wiki/Tmux) to avoid that the bot is stopped on logout.
|
*Note*: If you run the bot on a server, you should consider using [Docker](docker.md) or a terminal multiplexer like `screen` or [`tmux`](https://en.wikipedia.org/wiki/Tmux) to avoid that the bot is stopped on logout.
|
||||||
|
|
||||||
#### 7. [Optional] Configure `freqtrade` as a `systemd` service
|
#### 7. (Optional) Post-installation Tasks
|
||||||
|
|
||||||
From the freqtrade repo... copy `freqtrade.service` to your systemd user directory (usually `~/.config/systemd/user`) and update `WorkingDirectory` and `ExecStart` to match your setup.
|
On Linux, as an optional post-installation task, you may wish to setup the bot to run as a `systemd` service or configure it to send the log messages to the `syslog`/`rsyslog` or `journald` daemons. See [Advanced Logging](advanced-setup.md#advanced-logging) for details.
|
||||||
|
|
||||||
After that you can start the daemon with:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
systemctl --user start freqtrade
|
|
||||||
```
|
|
||||||
|
|
||||||
For this to be persistent (run when user is logged out) you'll need to enable `linger` for your freqtrade user.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo loginctl enable-linger "$USER"
|
|
||||||
```
|
|
||||||
|
|
||||||
If you run the bot as a service, you can use systemd service manager as a software watchdog monitoring freqtrade bot
|
|
||||||
state and restarting it in the case of failures. If the `internals.sd_notify` parameter is set to true in the
|
|
||||||
configuration or the `--sd-notify` command line option is used, the bot will send keep-alive ping messages to systemd
|
|
||||||
using the sd_notify (systemd notifications) protocol and will also tell systemd its current state (Running or Stopped)
|
|
||||||
when it changes.
|
|
||||||
|
|
||||||
The `freqtrade.service.watchdog` file contains an example of the service unit configuration file which uses systemd
|
|
||||||
as the watchdog.
|
|
||||||
|
|
||||||
!!! Note
|
|
||||||
The sd_notify communication between the bot and the systemd service manager will not work if the bot runs in a Docker container.
|
|
||||||
|
|
||||||
------
|
------
|
||||||
|
|
||||||
## Using Conda
|
### Anaconda
|
||||||
|
|
||||||
Freqtrade can also be installed using Anaconda (or Miniconda).
|
Freqtrade can also be installed using Anaconda (or Miniconda).
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
This requires the [ta-lib](#1-install-ta-lib) C-library to be installed first. See below.
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
conda env create -f environment.yml
|
conda env create -f environment.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! Note
|
-----
|
||||||
This requires the [ta-lib](#1-install-ta-lib) C-library to be installed first.
|
## Troubleshooting
|
||||||
|
|
||||||
## Windows
|
### MacOS installation error
|
||||||
|
|
||||||
We recommend that Windows users use [Docker](docker.md) as this will work much easier and smoother (also more secure).
|
Newer versions of MacOS may have installation failed with errors like `error: command 'g++' failed with exit status 1`.
|
||||||
|
|
||||||
If that is not possible, try using the Windows Linux subsystem (WSL) - for which the Ubuntu instructions should work.
|
This error will require explicit installation of the SDK Headers, which are not installed by default in this version of MacOS.
|
||||||
If that is not available on your system, feel free to try the instructions below, which led to success for some.
|
For MacOS 10.14, this can be accomplished with the below command.
|
||||||
|
|
||||||
### Install freqtrade manually
|
|
||||||
|
|
||||||
#### Clone the git repository
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/freqtrade/freqtrade.git
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Install ta-lib
|
|
||||||
|
|
||||||
Install ta-lib according to the [ta-lib documentation](https://github.com/mrjbq7/ta-lib#windows).
|
|
||||||
|
|
||||||
As compiling from source on windows has heavy dependencies (requires a partial visual studio installation), there is also a repository of unofficial precompiled windows Wheels [here](https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib), which needs to be downloaded and installed using `pip install TA_Lib‑0.4.17‑cp36‑cp36m‑win32.whl` (make sure to use the version matching your python version)
|
|
||||||
|
|
||||||
```cmd
|
|
||||||
>cd \path\freqtrade-develop
|
|
||||||
>python -m venv .env
|
|
||||||
>.env\Scripts\activate.bat
|
|
||||||
REM optionally install ta-lib from wheel
|
|
||||||
REM >pip install TA_Lib‑0.4.17‑cp36‑cp36m‑win32.whl
|
|
||||||
>pip install -r requirements.txt
|
|
||||||
>pip install -e .
|
|
||||||
>freqtrade
|
|
||||||
```
|
|
||||||
|
|
||||||
> Thanks [Owdr](https://github.com/Owdr) for the commands. Source: [Issue #222](https://github.com/freqtrade/freqtrade/issues/222)
|
|
||||||
|
|
||||||
#### Error during installation under Windows
|
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
|
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
|
||||||
```
|
```
|
||||||
|
|
||||||
Unfortunately, many packages requiring compilation don't provide a pre-build wheel. It is therefore mandatory to have a C/C++ compiler installed and available for your python environment to use.
|
If this file is inexistent, then you're probably on a different version of MacOS, so you may need to consult the internet for specific resolution details.
|
||||||
|
|
||||||
The easiest way is to download install Microsoft Visual Studio Community [here](https://visualstudio.microsoft.com/downloads/) and make sure to install "Common Tools for Visual C++" to enable building c code on Windows. Unfortunately, this is a heavy download / dependency (~4Gb) so you might want to consider WSL or [docker](docker.md) first.
|
-----
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Now you have an environment ready, the next step is
|
Now you have an environment ready, the next step is
|
||||||
[Bot Configuration](configuration.md).
|
[Bot Configuration](configuration.md).
|
||||||
|
|||||||
12
docs/javascripts/config.js
Normal file
12
docs/javascripts/config.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
window.MathJax = {
|
||||||
|
tex: {
|
||||||
|
inlineMath: [["\\(", "\\)"]],
|
||||||
|
displayMath: [["\\[", "\\]"]],
|
||||||
|
processEscapes: true,
|
||||||
|
processEnvironments: true
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
ignoreHtmlClass: ".*|",
|
||||||
|
processHtmlClass: "arithmatex"
|
||||||
|
}
|
||||||
|
};
|
||||||
172
docs/plotting.md
172
docs/plotting.md
@@ -23,13 +23,16 @@ The `freqtrade plot-dataframe` subcommand shows an interactive graph with three
|
|||||||
Possible arguments:
|
Possible arguments:
|
||||||
|
|
||||||
```
|
```
|
||||||
usage: freqtrade plot-dataframe [-h] [-p PAIRS [PAIRS ...]]
|
usage: freqtrade plot-dataframe [-h] [-v] [--logfile FILE] [-V] [-c PATH]
|
||||||
|
[-d PATH] [--userdir PATH] [-s NAME]
|
||||||
|
[--strategy-path PATH] [-p PAIRS [PAIRS ...]]
|
||||||
[--indicators1 INDICATORS1 [INDICATORS1 ...]]
|
[--indicators1 INDICATORS1 [INDICATORS1 ...]]
|
||||||
[--indicators2 INDICATORS2 [INDICATORS2 ...]]
|
[--indicators2 INDICATORS2 [INDICATORS2 ...]]
|
||||||
[--plot-limit INT] [--db-url PATH]
|
[--plot-limit INT] [--db-url PATH]
|
||||||
[--trade-source {DB,file}] [--export EXPORT]
|
[--trade-source {DB,file}] [--export EXPORT]
|
||||||
[--export-filename PATH]
|
[--export-filename PATH]
|
||||||
[--timerange TIMERANGE]
|
[--timerange TIMERANGE] [-i TIMEFRAME]
|
||||||
|
[--no-trades]
|
||||||
|
|
||||||
optional arguments:
|
optional arguments:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
@@ -48,21 +51,46 @@ optional arguments:
|
|||||||
values cause huge files. Default: 750.
|
values cause huge files. Default: 750.
|
||||||
--db-url PATH Override trades database URL, this is useful in custom
|
--db-url PATH Override trades database URL, this is useful in custom
|
||||||
deployments (default: `sqlite:///tradesv3.sqlite` for
|
deployments (default: `sqlite:///tradesv3.sqlite` for
|
||||||
Live Run mode, `sqlite://` for Dry Run).
|
Live Run mode, `sqlite:///tradesv3.dryrun.sqlite` for
|
||||||
|
Dry Run).
|
||||||
--trade-source {DB,file}
|
--trade-source {DB,file}
|
||||||
Specify the source for trades (Can be DB or file
|
Specify the source for trades (Can be DB or file
|
||||||
(backtest file)) Default: file
|
(backtest file)) Default: file
|
||||||
--export EXPORT Export backtest results, argument are: trades.
|
--export EXPORT Export backtest results, argument are: trades.
|
||||||
Example: `--export=trades`
|
Example: `--export=trades`
|
||||||
--export-filename PATH
|
--export-filename PATH
|
||||||
Save backtest results to the file with this filename
|
Save backtest results to the file with this filename.
|
||||||
(default: `user_data/backtest_results/backtest-
|
Requires `--export` to be set as well. Example:
|
||||||
result.json`). Requires `--export` to be set as well.
|
`--export-filename=user_data/backtest_results/backtest
|
||||||
Example: `--export-filename=user_data/backtest_results
|
_today.json`
|
||||||
/backtest_today.json`
|
|
||||||
--timerange TIMERANGE
|
--timerange TIMERANGE
|
||||||
Specify what timerange of data to use.
|
Specify what timerange of data to use.
|
||||||
|
-i TIMEFRAME, --timeframe TIMEFRAME, --ticker-interval TIMEFRAME
|
||||||
|
Specify ticker interval (`1m`, `5m`, `30m`, `1h`,
|
||||||
|
`1d`).
|
||||||
|
--no-trades Skip using trades from backtesting file and DB.
|
||||||
|
|
||||||
|
Common arguments:
|
||||||
|
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
||||||
|
--logfile FILE Log to the file specified. Special values are:
|
||||||
|
'syslog', 'journald'. See the documentation for more
|
||||||
|
details.
|
||||||
|
-V, --version show program's version number and exit
|
||||||
|
-c PATH, --config PATH
|
||||||
|
Specify configuration file (default:
|
||||||
|
`userdir/config.json` or `config.json` whichever
|
||||||
|
exists). Multiple --config options may be used. Can be
|
||||||
|
set to `-` to read config from stdin.
|
||||||
|
-d PATH, --datadir PATH
|
||||||
|
Path to directory with historical backtesting data.
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
|
||||||
|
Strategy arguments:
|
||||||
|
-s NAME, --strategy NAME
|
||||||
|
Specify strategy class name which will be used by the
|
||||||
|
bot.
|
||||||
|
--strategy-path PATH Specify additional strategy lookup path.
|
||||||
```
|
```
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
@@ -79,11 +107,11 @@ The `-p/--pairs` argument can be used to specify pairs you would like to plot.
|
|||||||
Specify custom indicators.
|
Specify custom indicators.
|
||||||
Use `--indicators1` for the main plot and `--indicators2` for the subplot below (if values are in a different range than prices).
|
Use `--indicators1` for the main plot and `--indicators2` for the subplot below (if values are in a different range than prices).
|
||||||
|
|
||||||
!!! tip
|
!!! Tip
|
||||||
You will almost certainly want to specify a custom strategy! This can be done by adding `-s Classname` / `--strategy ClassName` to the command.
|
You will almost certainly want to specify a custom strategy! This can be done by adding `-s Classname` / `--strategy ClassName` to the command.
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
freqtrade --strategy AwesomeStrategy plot-dataframe -p BTC/ETH --indicators1 sma ema --indicators2 macd
|
freqtrade plot-dataframe --strategy AwesomeStrategy -p BTC/ETH --indicators1 sma ema --indicators2 macd
|
||||||
```
|
```
|
||||||
|
|
||||||
### Further usage examples
|
### Further usage examples
|
||||||
@@ -91,52 +119,116 @@ freqtrade --strategy AwesomeStrategy plot-dataframe -p BTC/ETH --indicators1 sma
|
|||||||
To plot multiple pairs, separate them with a space:
|
To plot multiple pairs, separate them with a space:
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
freqtrade --strategy AwesomeStrategy plot-dataframe -p BTC/ETH XRP/ETH
|
freqtrade plot-dataframe --strategy AwesomeStrategy -p BTC/ETH XRP/ETH
|
||||||
```
|
```
|
||||||
|
|
||||||
To plot a timerange (to zoom in)
|
To plot a timerange (to zoom in)
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
freqtrade --strategy AwesomeStrategy plot-dataframe -p BTC/ETH --timerange=20180801-20180805
|
freqtrade plot-dataframe --strategy AwesomeStrategy -p BTC/ETH --timerange=20180801-20180805
|
||||||
```
|
```
|
||||||
|
|
||||||
To plot trades stored in a database use `--db-url` in combination with `--trade-source DB`:
|
To plot trades stored in a database use `--db-url` in combination with `--trade-source DB`:
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
freqtrade --strategy AwesomeStrategy plot-dataframe --db-url sqlite:///tradesv3.dry_run.sqlite -p BTC/ETH --trade-source DB
|
freqtrade plot-dataframe --strategy AwesomeStrategy --db-url sqlite:///tradesv3.dry_run.sqlite -p BTC/ETH --trade-source DB
|
||||||
```
|
```
|
||||||
|
|
||||||
To plot trades from a backtesting result, use `--export-filename <filename>`
|
To plot trades from a backtesting result, use `--export-filename <filename>`
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
freqtrade --strategy AwesomeStrategy plot-dataframe --export-filename user_data/backtest_results/backtest-result.json -p BTC/ETH
|
freqtrade plot-dataframe --strategy AwesomeStrategy --export-filename user_data/backtest_results/backtest-result.json -p BTC/ETH
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Plot dataframe basics
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
The `plot-dataframe` subcommand requires backtesting data, a strategy and either a backtesting-results file or a database, containing trades corresponding to the strategy.
|
||||||
|
|
||||||
|
The resulting plot will have the following elements:
|
||||||
|
|
||||||
|
* Green triangles: Buy signals from the strategy. (Note: not every buy signal generates a trade, compare to cyan circles.)
|
||||||
|
* Red triangles: Sell signals from the strategy. (Also, not every sell signal terminates a trade, compare to red and green squares.)
|
||||||
|
* Cyan circles: Trade entry points.
|
||||||
|
* Red squares: Trade exit points for trades with loss or 0% profit.
|
||||||
|
* Green squares: Trade exit points for profitable trades.
|
||||||
|
* Indicators with values corresponding to the candle scale (e.g. SMA/EMA), as specified with `--indicators1`.
|
||||||
|
* Volume (bar chart at the bottom of the main chart).
|
||||||
|
* Indicators with values in different scales (e.g. MACD, RSI) below the volume bars, as specified with `--indicators2`.
|
||||||
|
|
||||||
|
!!! Note "Bollinger Bands"
|
||||||
|
Bollinger bands are automatically added to the plot if the columns `bb_lowerband` and `bb_upperband` exist, and are painted as a light blue area spanning from the lower band to the upper band.
|
||||||
|
|
||||||
|
#### Advanced plot configuration
|
||||||
|
|
||||||
|
An advanced plot configuration can be specified in the strategy in the `plot_config` parameter.
|
||||||
|
|
||||||
|
Additional features when using plot_config include:
|
||||||
|
|
||||||
|
* Specify colors per indicator
|
||||||
|
* Specify additional subplots
|
||||||
|
|
||||||
|
The sample plot configuration below specifies fixed colors for the indicators. Otherwise consecutive plots may produce different colorschemes each time, making comparisons difficult.
|
||||||
|
It also allows multiple subplots to display both MACD and RSI at the same time.
|
||||||
|
|
||||||
|
Sample configuration with inline comments explaining the process:
|
||||||
|
|
||||||
|
``` python
|
||||||
|
plot_config = {
|
||||||
|
'main_plot': {
|
||||||
|
# Configuration for main plot indicators.
|
||||||
|
# Specifies `ema10` to be red, and `ema50` to be a shade of gray
|
||||||
|
'ema10': {'color': 'red'},
|
||||||
|
'ema50': {'color': '#CCCCCC'},
|
||||||
|
# By omitting color, a random color is selected.
|
||||||
|
'sar': {},
|
||||||
|
},
|
||||||
|
'subplots': {
|
||||||
|
# Create subplot MACD
|
||||||
|
"MACD": {
|
||||||
|
'macd': {'color': 'blue'},
|
||||||
|
'macdsignal': {'color': 'orange'},
|
||||||
|
},
|
||||||
|
# Additional subplot RSI
|
||||||
|
"RSI": {
|
||||||
|
'rsi': {'color': 'red'},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
The above configuration assumes that `ema10`, `ema50`, `macd`, `macdsignal` and `rsi` are columns in the DataFrame created by the strategy.
|
||||||
|
|
||||||
## Plot profit
|
## Plot profit
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
The `freqtrade plot-profit` subcommand shows an interactive graph with three plots:
|
The `plot-profit` subcommand shows an interactive graph with three plots:
|
||||||
|
|
||||||
1) Average closing price for all pairs
|
* Average closing price for all pairs.
|
||||||
2) The summarized profit made by backtesting.
|
* The summarized profit made by backtesting.
|
||||||
Note that this is not the real-world profit, but more of an estimate.
|
Note that this is not the real-world profit, but more of an estimate.
|
||||||
3) Profit for each individual pair
|
* Profit for each individual pair.
|
||||||
|
|
||||||
The first graph is good to get a grip of how the overall market progresses.
|
The first graph is good to get a grip of how the overall market progresses.
|
||||||
|
|
||||||
The second graph will show if your algorithm works or doesn't.
|
The second graph will show if your algorithm works or doesn't.
|
||||||
Perhaps you want an algorithm that steadily makes small profits, or one that acts less often, but makes big swings.
|
Perhaps you want an algorithm that steadily makes small profits, or one that acts less often, but makes big swings.
|
||||||
|
This graph will also highlight the start (and end) of the Max drawdown period.
|
||||||
|
|
||||||
The third graph can be useful to spot outliers, events in pairs that cause profit spikes.
|
The third graph can be useful to spot outliers, events in pairs that cause profit spikes.
|
||||||
|
|
||||||
Possible options for the `freqtrade plot-profit` subcommand:
|
Possible options for the `freqtrade plot-profit` subcommand:
|
||||||
|
|
||||||
```
|
```
|
||||||
usage: freqtrade plot-profit [-h] [-p PAIRS [PAIRS ...]]
|
usage: freqtrade plot-profit [-h] [-v] [--logfile FILE] [-V] [-c PATH]
|
||||||
|
[-d PATH] [--userdir PATH] [-s NAME]
|
||||||
|
[--strategy-path PATH] [-p PAIRS [PAIRS ...]]
|
||||||
[--timerange TIMERANGE] [--export EXPORT]
|
[--timerange TIMERANGE] [--export EXPORT]
|
||||||
[--export-filename PATH] [--db-url PATH]
|
[--export-filename PATH] [--db-url PATH]
|
||||||
[--trade-source {DB,file}]
|
[--trade-source {DB,file}] [-i TIMEFRAME]
|
||||||
|
|
||||||
optional arguments:
|
optional arguments:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
@@ -148,18 +240,42 @@ optional arguments:
|
|||||||
--export EXPORT Export backtest results, argument are: trades.
|
--export EXPORT Export backtest results, argument are: trades.
|
||||||
Example: `--export=trades`
|
Example: `--export=trades`
|
||||||
--export-filename PATH
|
--export-filename PATH
|
||||||
Save backtest results to the file with this filename
|
Save backtest results to the file with this filename.
|
||||||
(default: `user_data/backtest_results/backtest-
|
Requires `--export` to be set as well. Example:
|
||||||
result.json`). Requires `--export` to be set as well.
|
`--export-filename=user_data/backtest_results/backtest
|
||||||
Example: `--export-filename=user_data/backtest_results
|
_today.json`
|
||||||
/backtest_today.json`
|
|
||||||
--db-url PATH Override trades database URL, this is useful in custom
|
--db-url PATH Override trades database URL, this is useful in custom
|
||||||
deployments (default: `sqlite:///tradesv3.sqlite` for
|
deployments (default: `sqlite:///tradesv3.sqlite` for
|
||||||
Live Run mode, `sqlite://` for Dry Run).
|
Live Run mode, `sqlite:///tradesv3.dryrun.sqlite` for
|
||||||
|
Dry Run).
|
||||||
--trade-source {DB,file}
|
--trade-source {DB,file}
|
||||||
Specify the source for trades (Can be DB or file
|
Specify the source for trades (Can be DB or file
|
||||||
(backtest file)) Default: file
|
(backtest file)) Default: file
|
||||||
|
-i TIMEFRAME, --timeframe TIMEFRAME, --ticker-interval TIMEFRAME
|
||||||
|
Specify ticker interval (`1m`, `5m`, `30m`, `1h`,
|
||||||
|
`1d`).
|
||||||
|
|
||||||
|
Common arguments:
|
||||||
|
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
||||||
|
--logfile FILE Log to the file specified. Special values are:
|
||||||
|
'syslog', 'journald'. See the documentation for more
|
||||||
|
details.
|
||||||
|
-V, --version show program's version number and exit
|
||||||
|
-c PATH, --config PATH
|
||||||
|
Specify configuration file (default:
|
||||||
|
`userdir/config.json` or `config.json` whichever
|
||||||
|
exists). Multiple --config options may be used. Can be
|
||||||
|
set to `-` to read config from stdin.
|
||||||
|
-d PATH, --datadir PATH
|
||||||
|
Path to directory with historical backtesting data.
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
|
||||||
|
Strategy arguments:
|
||||||
|
-s NAME, --strategy NAME
|
||||||
|
Specify strategy class name which will be used by the
|
||||||
|
bot.
|
||||||
|
--strategy-path PATH Specify additional strategy lookup path.
|
||||||
```
|
```
|
||||||
|
|
||||||
The `-p/--pairs` argument, can be used to limit the pairs that are considered for this calculation.
|
The `-p/--pairs` argument, can be used to limit the pairs that are considered for this calculation.
|
||||||
@@ -169,7 +285,7 @@ Examples:
|
|||||||
Use custom backtest-export file
|
Use custom backtest-export file
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
freqtrade plot-profit -p LTC/BTC --export-filename user_data/backtest_results/backtest-result-Strategy005.json
|
freqtrade plot-profit -p LTC/BTC --export-filename user_data/backtest_results/backtest-result.json
|
||||||
```
|
```
|
||||||
|
|
||||||
Use custom database
|
Use custom database
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
mkdocs-material==4.4.3
|
mkdocs-material==5.5.13
|
||||||
mdx_truly_sane_lists==1.2
|
mdx_truly_sane_lists==1.2
|
||||||
|
|||||||
197
docs/rest-api.md
197
docs/rest-api.md
@@ -11,18 +11,28 @@ Sample configuration:
|
|||||||
"enabled": true,
|
"enabled": true,
|
||||||
"listen_ip_address": "127.0.0.1",
|
"listen_ip_address": "127.0.0.1",
|
||||||
"listen_port": 8080,
|
"listen_port": 8080,
|
||||||
|
"verbosity": "info",
|
||||||
|
"jwt_secret_key": "somethingrandom",
|
||||||
|
"CORS_origins": [],
|
||||||
"username": "Freqtrader",
|
"username": "Freqtrader",
|
||||||
"password": "SuperSecret1!"
|
"password": "SuperSecret1!"
|
||||||
},
|
},
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! Danger Security warning
|
!!! Danger "Security warning"
|
||||||
By default, the configuration listens on localhost only (so it's not reachable from other systems). We strongly recommend to not expose this API to the internet and choose a strong, unique password, since others will potentially be able to control your bot.
|
By default, the configuration listens on localhost only (so it's not reachable from other systems). We strongly recommend to not expose this API to the internet and choose a strong, unique password, since others will potentially be able to control your bot.
|
||||||
|
|
||||||
!!! Danger Password selection
|
!!! Danger "Password selection"
|
||||||
Please make sure to select a very strong, unique password to protect your bot from unauthorized access.
|
Please make sure to select a very strong, unique password to protect your bot from unauthorized access.
|
||||||
|
|
||||||
You can then access the API by going to `http://127.0.0.1:8080/api/v1/version` to check if the API is running correctly.
|
You can then access the API by going to `http://127.0.0.1:8080/api/v1/ping` in a browser to check if the API is running correctly.
|
||||||
|
This should return the response:
|
||||||
|
|
||||||
|
``` output
|
||||||
|
{"status":"pong"}
|
||||||
|
```
|
||||||
|
|
||||||
|
All other endpoints return sensitive info and require authentication and are therefore not available through a web browser.
|
||||||
|
|
||||||
To generate a secure password, either use a password manager, or use the below code snipped.
|
To generate a secure password, either use a password manager, or use the below code snipped.
|
||||||
|
|
||||||
@@ -31,9 +41,12 @@ import secrets
|
|||||||
secrets.token_hex()
|
secrets.token_hex()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
!!! Hint
|
||||||
|
Use the same method to also generate a JWT secret key (`jwt_secret_key`).
|
||||||
|
|
||||||
### Configuration with docker
|
### Configuration with docker
|
||||||
|
|
||||||
If you run your bot using docker, you'll need to have the bot listen to incomming connections. The security is then handled by docker.
|
If you run your bot using docker, you'll need to have the bot listen to incoming connections. The security is then handled by docker.
|
||||||
|
|
||||||
``` json
|
``` json
|
||||||
"api_server": {
|
"api_server": {
|
||||||
@@ -58,7 +71,7 @@ docker run -d \
|
|||||||
-v ~/.freqtrade/user_data/:/freqtrade/user_data \
|
-v ~/.freqtrade/user_data/:/freqtrade/user_data \
|
||||||
-v ~/.freqtrade/tradesv3.sqlite:/freqtrade/tradesv3.sqlite \
|
-v ~/.freqtrade/tradesv3.sqlite:/freqtrade/tradesv3.sqlite \
|
||||||
-p 127.0.0.1:8080:8080 \
|
-p 127.0.0.1:8080:8080 \
|
||||||
freqtrade --db-url sqlite:///tradesv3.sqlite --strategy MyAwesomeStrategy
|
freqtrade trade --db-url sqlite:///tradesv3.sqlite --strategy MyAwesomeStrategy
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! Danger "Security warning"
|
!!! Danger "Security warning"
|
||||||
@@ -67,7 +80,7 @@ docker run -d \
|
|||||||
## Consuming the API
|
## Consuming the API
|
||||||
|
|
||||||
You can consume the API by using the script `scripts/rest_client.py`.
|
You can consume the API by using the script `scripts/rest_client.py`.
|
||||||
The client script only requires the `requests` module, so FreqTrade does not need to be installed on the system.
|
The client script only requires the `requests` module, so Freqtrade does not need to be installed on the system.
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
python3 scripts/rest_client.py <command> [optional parameters]
|
python3 scripts/rest_client.py <command> [optional parameters]
|
||||||
@@ -93,25 +106,30 @@ python3 scripts/rest_client.py --config rest_config.json <command> [optional par
|
|||||||
|
|
||||||
## Available commands
|
## Available commands
|
||||||
|
|
||||||
| Command | Default | Description |
|
| Command | Description |
|
||||||
|----------|---------|-------------|
|
|----------|-------------|
|
||||||
| `start` | | Starts the trader
|
| `ping` | Simple command testing the API Readiness - requires no authentication.
|
||||||
| `stop` | | Stops the trader
|
| `start` | Starts the trader
|
||||||
| `stopbuy` | | Stops the trader from opening new trades. Gracefully closes open trades according to their rules.
|
| `stop` | Stops the trader
|
||||||
| `reload_conf` | | Reloads the configuration file
|
| `stopbuy` | Stops the trader from opening new trades. Gracefully closes open trades according to their rules.
|
||||||
| `status` | | Lists all open trades
|
| `reload_config` | Reloads the configuration file
|
||||||
| `count` | | Displays number of trades used and available
|
| `trades` | List last trades.
|
||||||
| `profit` | | Display a summary of your profit/loss from close trades and some stats about your performance
|
| `delete_trade <trade_id>` | Remove trade from the database. Tries to close open orders. Requires manual handling of this trade on the exchange.
|
||||||
| `forcesell <trade_id>` | | Instantly sells the given trade (Ignoring `minimum_roi`).
|
| `show_config` | Shows part of the current configuration with relevant settings to operation
|
||||||
| `forcesell all` | | Instantly sells all open trades (Ignoring `minimum_roi`).
|
| `logs` | Shows last log messages
|
||||||
| `forcebuy <pair> [rate]` | | Instantly buys the given pair. Rate is optional. (`forcebuy_enable` must be set to True)
|
| `status` | Lists all open trades
|
||||||
| `performance` | | Show performance of each finished trade grouped by pair
|
| `count` | Displays number of trades used and available
|
||||||
| `balance` | | Show account balance per currency
|
| `profit` | Display a summary of your profit/loss from close trades and some stats about your performance
|
||||||
| `daily <n>` | 7 | Shows profit or loss per day, over the last n days
|
| `forcesell <trade_id>` | Instantly sells the given trade (Ignoring `minimum_roi`).
|
||||||
| `whitelist` | | Show the current whitelist
|
| `forcesell all` | Instantly sells all open trades (Ignoring `minimum_roi`).
|
||||||
| `blacklist [pair]` | | Show the current blacklist, or adds a pair to the blacklist.
|
| `forcebuy <pair> [rate]` | Instantly buys the given pair. Rate is optional. (`forcebuy_enable` must be set to True)
|
||||||
| `edge` | | Show validated pairs by Edge if it is enabled.
|
| `performance` | Show performance of each finished trade grouped by pair
|
||||||
| `version` | | Show version
|
| `balance` | Show account balance per currency
|
||||||
|
| `daily <n>` | Shows profit or loss per day, over the last n days (n defaults to 7)
|
||||||
|
| `whitelist` | Show the current whitelist
|
||||||
|
| `blacklist [pair]` | Show the current blacklist, or adds a pair to the blacklist.
|
||||||
|
| `edge` | Show validated pairs by Edge if it is enabled.
|
||||||
|
| `version` | Show version
|
||||||
|
|
||||||
Possible commands can be listed from the rest-client script using the `help` command.
|
Possible commands can be listed from the rest-client script using the `help` command.
|
||||||
|
|
||||||
@@ -121,72 +139,129 @@ python3 scripts/rest_client.py help
|
|||||||
|
|
||||||
``` output
|
``` output
|
||||||
Possible commands:
|
Possible commands:
|
||||||
|
|
||||||
balance
|
balance
|
||||||
Get the account balance
|
Get the account balance.
|
||||||
:returns: json object
|
|
||||||
|
|
||||||
blacklist
|
blacklist
|
||||||
Show the current blacklist
|
Show the current blacklist.
|
||||||
|
|
||||||
:param add: List of coins to add (example: "BNB/BTC")
|
:param add: List of coins to add (example: "BNB/BTC")
|
||||||
:returns: json object
|
|
||||||
|
|
||||||
count
|
count
|
||||||
Returns the amount of open trades
|
Return the amount of open trades.
|
||||||
:returns: json object
|
|
||||||
|
|
||||||
daily
|
daily
|
||||||
Returns the amount of open trades
|
Return the amount of open trades.
|
||||||
:returns: json object
|
|
||||||
|
delete_trade
|
||||||
|
Delete trade from the database.
|
||||||
|
Tries to close open orders. Requires manual handling of this asset on the exchange.
|
||||||
|
|
||||||
|
:param trade_id: Deletes the trade with this ID from the database.
|
||||||
|
|
||||||
edge
|
edge
|
||||||
Returns information about edge
|
Return information about edge.
|
||||||
:returns: json object
|
|
||||||
|
|
||||||
forcebuy
|
forcebuy
|
||||||
Buy an asset
|
Buy an asset.
|
||||||
|
|
||||||
:param pair: Pair to buy (ETH/BTC)
|
:param pair: Pair to buy (ETH/BTC)
|
||||||
:param price: Optional - price to buy
|
:param price: Optional - price to buy
|
||||||
:returns: json object of the trade
|
|
||||||
|
|
||||||
forcesell
|
forcesell
|
||||||
Force-sell a trade
|
Force-sell a trade.
|
||||||
|
|
||||||
:param tradeid: Id of the trade (can be received via status command)
|
:param tradeid: Id of the trade (can be received via status command)
|
||||||
:returns: json object
|
|
||||||
|
logs
|
||||||
|
Show latest logs.
|
||||||
|
|
||||||
|
:param limit: Limits log messages to the last <limit> logs. No limit to get all the trades.
|
||||||
|
|
||||||
performance
|
performance
|
||||||
Returns the performance of the different coins
|
Return the performance of the different coins.
|
||||||
:returns: json object
|
|
||||||
|
|
||||||
profit
|
profit
|
||||||
Returns the profit summary
|
Return the profit summary.
|
||||||
:returns: json object
|
|
||||||
|
|
||||||
reload_conf
|
reload_config
|
||||||
Reload configuration
|
Reload configuration.
|
||||||
:returns: json object
|
|
||||||
|
show_config
|
||||||
|
|
||||||
|
Returns part of the configuration, relevant for trading operations.
|
||||||
|
|
||||||
start
|
start
|
||||||
Start the bot if it's in stopped state.
|
Start the bot if it's in the stopped state.
|
||||||
:returns: json object
|
|
||||||
|
|
||||||
status
|
status
|
||||||
Get the status of open trades
|
Get the status of open trades.
|
||||||
:returns: json object
|
|
||||||
|
|
||||||
stop
|
stop
|
||||||
Stop the bot. Use start to restart
|
Stop the bot. Use `start` to restart.
|
||||||
:returns: json object
|
|
||||||
|
|
||||||
stopbuy
|
stopbuy
|
||||||
Stop buying (but handle sells gracefully).
|
Stop buying (but handle sells gracefully). Use `reload_config` to reset.
|
||||||
use reload_conf to reset
|
|
||||||
:returns: json object
|
trades
|
||||||
|
Return trades history.
|
||||||
|
|
||||||
|
:param limit: Limits trades to the X last trades. No limit to get all the trades.
|
||||||
|
|
||||||
version
|
version
|
||||||
Returns the version of the bot
|
Return the version of the bot.
|
||||||
:returns: json object containing the version
|
|
||||||
|
|
||||||
whitelist
|
whitelist
|
||||||
Show the current whitelist
|
Show the current whitelist.
|
||||||
:returns: json object
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Advanced API usage using JWT tokens
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
The below should be done in an application (a Freqtrade REST API client, which fetches info via API), and is not intended to be used on a regular basis.
|
||||||
|
|
||||||
|
Freqtrade's REST API also offers JWT (JSON Web Tokens).
|
||||||
|
You can login using the following command, and subsequently use the resulting access_token.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
> curl -X POST --user Freqtrader http://localhost:8080/api/v1/token/login
|
||||||
|
{"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1ODkxMTk2ODEsIm5iZiI6MTU4OTExOTY4MSwianRpIjoiMmEwYmY0NWUtMjhmOS00YTUzLTlmNzItMmM5ZWVlYThkNzc2IiwiZXhwIjoxNTg5MTIwNTgxLCJpZGVudGl0eSI6eyJ1IjoiRnJlcXRyYWRlciJ9LCJmcmVzaCI6ZmFsc2UsInR5cGUiOiJhY2Nlc3MifQ.qt6MAXYIa-l556OM7arBvYJ0SDI9J8bIk3_glDujF5g","refresh_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1ODkxMTk2ODEsIm5iZiI6MTU4OTExOTY4MSwianRpIjoiZWQ1ZWI3YjAtYjMwMy00YzAyLTg2N2MtNWViMjIxNWQ2YTMxIiwiZXhwIjoxNTkxNzExNjgxLCJpZGVudGl0eSI6eyJ1IjoiRnJlcXRyYWRlciJ9LCJ0eXBlIjoicmVmcmVzaCJ9.d1AT_jYICyTAjD0fiQAr52rkRqtxCjUGEMwlNuuzgNQ"}
|
||||||
|
|
||||||
|
> access_token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1ODkxMTk2ODEsIm5iZiI6MTU4OTExOTY4MSwianRpIjoiMmEwYmY0NWUtMjhmOS00YTUzLTlmNzItMmM5ZWVlYThkNzc2IiwiZXhwIjoxNTg5MTIwNTgxLCJpZGVudGl0eSI6eyJ1IjoiRnJlcXRyYWRlciJ9LCJmcmVzaCI6ZmFsc2UsInR5cGUiOiJhY2Nlc3MifQ.qt6MAXYIa-l556OM7arBvYJ0SDI9J8bIk3_glDujF5g"
|
||||||
|
# Use access_token for authentication
|
||||||
|
> curl -X GET --header "Authorization: Bearer ${access_token}" http://localhost:8080/api/v1/count
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Since the access token has a short timeout (15 min) - the `token/refresh` request should be used periodically to get a fresh access token:
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
> curl -X POST --header "Authorization: Bearer ${refresh_token}"http://localhost:8080/api/v1/token/refresh
|
||||||
|
{"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1ODkxMTk5NzQsIm5iZiI6MTU4OTExOTk3NCwianRpIjoiMDBjNTlhMWUtMjBmYS00ZTk0LTliZjAtNWQwNTg2MTdiZDIyIiwiZXhwIjoxNTg5MTIwODc0LCJpZGVudGl0eSI6eyJ1IjoiRnJlcXRyYWRlciJ9LCJmcmVzaCI6ZmFsc2UsInR5cGUiOiJhY2Nlc3MifQ.1seHlII3WprjjclY6DpRhen0rqdF4j6jbvxIhUFaSbs"}
|
||||||
|
```
|
||||||
|
|
||||||
|
## CORS
|
||||||
|
|
||||||
|
All web-based frontends are subject to [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) - Cross-Origin Resource Sharing.
|
||||||
|
Since most of the requests to the Freqtrade API must be authenticated, a proper CORS policy is key to avoid security problems.
|
||||||
|
Also, the standard disallows `*` CORS policies for requests with credentials, so this setting must be set appropriately.
|
||||||
|
|
||||||
|
Users can configure this themselves via the `CORS_origins` configuration setting.
|
||||||
|
It consists of a list of allowed sites that are allowed to consume resources from the bot's API.
|
||||||
|
|
||||||
|
Assuming your application is deployed as `https://frequi.freqtrade.io/home/` - this would mean that the following configuration becomes necessary:
|
||||||
|
|
||||||
|
```jsonc
|
||||||
|
{
|
||||||
|
//...
|
||||||
|
"jwt_secret_key": "somethingrandom",
|
||||||
|
"CORS_origins": ["https://frequi.freqtrade.io"],
|
||||||
|
//...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
We strongly recommend to also set `jwt_secret_key` to something random and known only to yourself to avoid unauthorized access to your bot.
|
||||||
|
|||||||
@@ -1,104 +1,59 @@
|
|||||||
# Sandbox API testing
|
# Sandbox API testing
|
||||||
|
|
||||||
Where an exchange provides a sandbox for risk-free integration, or end-to-end, testing CCXT provides access to these.
|
Some exchanges provide sandboxes or testbeds for risk-free testing, while running the bot against a real exchange.
|
||||||
|
With some configuration, freqtrade (in combination with ccxt) provides access to these.
|
||||||
|
|
||||||
This document is a *light overview of configuring Freqtrade and GDAX sandbox.
|
This document is an overview to configure Freqtrade to be used with sandboxes.
|
||||||
This can be useful to developers and trader alike as Freqtrade is quite customisable.
|
This can be useful to developers and trader alike.
|
||||||
|
|
||||||
When testing your API connectivity, make sure to use the following URLs.
|
## Exchanges known to have a sandbox / testnet
|
||||||
***Website**
|
|
||||||
https://public.sandbox.gdax.com
|
* [binance](https://testnet.binance.vision/)
|
||||||
***REST API**
|
* [coinbasepro](https://public.sandbox.pro.coinbase.com)
|
||||||
https://api-public.sandbox.gdax.com
|
* [gemini](https://exchange.sandbox.gemini.com/)
|
||||||
|
* [huobipro](https://www.testnet.huobi.pro/)
|
||||||
|
* [kucoin](https://sandbox.kucoin.com/)
|
||||||
|
* [phemex](https://testnet.phemex.com/)
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
We did not test correct functioning of all of the above testnets. Please report your experiences with each sandbox.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# Configure a Sandbox account on Gdax
|
## Configure a Sandbox account
|
||||||
|
|
||||||
Aim of this document section
|
When testing your API connectivity, make sure to use the appropriate sandbox / testnet URL.
|
||||||
|
|
||||||
- An sanbox account
|
In general, you should follow these steps to enable an exchange's sandbox:
|
||||||
- create 2FA (needed to create an API)
|
|
||||||
- Add test 50BTC to account
|
|
||||||
- Create :
|
|
||||||
- - API-KEY
|
|
||||||
- - API-Secret
|
|
||||||
- - API Password
|
|
||||||
|
|
||||||
## Acccount
|
* Figure out if an exchange has a sandbox (most likely by using google or the exchange's support documents)
|
||||||
|
* Create a sandbox account (often the sandbox-account requires separate registration)
|
||||||
|
* [Add some test assets to account](#add-test-funds)
|
||||||
|
* Create API keys
|
||||||
|
|
||||||
This link will redirect to the sandbox main page to login / create account dialogues:
|
### Add test funds
|
||||||
https://public.sandbox.pro.coinbase.com/orders/
|
|
||||||
|
|
||||||
After registration and Email confimation you wil be redirected into your sanbox account. It is easy to verify you're in sandbox by checking the URL bar.
|
Usually, sandbox exchanges allow depositing funds directly via web-interface.
|
||||||
> https://public.sandbox.pro.coinbase.com/
|
You should make sure to have a realistic amount of funds available to your test-account, so results are representable of your real account funds.
|
||||||
|
|
||||||
## Enable 2Fa (a prerequisite to creating sandbox API Keys)
|
!!! Warning
|
||||||
|
Test exchanges will **NEVER** require your real credit card or banking details!
|
||||||
|
|
||||||
From within sand box site select your profile, top right.
|
## Configure freqtrade to use a exchange's sandbox
|
||||||
>Or as a direct link: https://public.sandbox.pro.coinbase.com/profile
|
|
||||||
|
|
||||||
From the menu panel to the left of the screen select
|
### Sandbox URLs
|
||||||
|
|
||||||
> Security: "*View or Update*"
|
|
||||||
|
|
||||||
In the new site select "enable authenticator" as typical google Authenticator.
|
|
||||||
|
|
||||||
- open Google Authenticator on your phone
|
|
||||||
- scan barcode
|
|
||||||
- enter your generated 2fa
|
|
||||||
|
|
||||||
## Enable API Access
|
|
||||||
|
|
||||||
From within sandbox select profile>api>create api-keys
|
|
||||||
>or as a direct link: https://public.sandbox.pro.coinbase.com/profile/api
|
|
||||||
|
|
||||||
Click on "create one" and ensure **view** and **trade** are "checked" and sumbit your 2FA
|
|
||||||
|
|
||||||
- **Copy and paste the Passphase** into a notepade this will be needed later
|
|
||||||
- **Copy and paste the API Secret** popup into a notepad this will needed later
|
|
||||||
- **Copy and paste the API Key** into a notepad this will needed later
|
|
||||||
|
|
||||||
## Add 50 BTC test funds
|
|
||||||
|
|
||||||
To add funds, use the web interface deposit and withdraw buttons.
|
|
||||||
|
|
||||||
To begin select 'Wallets' from the top menu.
|
|
||||||
> Or as a direct link: https://public.sandbox.pro.coinbase.com/wallets
|
|
||||||
|
|
||||||
- Deposits (bottom left of screen)
|
|
||||||
- - Deposit Funds Bitcoin
|
|
||||||
- - - Coinbase BTC Wallet
|
|
||||||
- - - - Max (50 BTC)
|
|
||||||
- - - - - Deposit
|
|
||||||
|
|
||||||
*This process may be repeated for other currencies, ETH as example*
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Configure Freqtrade to use Gax Sandbox
|
|
||||||
|
|
||||||
The aim of this document section
|
|
||||||
|
|
||||||
- Enable sandbox URLs in Freqtrade
|
|
||||||
- Configure API
|
|
||||||
- - secret
|
|
||||||
- - key
|
|
||||||
- - passphrase
|
|
||||||
|
|
||||||
## Sandbox URLs
|
|
||||||
|
|
||||||
Freqtrade makes use of CCXT which in turn provides a list of URLs to Freqtrade.
|
Freqtrade makes use of CCXT which in turn provides a list of URLs to Freqtrade.
|
||||||
These include `['test']` and `['api']`.
|
These include `['test']` and `['api']`.
|
||||||
|
|
||||||
- `[Test]` if available will point to an Exchanges sandbox.
|
* `[Test]` if available will point to an Exchanges sandbox.
|
||||||
- `[Api]` normally used, and resolves to live API target on the exchange
|
* `[Api]` normally used, and resolves to live API target on the exchange.
|
||||||
|
|
||||||
To make use of sandbox / test add "sandbox": true, to your config.json
|
To make use of sandbox / test add "sandbox": true, to your config.json
|
||||||
|
|
||||||
```json
|
```json
|
||||||
"exchange": {
|
"exchange": {
|
||||||
"name": "gdax",
|
"name": "coinbasepro",
|
||||||
"sandbox": true,
|
"sandbox": true,
|
||||||
"key": "5wowfxemogxeowo;heiohgmd",
|
"key": "5wowfxemogxeowo;heiohgmd",
|
||||||
"secret": "/ZMH1P62rCVmwefewrgcewX8nh4gob+lywxfwfxwwfxwfNsH1ySgvWCUR/w==",
|
"secret": "/ZMH1P62rCVmwefewrgcewX8nh4gob+lywxfwfxwwfxwfNsH1ySgvWCUR/w==",
|
||||||
@@ -106,36 +61,57 @@ To make use of sandbox / test add "sandbox": true, to your config.json
|
|||||||
"outdated_offset": 5
|
"outdated_offset": 5
|
||||||
"pair_whitelist": [
|
"pair_whitelist": [
|
||||||
"BTC/USD"
|
"BTC/USD"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"datadir": "user_data/data/coinbasepro_sandbox"
|
||||||
```
|
```
|
||||||
|
|
||||||
Also insert your
|
Also the following information:
|
||||||
|
|
||||||
- api-key (noted earlier)
|
* api-key (created for the sandbox webpage)
|
||||||
- api-secret (noted earlier)
|
* api-secret (noted earlier)
|
||||||
- password (the passphrase - noted earlier)
|
* password (the passphrase - noted earlier)
|
||||||
|
|
||||||
|
!!! Tip "Different data directory"
|
||||||
|
We also recommend to set `datadir` to something identifying downloaded data as sandbox data, to avoid having sandbox data mixed with data from the real exchange.
|
||||||
|
This can be done by adding the `"datadir"` key to the configuration.
|
||||||
|
Now, whenever you use this configuration, your data directory will be set to this directory.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## You should now be ready to test your sandbox
|
## You should now be ready to test your sandbox
|
||||||
|
|
||||||
Ensure Freqtrade logs show the sandbox URL, and trades made are shown in sandbox.
|
Ensure Freqtrade logs show the sandbox URL, and trades made are shown in sandbox. Also make sure to select a pair which shows at least some decent value (which very often is BTC/<somestablecoin>).
|
||||||
** Typically the BTC/USD has the most activity in sandbox to test against.
|
|
||||||
|
|
||||||
## GDAX - Old Candles problem
|
## Common problems with sandbox exchanges
|
||||||
|
|
||||||
It is my experience that GDAX sandbox candles may be 20+- minutes out of date. This can cause trades to fail as one of Freqtrades safety checks.
|
Sandbox exchange instances often have very low volume, which can cause some problems which usually are not seen on a real exchange instance.
|
||||||
|
|
||||||
To disable this check, add / change the `"outdated_offset"` parameter in the exchange section of your configuration to adjust for this delay.
|
### Old Candles problem
|
||||||
Example based on the above configuration:
|
|
||||||
|
|
||||||
```json
|
Since Sandboxes often have low volume, candles can be quite old and show no volume.
|
||||||
"exchange": {
|
To disable the error "Outdated history for pair ...", best increase the parameter `"outdated_offset"` to a number that seems realistic for the sandbox you're using.
|
||||||
"name": "gdax",
|
|
||||||
"sandbox": true,
|
### Unfilled orders
|
||||||
"key": "5wowfxemogxeowo;heiohgmd",
|
|
||||||
"secret": "/ZMH1P62rCVmwefewrgcewX8nh4gob+lywxfwfxwwfxwfNsH1ySgvWCUR/w==",
|
Sandboxes often have very low volumes - which means that many trades can go unfilled, or can go unfilled for a very long time.
|
||||||
"password": "1bkjfkhfhfu6sr",
|
|
||||||
"outdated_offset": 30
|
To mitigate this, you can try to match the first order on the opposite orderbook side using the following configuration:
|
||||||
"pair_whitelist": [
|
|
||||||
"BTC/USD"
|
``` jsonc
|
||||||
```
|
"order_types": {
|
||||||
|
"buy": "limit",
|
||||||
|
"sell": "limit"
|
||||||
|
// ...
|
||||||
|
},
|
||||||
|
"bid_strategy": {
|
||||||
|
"price_side": "ask",
|
||||||
|
// ...
|
||||||
|
},
|
||||||
|
"ask_strategy":{
|
||||||
|
"price_side": "bid",
|
||||||
|
// ...
|
||||||
|
},
|
||||||
|
```
|
||||||
|
|
||||||
|
The configuration is similar to the suggested configuration for market orders - however by using limit-orders you can avoid moving the price too much, and you can set the worst price you might get.
|
||||||
|
|||||||
@@ -1,13 +1,29 @@
|
|||||||
# SQL Helper
|
# SQL Helper
|
||||||
|
|
||||||
This page contains some help if you want to edit your sqlite db.
|
This page contains some help if you want to edit your sqlite db.
|
||||||
|
|
||||||
## Install sqlite3
|
## Install sqlite3
|
||||||
**Ubuntu/Debian installation**
|
|
||||||
|
Sqlite3 is a terminal based sqlite application.
|
||||||
|
Feel free to use a visual Database editor like SqliteBrowser if you feel more comfortable with that.
|
||||||
|
|
||||||
|
### Ubuntu/Debian installation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get install sqlite3
|
sudo apt-get install sqlite3
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Using sqlite3 via docker-compose
|
||||||
|
|
||||||
|
The freqtrade docker image does contain sqlite3, so you can edit the database without having to install anything on the host system.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
docker-compose exec freqtrade /bin/bash
|
||||||
|
sqlite3 <databasefile>.sqlite
|
||||||
|
```
|
||||||
|
|
||||||
## Open the DB
|
## Open the DB
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sqlite3
|
sqlite3
|
||||||
.open <filepath>
|
.open <filepath>
|
||||||
@@ -16,45 +32,61 @@ sqlite3
|
|||||||
## Table structure
|
## Table structure
|
||||||
|
|
||||||
### List tables
|
### List tables
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
.tables
|
.tables
|
||||||
```
|
```
|
||||||
|
|
||||||
### Display table structure
|
### Display table structure
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
.schema <table_name>
|
.schema <table_name>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Trade table structure
|
### Trade table structure
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
CREATE TABLE trades (
|
CREATE TABLE trades(
|
||||||
id INTEGER NOT NULL,
|
id INTEGER NOT NULL,
|
||||||
exchange VARCHAR NOT NULL,
|
exchange VARCHAR NOT NULL,
|
||||||
pair VARCHAR NOT NULL,
|
pair VARCHAR NOT NULL,
|
||||||
is_open BOOLEAN NOT NULL,
|
is_open BOOLEAN NOT NULL,
|
||||||
fee_open FLOAT NOT NULL,
|
fee_open FLOAT NOT NULL,
|
||||||
fee_close FLOAT NOT NULL,
|
fee_open_cost FLOAT,
|
||||||
open_rate FLOAT,
|
fee_open_currency VARCHAR,
|
||||||
open_rate_requested FLOAT,
|
fee_close FLOAT NOT NULL,
|
||||||
close_rate FLOAT,
|
fee_close_cost FLOAT,
|
||||||
close_rate_requested FLOAT,
|
fee_close_currency VARCHAR,
|
||||||
close_profit FLOAT,
|
open_rate FLOAT,
|
||||||
stake_amount FLOAT NOT NULL,
|
open_rate_requested FLOAT,
|
||||||
amount FLOAT,
|
open_trade_price FLOAT,
|
||||||
open_date DATETIME NOT NULL,
|
close_rate FLOAT,
|
||||||
close_date DATETIME,
|
close_rate_requested FLOAT,
|
||||||
open_order_id VARCHAR,
|
close_profit FLOAT,
|
||||||
stop_loss FLOAT,
|
close_profit_abs FLOAT,
|
||||||
initial_stop_loss FLOAT,
|
stake_amount FLOAT NOT NULL,
|
||||||
stoploss_order_id VARCHAR,
|
amount FLOAT,
|
||||||
stoploss_last_update DATETIME,
|
open_date DATETIME NOT NULL,
|
||||||
max_rate FLOAT,
|
close_date DATETIME,
|
||||||
sell_reason VARCHAR,
|
open_order_id VARCHAR,
|
||||||
strategy VARCHAR,
|
stop_loss FLOAT,
|
||||||
ticker_interval INTEGER,
|
stop_loss_pct FLOAT,
|
||||||
PRIMARY KEY (id),
|
initial_stop_loss FLOAT,
|
||||||
CHECK (is_open IN (0, 1))
|
initial_stop_loss_pct FLOAT,
|
||||||
|
stoploss_order_id VARCHAR,
|
||||||
|
stoploss_last_update DATETIME,
|
||||||
|
max_rate FLOAT,
|
||||||
|
min_rate FLOAT,
|
||||||
|
sell_reason VARCHAR,
|
||||||
|
strategy VARCHAR,
|
||||||
|
timeframe INTEGER,
|
||||||
|
PRIMARY KEY (id),
|
||||||
|
CHECK (is_open IN (0, 1))
|
||||||
);
|
);
|
||||||
|
CREATE INDEX ix_trades_stoploss_order_id ON trades (stoploss_order_id);
|
||||||
|
CREATE INDEX ix_trades_pair ON trades (pair);
|
||||||
|
CREATE INDEX ix_trades_is_open ON trades (is_open);
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Get all trades in the table
|
## Get all trades in the table
|
||||||
@@ -67,42 +99,60 @@ SELECT * FROM trades;
|
|||||||
|
|
||||||
!!! Warning
|
!!! Warning
|
||||||
Manually selling a pair on the exchange will not be detected by the bot and it will try to sell anyway. Whenever possible, forcesell <tradeid> should be used to accomplish the same thing.
|
Manually selling a pair on the exchange will not be detected by the bot and it will try to sell anyway. Whenever possible, forcesell <tradeid> should be used to accomplish the same thing.
|
||||||
It is strongly advised to backup your database file before making any manual changes.
|
It is strongly advised to backup your database file before making any manual changes.
|
||||||
|
|
||||||
!!! Note
|
!!! Note
|
||||||
This should not be necessary after /forcesell, as forcesell orders are closed automatically by the bot on the next iteration.
|
This should not be necessary after /forcesell, as forcesell orders are closed automatically by the bot on the next iteration.
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
UPDATE trades
|
UPDATE trades
|
||||||
SET is_open=0, close_date=<close_date>, close_rate=<close_rate>, close_profit=close_rate/open_rate-1, sell_reason=<sell_reason>
|
SET is_open=0,
|
||||||
|
close_date=<close_date>,
|
||||||
|
close_rate=<close_rate>,
|
||||||
|
close_profit = close_rate / open_rate - 1,
|
||||||
|
close_profit_abs = (amount * <close_rate> * (1 - fee_close) - (amount * (open_rate * (1 - fee_open)))),
|
||||||
|
sell_reason=<sell_reason>
|
||||||
WHERE id=<trade_ID_to_update>;
|
WHERE id=<trade_ID_to_update>;
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Example
|
### Example
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
UPDATE trades
|
UPDATE trades
|
||||||
SET is_open=0, close_date='2017-12-20 03:08:45.103418', close_rate=0.19638016, close_profit=0.0496, sell_reason='force_sell'
|
SET is_open=0,
|
||||||
|
close_date='2020-06-20 03:08:45.103418',
|
||||||
|
close_rate=0.19638016,
|
||||||
|
close_profit=0.0496,
|
||||||
|
close_profit_abs = (amount * 0.19638016 * (1 - fee_close) - (amount * (open_rate * (1 - fee_open)))),
|
||||||
|
sell_reason='force_sell'
|
||||||
WHERE id=31;
|
WHERE id=31;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Insert manually a new trade
|
## Manually insert a new trade
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
INSERT INTO trades (exchange, pair, is_open, fee_open, fee_close, open_rate, stake_amount, amount, open_date)
|
INSERT INTO trades (exchange, pair, is_open, fee_open, fee_close, open_rate, stake_amount, amount, open_date)
|
||||||
VALUES ('bittrex', 'ETH/BTC', 1, 0.0025, 0.0025, <open_rate>, <stake_amount>, <amount>, '<datetime>')
|
VALUES ('binance', 'ETH/BTC', 1, 0.0025, 0.0025, <open_rate>, <stake_amount>, <amount>, '<datetime>')
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Example:
|
### Insert trade example
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
INSERT INTO trades (exchange, pair, is_open, fee_open, fee_close, open_rate, stake_amount, amount, open_date)
|
INSERT INTO trades (exchange, pair, is_open, fee_open, fee_close, open_rate, stake_amount, amount, open_date)
|
||||||
VALUES ('bittrex', 'ETH/BTC', 1, 0.0025, 0.0025, 0.00258580, 0.002, 0.7715262081, '2017-11-28 12:44:24.000000')
|
VALUES ('binance', 'ETH/BTC', 1, 0.0025, 0.0025, 0.00258580, 0.002, 0.7715262081, '2020-06-28 12:44:24.000000')
|
||||||
```
|
```
|
||||||
|
|
||||||
## Fix wrong fees in the table
|
## Remove trade from the database
|
||||||
If your DB was created before [PR#200](https://github.com/freqtrade/freqtrade/pull/200) was merged (before 12/23/17).
|
|
||||||
|
Maybe you'd like to remove a trade from the database, because something went wrong.
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
UPDATE trades SET fee=0.0025 WHERE fee=0.005;
|
DELETE FROM trades WHERE id = <tradeid>;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```sql
|
||||||
|
DELETE FROM trades WHERE id = 31;
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Warning
|
||||||
|
This will remove this trade from the database. Please make sure you got the correct id and **NEVER** run this query without the `where` clause.
|
||||||
|
|||||||
208
docs/stoploss.md
208
docs/stoploss.md
@@ -1,80 +1,182 @@
|
|||||||
# Stop Loss
|
# Stop Loss
|
||||||
|
|
||||||
The `stoploss` configuration parameter is loss in percentage that should trigger a sale.
|
The `stoploss` configuration parameter is loss as ratio that should trigger a sale.
|
||||||
For example, value `-0.10` will cause immediate sell if the profit dips below -10% for a given trade. This parameter is optional.
|
For example, value `-0.10` will cause immediate sell if the profit dips below -10% for a given trade. This parameter is optional.
|
||||||
|
|
||||||
Most of the strategy files already include the optimal `stoploss`
|
Most of the strategy files already include the optimal `stoploss` value.
|
||||||
value. This parameter is optional. If you use it in the configuration file, it will take over the
|
|
||||||
`stoploss` value from the strategy file.
|
|
||||||
|
|
||||||
## Stop Loss support
|
!!! Info
|
||||||
|
All stoploss properties mentioned in this file can be set in the Strategy, or in the configuration.
|
||||||
|
<ins>Configuration values will override the strategy values.</ins>
|
||||||
|
|
||||||
|
## Stop Loss On-Exchange/Freqtrade
|
||||||
|
|
||||||
|
Those stoploss modes can be *on exchange* or *off exchange*.
|
||||||
|
|
||||||
|
These modes can be configured with these values:
|
||||||
|
|
||||||
|
``` python
|
||||||
|
'emergencysell': 'market',
|
||||||
|
'stoploss_on_exchange': False
|
||||||
|
'stoploss_on_exchange_interval': 60,
|
||||||
|
'stoploss_on_exchange_limit_ratio': 0.99
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
Stoploss on exchange is only supported for Binance (stop-loss-limit), Kraken (stop-loss-market) and FTX (stop limit and stop-market) as of now.
|
||||||
|
<ins>Do not set too low stoploss value if using stop loss on exchange!</ins>
|
||||||
|
If set to low/tight then you have greater risk of missing fill on the order and stoploss will not work
|
||||||
|
|
||||||
|
### stoploss_on_exchange and stoploss_on_exchange_limit_ratio
|
||||||
|
Enable or Disable stop loss on exchange.
|
||||||
|
If the stoploss is *on exchange* it means a stoploss limit order is placed on the exchange immediately after buy order happens successfully. This will protect you against sudden crashes in market as the order will be in the queue immediately and if market goes down then the order has more chance of being fulfilled.
|
||||||
|
|
||||||
|
If `stoploss_on_exchange` uses limit orders, the exchange needs 2 prices, the stoploss_price and the Limit price.
|
||||||
|
`stoploss` defines the stop-price where the limit order is placed - and limit should be slightly below this.
|
||||||
|
If an exchange supports both limit and market stoploss orders, then the value of `stoploss` will be used to determine the stoploss type.
|
||||||
|
|
||||||
|
Calculation example: we bought the asset at 100$.
|
||||||
|
Stop-price is 95$, then limit would be `95 * 0.99 = 94.05$` - so the limit order fill can happen between 95$ and 94.05$.
|
||||||
|
|
||||||
|
For example, assuming the stoploss is on exchange, and trailing stoploss is enabled, and the market is going up, then the bot automatically cancels the previous stoploss order and puts a new one with a stop value higher than the previous stoploss order.
|
||||||
|
|
||||||
|
### stoploss_on_exchange_interval
|
||||||
|
In case of stoploss on exchange there is another parameter called `stoploss_on_exchange_interval`. This configures the interval in seconds at which the bot will check the stoploss and update it if necessary.
|
||||||
|
The bot cannot do these every 5 seconds (at each iteration), otherwise it would get banned by the exchange.
|
||||||
|
So this parameter will tell the bot how often it should update the stoploss order. The default value is 60 (1 minute).
|
||||||
|
This same logic will reapply a stoploss order on the exchange should you cancel it accidentally.
|
||||||
|
|
||||||
|
### emergencysell
|
||||||
|
`emergencysell` is an optional value, which defaults to `market` and is used when creating stop loss on exchange orders fails.
|
||||||
|
The below is the default which is used if not changed in strategy or configuration file.
|
||||||
|
|
||||||
|
Example from strategy file:
|
||||||
|
|
||||||
|
``` python
|
||||||
|
order_types = {
|
||||||
|
'buy': 'limit',
|
||||||
|
'sell': 'limit',
|
||||||
|
'emergencysell': 'market',
|
||||||
|
'stoploss': 'market',
|
||||||
|
'stoploss_on_exchange': True,
|
||||||
|
'stoploss_on_exchange_interval': 60,
|
||||||
|
'stoploss_on_exchange_limit_ratio': 0.99
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Stop Loss Types
|
||||||
|
|
||||||
At this stage the bot contains the following stoploss support modes:
|
At this stage the bot contains the following stoploss support modes:
|
||||||
|
|
||||||
1. static stop loss, defined in either the strategy or configuration.
|
1. Static stop loss.
|
||||||
2. trailing stop loss, defined in the configuration.
|
2. Trailing stop loss.
|
||||||
3. trailing stop loss, custom positive loss, defined in configuration.
|
3. Trailing stop loss, custom positive loss.
|
||||||
|
4. Trailing stop loss only once the trade has reached a certain offset.
|
||||||
|
|
||||||
!!! Note
|
### Static Stop Loss
|
||||||
All stoploss properties can be configured in either Strategy or configuration. Configuration values override strategy values.
|
|
||||||
|
|
||||||
Those stoploss modes can be *on exchange* or *off exchange*. If the stoploss is *on exchange* it means a stoploss limit order is placed on the exchange immediately after buy order happens successfuly. This will protect you against sudden crashes in market as the order will be in the queue immediately and if market goes down then the order has more chance of being fulfilled.
|
This is very simple, you define a stop loss of x (as a ratio of price, i.e. x * 100% of price). This will try to sell the asset once the loss exceeds the defined loss.
|
||||||
|
|
||||||
In case of stoploss on exchange there is another parameter called `stoploss_on_exchange_interval`. This configures the interval in seconds at which the bot will check the stoploss and update it if necessary. As an example in case of trailing stoploss if the order is on the exchange and the market is going up then the bot automatically cancels the previous stoploss order and put a new one with a stop value higher than previous one. It is clear that the bot cannot do it every 5 seconds otherwise it gets banned. So this parameter will tell the bot how often it should update the stoploss order. The default value is 60 (1 minute).
|
Example of stop loss:
|
||||||
|
|
||||||
!!! Note
|
``` python
|
||||||
Stoploss on exchange is only supported for Binance as of now.
|
stoploss = -0.10
|
||||||
|
|
||||||
## Static Stop Loss
|
|
||||||
|
|
||||||
This is very simple, basically you define a stop loss of x in your strategy file or alternative in the configuration, which
|
|
||||||
will overwrite the strategy definition. This will basically try to sell your asset, the second the loss exceeds the defined loss.
|
|
||||||
|
|
||||||
## Trailing Stop Loss
|
|
||||||
|
|
||||||
The initial value for this stop loss, is defined in your strategy or configuration. Just as you would define your Stop Loss normally.
|
|
||||||
To enable this Feauture all you have to do is to define the configuration element:
|
|
||||||
|
|
||||||
``` json
|
|
||||||
"trailing_stop" : True
|
|
||||||
```
|
```
|
||||||
|
|
||||||
This will now activate an algorithm, which automatically moves your stop loss up every time the price of your asset increases.
|
For example, simplified math:
|
||||||
|
* the bot buys an asset at a price of 100$
|
||||||
|
* the stop loss is defined at -10%
|
||||||
|
* the stop loss would get triggered once the asset drops below 90$
|
||||||
|
|
||||||
For example, simplified math,
|
### Trailing Stop Loss
|
||||||
|
|
||||||
* you buy an asset at a price of 100$
|
The initial value for this is `stoploss`, just as you would define your static Stop loss.
|
||||||
* your stop loss is defined at 2%
|
To enable trailing stoploss:
|
||||||
* which means your stop loss, gets triggered once your asset dropped below 98$
|
|
||||||
* assuming your asset now increases to 102$
|
|
||||||
* your stop loss, will now be 2% of 102$ or 99.96$
|
|
||||||
* now your asset drops in value to 101$, your stop loss, will still be 99.96$
|
|
||||||
|
|
||||||
basically what this means is that your stop loss will be adjusted to be always be 2% of the highest observed price
|
``` python
|
||||||
|
stoploss = -0.10
|
||||||
### Custom positive loss
|
trailing_stop = True
|
||||||
|
|
||||||
Due to demand, it is possible to have a default stop loss, when you are in the red with your buy, but once your profit surpasses a certain percentage,
|
|
||||||
the system will utilize a new stop loss, which can be a different value. For example your default stop loss is 5%, but once you have 1.1% profit,
|
|
||||||
it will be changed to be only a 1% stop loss, which trails the green candles until it goes below them.
|
|
||||||
|
|
||||||
Both values can be configured in the main configuration file and requires `"trailing_stop": true` to be set to true.
|
|
||||||
|
|
||||||
``` json
|
|
||||||
"trailing_stop_positive": 0.01,
|
|
||||||
"trailing_stop_positive_offset": 0.011,
|
|
||||||
"trailing_only_offset_is_reached": false
|
|
||||||
```
|
```
|
||||||
|
|
||||||
The 0.01 would translate to a 1% stop loss, once you hit 1.1% profit.
|
This will now activate an algorithm, which automatically moves the stop loss up every time the price of your asset increases.
|
||||||
|
|
||||||
You should also make sure to have this value (`trailing_stop_positive_offset`) lower than your minimal ROI, otherwise minimal ROI will apply first and sell your trade.
|
For example, simplified math:
|
||||||
|
|
||||||
If `"trailing_only_offset_is_reached": true` then the trailing stoploss is only activated once the offset is reached. Until then, the stoploss remains at the configured`stoploss`.
|
* the bot buys an asset at a price of 100$
|
||||||
|
* the stop loss is defined at -10%
|
||||||
|
* the stop loss would get triggered once the asset drops below 90$
|
||||||
|
* assuming the asset now increases to 102$
|
||||||
|
* the stop loss will now be -10% of 102$ = 91.8$
|
||||||
|
* now the asset drops in value to 101$, the stop loss will still be 91.8$ and would trigger at 91.8$.
|
||||||
|
|
||||||
|
In summary: The stoploss will be adjusted to be always be -10% of the highest observed price.
|
||||||
|
|
||||||
|
### Trailing stop loss, custom positive loss
|
||||||
|
|
||||||
|
It is also possible to have a default stop loss, when you are in the red with your buy (buy - fee), but once you hit positive result the system will utilize a new stop loss, which can have a different value.
|
||||||
|
For example, your default stop loss is -10%, but once you have more than 0% profit (example 0.1%) a different trailing stoploss will be used.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
If you want the stoploss to only be changed when you break even of making a profit (what most users want) please refer to next section with [offset enabled](#Trailing-stop-loss-only-once-the-trade-has-reached-a-certain-offset).
|
||||||
|
|
||||||
|
Both values require `trailing_stop` to be set to true and `trailing_stop_positive` with a value.
|
||||||
|
|
||||||
|
``` python
|
||||||
|
stoploss = -0.10
|
||||||
|
trailing_stop = True
|
||||||
|
trailing_stop_positive = 0.02
|
||||||
|
```
|
||||||
|
|
||||||
|
For example, simplified math:
|
||||||
|
|
||||||
|
* the bot buys an asset at a price of 100$
|
||||||
|
* the stop loss is defined at -10%
|
||||||
|
* the stop loss would get triggered once the asset drops below 90$
|
||||||
|
* assuming the asset now increases to 102$
|
||||||
|
* the stop loss will now be -2% of 102$ = 99.96$ (99.96$ stop loss will be locked in and will follow asset price increasements with -2%)
|
||||||
|
* now the asset drops in value to 101$, the stop loss will still be 99.96$ and would trigger at 99.96$
|
||||||
|
|
||||||
|
The 0.02 would translate to a -2% stop loss.
|
||||||
|
Before this, `stoploss` is used for the trailing stoploss.
|
||||||
|
|
||||||
|
### Trailing stop loss only once the trade has reached a certain offset
|
||||||
|
|
||||||
|
It is also possible to use a static stoploss until the offset is reached, and then trail the trade to take profits once the market turns.
|
||||||
|
|
||||||
|
If `"trailing_only_offset_is_reached": true` then the trailing stoploss is only activated once the offset is reached. Until then, the stoploss remains at the configured `stoploss`.
|
||||||
|
This option can be used with or without `trailing_stop_positive`, but uses `trailing_stop_positive_offset` as offset.
|
||||||
|
|
||||||
|
``` python
|
||||||
|
trailing_stop_positive_offset = 0.011
|
||||||
|
trailing_only_offset_is_reached = True
|
||||||
|
```
|
||||||
|
|
||||||
|
Configuration (offset is buyprice + 3%):
|
||||||
|
|
||||||
|
``` python
|
||||||
|
stoploss = -0.10
|
||||||
|
trailing_stop = True
|
||||||
|
trailing_stop_positive = 0.02
|
||||||
|
trailing_stop_positive_offset = 0.03
|
||||||
|
trailing_only_offset_is_reached = True
|
||||||
|
```
|
||||||
|
|
||||||
|
For example, simplified math:
|
||||||
|
|
||||||
|
* the bot buys an asset at a price of 100$
|
||||||
|
* the stop loss is defined at -10%
|
||||||
|
* the stop loss would get triggered once the asset drops below 90$
|
||||||
|
* stoploss will remain at 90$ unless asset increases to or above our configured offset
|
||||||
|
* assuming the asset now increases to 103$ (where we have the offset configured)
|
||||||
|
* the stop loss will now be -2% of 103$ = 100.94$
|
||||||
|
* now the asset drops in value to 101$, the stop loss will still be 100.94$ and would trigger at 100.94$
|
||||||
|
|
||||||
|
!!! Tip
|
||||||
|
Make sure to have this value (`trailing_stop_positive_offset`) lower than minimal ROI, otherwise minimal ROI will apply first and sell the trade.
|
||||||
|
|
||||||
## Changing stoploss on open trades
|
## Changing stoploss on open trades
|
||||||
|
|
||||||
A stoploss on an open trade can be changed by changing the value in the configuration or strategy and use the `/reload_conf` command (alternatively, completely stopping and restarting the bot also works).
|
A stoploss on an open trade can be changed by changing the value in the configuration or strategy and use the `/reload_config` command (alternatively, completely stopping and restarting the bot also works).
|
||||||
|
|
||||||
The new stoploss value will be applied to open trades (and corresponding log-messages will be generated).
|
The new stoploss value will be applied to open trades (and corresponding log-messages will be generated).
|
||||||
|
|
||||||
|
|||||||
222
docs/strategy-advanced.md
Normal file
222
docs/strategy-advanced.md
Normal file
@@ -0,0 +1,222 @@
|
|||||||
|
# Advanced Strategies
|
||||||
|
|
||||||
|
This page explains some advanced concepts available for strategies.
|
||||||
|
If you're just getting started, please be familiar with the methods described in the [Strategy Customization](strategy-customization.md) documentation and with the [Freqtrade basics](bot-basics.md) first.
|
||||||
|
|
||||||
|
[Freqtrade basics](bot-basics.md) describes in which sequence each method described below is called, which can be helpful to understand which method to use for your custom needs.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
All callback methods described below should only be implemented in a strategy if they are actually used.
|
||||||
|
|
||||||
|
## Custom order timeout rules
|
||||||
|
|
||||||
|
Simple, timebased order-timeouts can be configured either via strategy or in the configuration in the `unfilledtimeout` section.
|
||||||
|
|
||||||
|
However, freqtrade also offers a custom callback for both ordertypes, which allows you to decide based on custom criteria if a order did time out or not.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
Unfilled order timeouts are not relevant during backtesting or hyperopt, and are only relevant during real (live) trading. Therefore these methods are only called in these circumstances.
|
||||||
|
|
||||||
|
### Custom order timeout example
|
||||||
|
|
||||||
|
A simple example, which applies different unfilled-timeouts depending on the price of the asset can be seen below.
|
||||||
|
It applies a tight timeout for higher priced assets, while allowing more time to fill on cheap coins.
|
||||||
|
|
||||||
|
The function must return either `True` (cancel order) or `False` (keep order alive).
|
||||||
|
|
||||||
|
``` python
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
from freqtrade.persistence import Trade
|
||||||
|
|
||||||
|
class Awesomestrategy(IStrategy):
|
||||||
|
|
||||||
|
# ... populate_* methods
|
||||||
|
|
||||||
|
# Set unfilledtimeout to 25 hours, since our maximum timeout from below is 24 hours.
|
||||||
|
unfilledtimeout = {
|
||||||
|
'buy': 60 * 25,
|
||||||
|
'sell': 60 * 25
|
||||||
|
}
|
||||||
|
|
||||||
|
def check_buy_timeout(self, pair: str, trade: 'Trade', order: dict, **kwargs) -> bool:
|
||||||
|
if trade.open_rate > 100 and trade.open_date < datetime.utcnow() - timedelta(minutes=5):
|
||||||
|
return True
|
||||||
|
elif trade.open_rate > 10 and trade.open_date < datetime.utcnow() - timedelta(minutes=3):
|
||||||
|
return True
|
||||||
|
elif trade.open_rate < 1 and trade.open_date < datetime.utcnow() - timedelta(hours=24):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def check_sell_timeout(self, pair: str, trade: 'Trade', order: dict, **kwargs) -> bool:
|
||||||
|
if trade.open_rate > 100 and trade.open_date < datetime.utcnow() - timedelta(minutes=5):
|
||||||
|
return True
|
||||||
|
elif trade.open_rate > 10 and trade.open_date < datetime.utcnow() - timedelta(minutes=3):
|
||||||
|
return True
|
||||||
|
elif trade.open_rate < 1 and trade.open_date < datetime.utcnow() - timedelta(hours=24):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
For the above example, `unfilledtimeout` must be set to something bigger than 24h, otherwise that type of timeout will apply first.
|
||||||
|
|
||||||
|
### Custom order timeout example (using additional data)
|
||||||
|
|
||||||
|
``` python
|
||||||
|
from datetime import datetime
|
||||||
|
from freqtrade.persistence import Trade
|
||||||
|
|
||||||
|
class Awesomestrategy(IStrategy):
|
||||||
|
|
||||||
|
# ... populate_* methods
|
||||||
|
|
||||||
|
# Set unfilledtimeout to 25 hours, since our maximum timeout from below is 24 hours.
|
||||||
|
unfilledtimeout = {
|
||||||
|
'buy': 60 * 25,
|
||||||
|
'sell': 60 * 25
|
||||||
|
}
|
||||||
|
|
||||||
|
def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:
|
||||||
|
ob = self.dp.orderbook(pair, 1)
|
||||||
|
current_price = ob['bids'][0][0]
|
||||||
|
# Cancel buy order if price is more than 2% above the order.
|
||||||
|
if current_price > order['price'] * 1.02:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:
|
||||||
|
ob = self.dp.orderbook(pair, 1)
|
||||||
|
current_price = ob['asks'][0][0]
|
||||||
|
# Cancel sell order if price is more than 2% below the order.
|
||||||
|
if current_price < order['price'] * 0.98:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
```
|
||||||
|
|
||||||
|
## Bot loop start callback
|
||||||
|
|
||||||
|
A simple callback which is called once at the start of every bot throttling iteration.
|
||||||
|
This can be used to perform calculations which are pair independent (apply to all pairs), loading of external data, etc.
|
||||||
|
|
||||||
|
``` python
|
||||||
|
import requests
|
||||||
|
|
||||||
|
class Awesomestrategy(IStrategy):
|
||||||
|
|
||||||
|
# ... populate_* methods
|
||||||
|
|
||||||
|
def bot_loop_start(self, **kwargs) -> None:
|
||||||
|
"""
|
||||||
|
Called at the start of the bot iteration (one loop).
|
||||||
|
Might be used to perform pair-independent tasks
|
||||||
|
(e.g. gather some remote resource for comparison)
|
||||||
|
:param **kwargs: Ensure to keep this here so updates to this won't break your strategy.
|
||||||
|
"""
|
||||||
|
if self.config['runmode'].value in ('live', 'dry_run'):
|
||||||
|
# Assign this to the class by using self.*
|
||||||
|
# can then be used by populate_* methods
|
||||||
|
self.remote_data = requests.get('https://some_remote_source.example.com')
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Bot order confirmation
|
||||||
|
|
||||||
|
### Trade entry (buy order) confirmation
|
||||||
|
|
||||||
|
`confirm_trade_entry()` can be used to abort a trade entry at the latest second (maybe because the price is not what we expect).
|
||||||
|
|
||||||
|
``` python
|
||||||
|
class Awesomestrategy(IStrategy):
|
||||||
|
|
||||||
|
# ... populate_* methods
|
||||||
|
|
||||||
|
def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float,
|
||||||
|
time_in_force: str, **kwargs) -> bool:
|
||||||
|
"""
|
||||||
|
Called right before placing a buy order.
|
||||||
|
Timing for this function is critical, so avoid doing heavy computations or
|
||||||
|
network requests in this method.
|
||||||
|
|
||||||
|
For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/
|
||||||
|
|
||||||
|
When not implemented by a strategy, returns True (always confirming).
|
||||||
|
|
||||||
|
:param pair: Pair that's about to be bought.
|
||||||
|
:param order_type: Order type (as configured in order_types). usually limit or market.
|
||||||
|
:param amount: Amount in target (quote) currency that's going to be traded.
|
||||||
|
:param rate: Rate that's going to be used when using limit orders
|
||||||
|
:param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).
|
||||||
|
:param **kwargs: Ensure to keep this here so updates to this won't break your strategy.
|
||||||
|
:return bool: When True is returned, then the buy-order is placed on the exchange.
|
||||||
|
False aborts the process
|
||||||
|
"""
|
||||||
|
return True
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Trade exit (sell order) confirmation
|
||||||
|
|
||||||
|
`confirm_trade_exit()` can be used to abort a trade exit (sell) at the latest second (maybe because the price is not what we expect).
|
||||||
|
|
||||||
|
``` python
|
||||||
|
from freqtrade.persistence import Trade
|
||||||
|
|
||||||
|
|
||||||
|
class Awesomestrategy(IStrategy):
|
||||||
|
|
||||||
|
# ... populate_* methods
|
||||||
|
|
||||||
|
def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,
|
||||||
|
rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:
|
||||||
|
"""
|
||||||
|
Called right before placing a regular sell order.
|
||||||
|
Timing for this function is critical, so avoid doing heavy computations or
|
||||||
|
network requests in this method.
|
||||||
|
|
||||||
|
For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/
|
||||||
|
|
||||||
|
When not implemented by a strategy, returns True (always confirming).
|
||||||
|
|
||||||
|
:param pair: Pair that's about to be sold.
|
||||||
|
:param order_type: Order type (as configured in order_types). usually limit or market.
|
||||||
|
:param amount: Amount in quote currency.
|
||||||
|
:param rate: Rate that's going to be used when using limit orders
|
||||||
|
:param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).
|
||||||
|
:param sell_reason: Sell reason.
|
||||||
|
Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',
|
||||||
|
'sell_signal', 'force_sell', 'emergency_sell']
|
||||||
|
:param **kwargs: Ensure to keep this here so updates to this won't break your strategy.
|
||||||
|
:return bool: When True is returned, then the sell-order is placed on the exchange.
|
||||||
|
False aborts the process
|
||||||
|
"""
|
||||||
|
if sell_reason == 'force_sell' and trade.calc_profit_ratio(rate) < 0:
|
||||||
|
# Reject force-sells with negative profit
|
||||||
|
# This is just a sample, please adjust to your needs
|
||||||
|
# (this does not necessarily make sense, assuming you know when you're force-selling)
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Derived strategies
|
||||||
|
|
||||||
|
The strategies can be derived from other strategies. This avoids duplication of your custom strategy code. You can use this technique to override small parts of your main strategy, leaving the rest untouched:
|
||||||
|
|
||||||
|
``` python
|
||||||
|
class MyAwesomeStrategy(IStrategy):
|
||||||
|
...
|
||||||
|
stoploss = 0.13
|
||||||
|
trailing_stop = False
|
||||||
|
# All other attributes and methods are here as they
|
||||||
|
# should be in any custom strategy...
|
||||||
|
...
|
||||||
|
|
||||||
|
class MyAwesomeStrategy2(MyAwesomeStrategy):
|
||||||
|
# Override something
|
||||||
|
stoploss = 0.08
|
||||||
|
trailing_stop = True
|
||||||
|
```
|
||||||
|
|
||||||
|
Both attributes and methods may be overriden, altering behavior of the original strategy in a way you need.
|
||||||
@@ -1,30 +1,35 @@
|
|||||||
# Optimization
|
# Strategy Customization
|
||||||
|
|
||||||
This page explains where to customize your strategies, and add new
|
This page explains how to customize your strategies, add new indicators and set up trading rules.
|
||||||
indicators.
|
|
||||||
|
Please familiarize yourself with [Freqtrade basics](bot-basics.md) first, which provides overall info on how the bot operates.
|
||||||
|
|
||||||
## Install a custom strategy file
|
## Install a custom strategy file
|
||||||
|
|
||||||
This is very simple. Copy paste your strategy file into the directory `user_data/strategies`.
|
This is very simple. Copy paste your strategy file into the directory `user_data/strategies`.
|
||||||
|
|
||||||
Let assume you have a class called `AwesomeStrategy` in the file `awesome-strategy.py`:
|
Let assume you have a class called `AwesomeStrategy` in the file `AwesomeStrategy.py`:
|
||||||
|
|
||||||
1. Move your file into `user_data/strategies` (you should have `user_data/strategies/awesome-strategy.py`
|
1. Move your file into `user_data/strategies` (you should have `user_data/strategies/AwesomeStrategy.py`
|
||||||
2. Start the bot with the param `--strategy AwesomeStrategy` (the parameter is the class name)
|
2. Start the bot with the param `--strategy AwesomeStrategy` (the parameter is the class name)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
freqtrade --strategy AwesomeStrategy
|
freqtrade trade --strategy AwesomeStrategy
|
||||||
```
|
```
|
||||||
|
|
||||||
## Change your strategy
|
## Develop your own strategy
|
||||||
|
|
||||||
The bot includes a default strategy file. However, we recommend you to
|
The bot includes a default strategy file.
|
||||||
use your own file to not have to lose your parameters every time the default
|
Also, several other strategies are available in the [strategy repository](https://github.com/freqtrade/freqtrade-strategies).
|
||||||
strategy file will be updated on Github. Put your custom strategy file
|
|
||||||
into the directory `user_data/strategies`.
|
|
||||||
|
|
||||||
Best copy the test-strategy and modify this copy to avoid having bot-updates override your changes.
|
You will however most likely have your own idea for a strategy.
|
||||||
`cp user_data/strategies/sample_strategy.py user_data/strategies/awesome-strategy.py`
|
This document intends to help you develop one for yourself.
|
||||||
|
|
||||||
|
To get started, use `freqtrade new-strategy --strategy AwesomeStrategy`.
|
||||||
|
This will create a new strategy file from a template, which will be located under `user_data/strategies/AwesomeStrategy.py`.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
This is just a template file, which will most likely not be profitable out of the box.
|
||||||
|
|
||||||
### Anatomy of a strategy
|
### Anatomy of a strategy
|
||||||
|
|
||||||
@@ -45,20 +50,20 @@ The current version is 2 - which is also the default when it's not set explicitl
|
|||||||
Future versions will require this to be set.
|
Future versions will require this to be set.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
freqtrade --strategy AwesomeStrategy
|
freqtrade trade --strategy AwesomeStrategy
|
||||||
```
|
```
|
||||||
|
|
||||||
**For the following section we will use the [user_data/strategies/sample_strategy.py](https://github.com/freqtrade/freqtrade/blob/develop/user_data/strategies/sample_strategy.py)
|
**For the following section we will use the [user_data/strategies/sample_strategy.py](https://github.com/freqtrade/freqtrade/blob/develop/freqtrade/templates/sample_strategy.py)
|
||||||
file as reference.**
|
file as reference.**
|
||||||
|
|
||||||
!!! Note Strategies and Backtesting
|
!!! Note "Strategies and Backtesting"
|
||||||
To avoid problems and unexpected differences between Backtesting and dry/live modes, please be aware
|
To avoid problems and unexpected differences between Backtesting and dry/live modes, please be aware
|
||||||
that during backtesting the full time-interval is passed to the `populate_*()` methods at once.
|
that during backtesting the full time range is passed to the `populate_*()` methods at once.
|
||||||
It is therefore best to use vectorized operations (across the whole dataframe, not loops) and
|
It is therefore best to use vectorized operations (across the whole dataframe, not loops) and
|
||||||
avoid index referencing (`df.iloc[-1]`), but instead use `df.shift()` to get to the previous candle.
|
avoid index referencing (`df.iloc[-1]`), but instead use `df.shift()` to get to the previous candle.
|
||||||
|
|
||||||
!!! Warning Using future data
|
!!! Warning "Warning: Using future data"
|
||||||
Since backtesting passes the full time interval to the `populate_*()` methods, the strategy author
|
Since backtesting passes the full time range to the `populate_*()` methods, the strategy author
|
||||||
needs to take care to avoid having the strategy utilize data from the future.
|
needs to take care to avoid having the strategy utilize data from the future.
|
||||||
Some common patterns for this are listed in the [Common Mistakes](#common-mistakes-when-developing-strategies) section of this document.
|
Some common patterns for this are listed in the [Common Mistakes](#common-mistakes-when-developing-strategies) section of this document.
|
||||||
|
|
||||||
@@ -80,7 +85,7 @@ def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame
|
|||||||
Performance Note: For the best performance be frugal on the number of indicators
|
Performance Note: For the best performance be frugal on the number of indicators
|
||||||
you are using. Let uncomment only the indicator you are using in your strategies
|
you are using. Let uncomment only the indicator you are using in your strategies
|
||||||
or your hyperopt configuration, otherwise you will waste your memory and CPU usage.
|
or your hyperopt configuration, otherwise you will waste your memory and CPU usage.
|
||||||
:param dataframe: Raw data from the exchange and parsed by parse_ticker_dataframe()
|
:param dataframe: Dataframe with data from the exchange
|
||||||
:param metadata: Additional information, like the currently traded pair
|
:param metadata: Additional information, like the currently traded pair
|
||||||
:return: a Dataframe with all mandatory indicators for the strategies
|
:return: a Dataframe with all mandatory indicators for the strategies
|
||||||
"""
|
"""
|
||||||
@@ -114,9 +119,40 @@ def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame
|
|||||||
```
|
```
|
||||||
|
|
||||||
!!! Note "Want more indicator examples?"
|
!!! Note "Want more indicator examples?"
|
||||||
Look into the [user_data/strategies/sample_strategy.py](https://github.com/freqtrade/freqtrade/blob/develop/user_data/strategies/sample_strategy.py).
|
Look into the [user_data/strategies/sample_strategy.py](https://github.com/freqtrade/freqtrade/blob/develop/freqtrade/templates/sample_strategy.py).
|
||||||
Then uncomment indicators you need.
|
Then uncomment indicators you need.
|
||||||
|
|
||||||
|
### Strategy startup period
|
||||||
|
|
||||||
|
Most indicators have an instable startup period, in which they are either not available, or the calculation is incorrect. This can lead to inconsistencies, since Freqtrade does not know how long this instable period should be.
|
||||||
|
To account for this, the strategy can be assigned the `startup_candle_count` attribute.
|
||||||
|
This should be set to the maximum number of candles that the strategy requires to calculate stable indicators.
|
||||||
|
|
||||||
|
In this example strategy, this should be set to 100 (`startup_candle_count = 100`), since the longest needed history is 100 candles.
|
||||||
|
|
||||||
|
``` python
|
||||||
|
dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)
|
||||||
|
```
|
||||||
|
|
||||||
|
By letting the bot know how much history is needed, backtest trades can start at the specified timerange during backtesting and hyperopt.
|
||||||
|
|
||||||
|
!!! Warning
|
||||||
|
`startup_candle_count` should be below `ohlcv_candle_limit` (which is 500 for most exchanges) - since only this amount of candles will be available during Dry-Run/Live Trade operations.
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Let's try to backtest 1 month (January 2019) of 5m candles using an example strategy with EMA100, as above.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
freqtrade backtesting --timerange 20190101-20190201 --timeframe 5m
|
||||||
|
```
|
||||||
|
|
||||||
|
Assuming `startup_candle_count` is set to 100, backtesting knows it needs 100 candles to generate valid buy signals. It will load data from `20190101 - (100 * 5m)` - which is ~2019-12-31 15:30:00.
|
||||||
|
If this data is available, indicators will be calculated with this extended timerange. The instable startup period (up to 2019-01-01 00:00:00) will then be removed before starting backtesting.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
If data for the startup period is not available, then the timerange will be adjusted to account for this startup period - so Backtesting would start at 2019-01-01 08:30:00.
|
||||||
|
|
||||||
### Buy signal rules
|
### Buy signal rules
|
||||||
|
|
||||||
Edit the method `populate_buy_trend()` in your strategy file to update your buy strategy.
|
Edit the method `populate_buy_trend()` in your strategy file to update your buy strategy.
|
||||||
@@ -214,6 +250,23 @@ minimal_roi = {
|
|||||||
|
|
||||||
While technically not completely disabled, this would sell once the trade reaches 10000% Profit.
|
While technically not completely disabled, this would sell once the trade reaches 10000% Profit.
|
||||||
|
|
||||||
|
To use times based on candle duration (timeframe), the following snippet can be handy.
|
||||||
|
This will allow you to change the timeframe for the strategy, and ROI times will still be set as candles (e.g. after 3 candles ...)
|
||||||
|
|
||||||
|
``` python
|
||||||
|
from freqtrade.exchange import timeframe_to_minutes
|
||||||
|
|
||||||
|
class AwesomeStrategy(IStrategy):
|
||||||
|
|
||||||
|
timeframe = "1d"
|
||||||
|
timeframe_mins = timeframe_to_minutes(timeframe)
|
||||||
|
minimal_roi = {
|
||||||
|
"0": 0.05, # 5% for the first 3 candles
|
||||||
|
str(timeframe_mins * 3)): 0.02, # 2% after 3 candles
|
||||||
|
str(timeframe_mins * 6)): 0.01, # 1% After 6 candles
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Stoploss
|
### Stoploss
|
||||||
|
|
||||||
Setting a stoploss is highly recommended to protect your capital from strong moves against you.
|
Setting a stoploss is highly recommended to protect your capital from strong moves against you.
|
||||||
@@ -232,13 +285,14 @@ If your exchange supports it, it's recommended to also set `"stoploss_on_exchang
|
|||||||
|
|
||||||
For more information on order_types please look [here](configuration.md#understand-order_types).
|
For more information on order_types please look [here](configuration.md#understand-order_types).
|
||||||
|
|
||||||
### Ticker interval
|
### Timeframe (formerly ticker interval)
|
||||||
|
|
||||||
This is the set of candles the bot should download and use for the analysis.
|
This is the set of candles the bot should download and use for the analysis.
|
||||||
Common values are `"1m"`, `"5m"`, `"15m"`, `"1h"`, however all values supported by your exchange should work.
|
Common values are `"1m"`, `"5m"`, `"15m"`, `"1h"`, however all values supported by your exchange should work.
|
||||||
|
|
||||||
Please note that the same buy/sell signals may work with one interval, but not the other.
|
Please note that the same buy/sell signals may work well with one timeframe, but not with the others.
|
||||||
This setting is accessible within the strategy by using `self.ticker_interval`.
|
|
||||||
|
This setting is accessible within the strategy methods as the `self.timeframe` attribute.
|
||||||
|
|
||||||
### Metadata dict
|
### Metadata dict
|
||||||
|
|
||||||
@@ -267,75 +321,22 @@ class Awesomestrategy(IStrategy):
|
|||||||
```
|
```
|
||||||
|
|
||||||
!!! Warning
|
!!! Warning
|
||||||
The data is not persisted after a bot-restart (or config-reload). Also, the amount of data should be kept smallish (no DataFrames and such), otherwise the bot will start to consume a lot of memory and eventually run out of memory and crash.
|
The data is not persisted after a bot-restart (or config-reload). Also, the amount of data should be kept smallish (no DataFrames and such), otherwise the bot will start to consume a lot of memory and eventually run out of memory and crash.
|
||||||
|
|
||||||
!!! Note
|
!!! Note
|
||||||
If the data is pair-specific, make sure to use pair as one of the keys in the dictionary.
|
If the data is pair-specific, make sure to use pair as one of the keys in the dictionary.
|
||||||
|
|
||||||
### Additional data (DataProvider)
|
***
|
||||||
|
|
||||||
The strategy provides access to the `DataProvider`. This allows you to get additional data to use in your strategy.
|
## Additional data (informative_pairs)
|
||||||
|
|
||||||
All methods return `None` in case of failure (do not raise an exception).
|
### Get data for non-tradeable pairs
|
||||||
|
|
||||||
Please always check the mode of operation to select the correct method to get data (samples see below).
|
|
||||||
|
|
||||||
#### Possible options for DataProvider
|
|
||||||
|
|
||||||
- `available_pairs` - Property with tuples listing cached pairs with their intervals (pair, interval).
|
|
||||||
- `ohlcv(pair, ticker_interval)` - Currently cached ticker data for the pair, returns DataFrame or empty DataFrame.
|
|
||||||
- `historic_ohlcv(pair, ticker_interval)` - Returns historical data stored on disk.
|
|
||||||
- `get_pair_dataframe(pair, ticker_interval)` - This is a universal method, which returns either historical data (for backtesting) or cached live data (for the Dry-Run and Live-Run modes).
|
|
||||||
- `orderbook(pair, maximum)` - Returns latest orderbook data for the pair, a dict with bids/asks with a total of `maximum` entries.
|
|
||||||
- `market(pair)` - Returns market data for the pair: fees, limits, precisions, activity flag, etc. See [ccxt documentation](https://github.com/ccxt/ccxt/wiki/Manual#markets) for more details on Market data structure.
|
|
||||||
- `runmode` - Property containing the current runmode.
|
|
||||||
|
|
||||||
#### Example: fetch live ohlcv / historic data for the first informative pair
|
|
||||||
|
|
||||||
``` python
|
|
||||||
if self.dp:
|
|
||||||
inf_pair, inf_timeframe = self.informative_pairs()[0]
|
|
||||||
informative = self.dp.get_pair_dataframe(pair=inf_pair,
|
|
||||||
ticker_interval=inf_timeframe)
|
|
||||||
```
|
|
||||||
|
|
||||||
!!! Warning Warning about backtesting
|
|
||||||
Be carefull when using dataprovider in backtesting. `historic_ohlcv()` (and `get_pair_dataframe()`
|
|
||||||
for the backtesting runmode) provides the full time-range in one go,
|
|
||||||
so please be aware of it and make sure to not "look into the future" to avoid surprises when running in dry/live mode).
|
|
||||||
|
|
||||||
!!! Warning Warning in hyperopt
|
|
||||||
This option cannot currently be used during hyperopt.
|
|
||||||
|
|
||||||
#### Orderbook
|
|
||||||
|
|
||||||
``` python
|
|
||||||
if self.dp:
|
|
||||||
if self.dp.runmode in ('live', 'dry_run'):
|
|
||||||
ob = self.dp.orderbook(metadata['pair'], 1)
|
|
||||||
dataframe['best_bid'] = ob['bids'][0][0]
|
|
||||||
dataframe['best_ask'] = ob['asks'][0][0]
|
|
||||||
```
|
|
||||||
|
|
||||||
!!! Warning
|
|
||||||
The order book is not part of the historic data which means backtesting and hyperopt will not work if this
|
|
||||||
method is used.
|
|
||||||
|
|
||||||
#### Available Pairs
|
|
||||||
|
|
||||||
``` python
|
|
||||||
if self.dp:
|
|
||||||
for pair, ticker in self.dp.available_pairs:
|
|
||||||
print(f"available {pair}, {ticker}")
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Get data for non-tradeable pairs
|
|
||||||
|
|
||||||
Data for additional, informative pairs (reference pairs) can be beneficial for some strategies.
|
Data for additional, informative pairs (reference pairs) can be beneficial for some strategies.
|
||||||
Ohlcv data for these pairs will be downloaded as part of the regular whitelist refresh process and is available via `DataProvider` just as other pairs (see above).
|
OHLCV data for these pairs will be downloaded as part of the regular whitelist refresh process and is available via `DataProvider` just as other pairs (see below).
|
||||||
These parts will **not** be traded unless they are also specified in the pair whitelist, or have been selected by Dynamic Whitelisting.
|
These parts will **not** be traded unless they are also specified in the pair whitelist, or have been selected by Dynamic Whitelisting.
|
||||||
|
|
||||||
The pairs need to be specified as tuples in the format `("pair", "interval")`, with pair as the first and time interval as the second argument.
|
The pairs need to be specified as tuples in the format `("pair", "timeframe")`, with pair as the first and timeframe as the second argument.
|
||||||
|
|
||||||
Sample:
|
Sample:
|
||||||
|
|
||||||
@@ -346,13 +347,268 @@ def informative_pairs(self):
|
|||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
A full sample can be found [in the DataProvider section](#complete-data-provider-sample).
|
||||||
|
|
||||||
!!! Warning
|
!!! Warning
|
||||||
As these pairs will be refreshed as part of the regular whitelist refresh, it's best to keep this list short.
|
As these pairs will be refreshed as part of the regular whitelist refresh, it's best to keep this list short.
|
||||||
All intervals and all pairs can be specified as long as they are available (and active) on the used exchange.
|
All timeframes and all pairs can be specified as long as they are available (and active) on the used exchange.
|
||||||
It is however better to use resampling to longer time-intervals when possible
|
It is however better to use resampling to longer timeframes whenever possible
|
||||||
to avoid hammering the exchange with too many requests and risk being blocked.
|
to avoid hammering the exchange with too many requests and risk being blocked.
|
||||||
|
|
||||||
### Additional data (Wallets)
|
***
|
||||||
|
|
||||||
|
## Additional data (DataProvider)
|
||||||
|
|
||||||
|
The strategy provides access to the `DataProvider`. This allows you to get additional data to use in your strategy.
|
||||||
|
|
||||||
|
All methods return `None` in case of failure (do not raise an exception).
|
||||||
|
|
||||||
|
Please always check the mode of operation to select the correct method to get data (samples see below).
|
||||||
|
|
||||||
|
!!! Warning "Hyperopt"
|
||||||
|
Dataprovider is available during hyperopt, however it can only be used in `populate_indicators()` within a strategy.
|
||||||
|
It is not available in `populate_buy()` and `populate_sell()` methods, nor in `populate_indicators()`, if this method located in the hyperopt file.
|
||||||
|
|
||||||
|
### Possible options for DataProvider
|
||||||
|
|
||||||
|
- [`available_pairs`](#available_pairs) - Property with tuples listing cached pairs with their timeframe (pair, timeframe).
|
||||||
|
- [`current_whitelist()`](#current_whitelist) - Returns a current list of whitelisted pairs. Useful for accessing dynamic whitelists (i.e. VolumePairlist)
|
||||||
|
- [`get_pair_dataframe(pair, timeframe)`](#get_pair_dataframepair-timeframe) - This is a universal method, which returns either historical data (for backtesting) or cached live data (for the Dry-Run and Live-Run modes).
|
||||||
|
- [`get_analyzed_dataframe(pair, timeframe)`](#get_analyzed_dataframepair-timeframe) - Returns the analyzed dataframe (after calling `populate_indicators()`, `populate_buy()`, `populate_sell()`) and the time of the latest analysis.
|
||||||
|
- `historic_ohlcv(pair, timeframe)` - Returns historical data stored on disk.
|
||||||
|
- `market(pair)` - Returns market data for the pair: fees, limits, precisions, activity flag, etc. See [ccxt documentation](https://github.com/ccxt/ccxt/wiki/Manual#markets) for more details on the Market data structure.
|
||||||
|
- `ohlcv(pair, timeframe)` - Currently cached candle (OHLCV) data for the pair, returns DataFrame or empty DataFrame.
|
||||||
|
- [`orderbook(pair, maximum)`](#orderbookpair-maximum) - Returns latest orderbook data for the pair, a dict with bids/asks with a total of `maximum` entries.
|
||||||
|
- [`ticker(pair)`](#tickerpair) - Returns current ticker data for the pair. See [ccxt documentation](https://github.com/ccxt/ccxt/wiki/Manual#price-tickers) for more details on the Ticker data structure.
|
||||||
|
- `runmode` - Property containing the current runmode.
|
||||||
|
|
||||||
|
### Example Usages
|
||||||
|
|
||||||
|
### *available_pairs*
|
||||||
|
|
||||||
|
``` python
|
||||||
|
if self.dp:
|
||||||
|
for pair, timeframe in self.dp.available_pairs:
|
||||||
|
print(f"available {pair}, {timeframe}")
|
||||||
|
```
|
||||||
|
|
||||||
|
### *current_whitelist()*
|
||||||
|
|
||||||
|
Imagine you've developed a strategy that trades the `5m` timeframe using signals generated from a `1d` timeframe on the top 10 volume pairs by volume.
|
||||||
|
|
||||||
|
The strategy might look something like this:
|
||||||
|
|
||||||
|
*Scan through the top 10 pairs by volume using the `VolumePairList` every 5 minutes and use a 14 day RSI to buy and sell.*
|
||||||
|
|
||||||
|
Due to the limited available data, it's very difficult to resample our `5m` candles into daily candles for use in a 14 day RSI. Most exchanges limit us to just 500 candles which effectively gives us around 1.74 daily candles. We need 14 days at least!
|
||||||
|
|
||||||
|
Since we can't resample our data we will have to use an informative pair; and since our whitelist will be dynamic we don't know which pair(s) to use.
|
||||||
|
|
||||||
|
This is where calling `self.dp.current_whitelist()` comes in handy.
|
||||||
|
|
||||||
|
```python
|
||||||
|
def informative_pairs(self):
|
||||||
|
|
||||||
|
# get access to all pairs available in whitelist.
|
||||||
|
pairs = self.dp.current_whitelist()
|
||||||
|
# Assign tf to each pair so they can be downloaded and cached for strategy.
|
||||||
|
informative_pairs = [(pair, '1d') for pair in pairs]
|
||||||
|
return informative_pairs
|
||||||
|
```
|
||||||
|
|
||||||
|
### *get_pair_dataframe(pair, timeframe)*
|
||||||
|
|
||||||
|
``` python
|
||||||
|
# fetch live / historical candle (OHLCV) data for the first informative pair
|
||||||
|
if self.dp:
|
||||||
|
inf_pair, inf_timeframe = self.informative_pairs()[0]
|
||||||
|
informative = self.dp.get_pair_dataframe(pair=inf_pair,
|
||||||
|
timeframe=inf_timeframe)
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Warning "Warning about backtesting"
|
||||||
|
Be careful when using dataprovider in backtesting. `historic_ohlcv()` (and `get_pair_dataframe()`
|
||||||
|
for the backtesting runmode) provides the full time-range in one go,
|
||||||
|
so please be aware of it and make sure to not "look into the future" to avoid surprises when running in dry/live mode.
|
||||||
|
|
||||||
|
### *get_analyzed_dataframe(pair, timeframe)*
|
||||||
|
|
||||||
|
This method is used by freqtrade internally to determine the last signal.
|
||||||
|
It can also be used in specific callbacks to get the signal that caused the action (see [Advanced Strategy Documentation](strategy-advanced.md) for more details on available callbacks).
|
||||||
|
|
||||||
|
``` python
|
||||||
|
# fetch current dataframe
|
||||||
|
if self.dp:
|
||||||
|
dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=metadata['pair'],
|
||||||
|
timeframe=self.timeframe)
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Note "No data available"
|
||||||
|
Returns an empty dataframe if the requested pair was not cached.
|
||||||
|
This should not happen when using whitelisted pairs.
|
||||||
|
|
||||||
|
### *orderbook(pair, maximum)*
|
||||||
|
|
||||||
|
``` python
|
||||||
|
if self.dp:
|
||||||
|
if self.dp.runmode.value in ('live', 'dry_run'):
|
||||||
|
ob = self.dp.orderbook(metadata['pair'], 1)
|
||||||
|
dataframe['best_bid'] = ob['bids'][0][0]
|
||||||
|
dataframe['best_ask'] = ob['asks'][0][0]
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Warning
|
||||||
|
The order book is not part of the historic data which means backtesting and hyperopt will not work correctly if this method is used.
|
||||||
|
|
||||||
|
### *ticker(pair)*
|
||||||
|
|
||||||
|
``` python
|
||||||
|
if self.dp:
|
||||||
|
if self.dp.runmode.value in ('live', 'dry_run'):
|
||||||
|
ticker = self.dp.ticker(metadata['pair'])
|
||||||
|
dataframe['last_price'] = ticker['last']
|
||||||
|
dataframe['volume24h'] = ticker['quoteVolume']
|
||||||
|
dataframe['vwap'] = ticker['vwap']
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Warning
|
||||||
|
Although the ticker data structure is a part of the ccxt Unified Interface, the values returned by this method can
|
||||||
|
vary for different exchanges. For instance, many exchanges do not return `vwap` values, the FTX exchange
|
||||||
|
does not always fills in the `last` field (so it can be None), etc. So you need to carefully verify the ticker
|
||||||
|
data returned from the exchange and add appropriate error handling / defaults.
|
||||||
|
|
||||||
|
!!! Warning "Warning about backtesting"
|
||||||
|
This method will always return up-to-date values - so usage during backtesting / hyperopt will lead to wrong results.
|
||||||
|
|
||||||
|
### Complete Data-provider sample
|
||||||
|
|
||||||
|
```python
|
||||||
|
from freqtrade.strategy import IStrategy, merge_informative_pair
|
||||||
|
from pandas import DataFrame
|
||||||
|
|
||||||
|
class SampleStrategy(IStrategy):
|
||||||
|
# strategy init stuff...
|
||||||
|
|
||||||
|
timeframe = '5m'
|
||||||
|
|
||||||
|
# more strategy init stuff..
|
||||||
|
|
||||||
|
def informative_pairs(self):
|
||||||
|
|
||||||
|
# get access to all pairs available in whitelist.
|
||||||
|
pairs = self.dp.current_whitelist()
|
||||||
|
# Assign tf to each pair so they can be downloaded and cached for strategy.
|
||||||
|
informative_pairs = [(pair, '1d') for pair in pairs]
|
||||||
|
# Optionally Add additional "static" pairs
|
||||||
|
informative_pairs += [("ETH/USDT", "5m"),
|
||||||
|
("BTC/TUSD", "15m"),
|
||||||
|
]
|
||||||
|
return informative_pairs
|
||||||
|
|
||||||
|
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
||||||
|
if not self.dp:
|
||||||
|
# Don't do anything if DataProvider is not available.
|
||||||
|
return dataframe
|
||||||
|
|
||||||
|
inf_tf = '1d'
|
||||||
|
# Get the informative pair
|
||||||
|
informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=inf_tf)
|
||||||
|
# Get the 14 day rsi
|
||||||
|
informative['rsi'] = ta.RSI(informative, timeperiod=14)
|
||||||
|
|
||||||
|
# Use the helper function merge_informative_pair to safely merge the pair
|
||||||
|
# Automatically renames the columns and merges a shorter timeframe dataframe and a longer timeframe informative pair
|
||||||
|
# use ffill to have the 1d value available in every row throughout the day.
|
||||||
|
# Without this, comparisons between columns of the original and the informative pair would only work once per day.
|
||||||
|
# Full documentation of this method, see below
|
||||||
|
dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf, ffill=True)
|
||||||
|
|
||||||
|
# Calculate rsi of the original dataframe (5m timeframe)
|
||||||
|
dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)
|
||||||
|
|
||||||
|
# Do other stuff
|
||||||
|
# ...
|
||||||
|
|
||||||
|
return dataframe
|
||||||
|
|
||||||
|
def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
||||||
|
|
||||||
|
dataframe.loc[
|
||||||
|
(
|
||||||
|
(qtpylib.crossed_above(dataframe['rsi'], 30)) & # Signal: RSI crosses above 30
|
||||||
|
(dataframe['rsi_1d'] < 30) & # Ensure daily RSI is < 30
|
||||||
|
(dataframe['volume'] > 0) # Ensure this candle had volume (important for backtesting)
|
||||||
|
),
|
||||||
|
'buy'] = 1
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
***
|
||||||
|
|
||||||
|
## Helper functions
|
||||||
|
|
||||||
|
### *merge_informative_pair()*
|
||||||
|
|
||||||
|
This method helps you merge an informative pair to a regular dataframe without lookahead bias.
|
||||||
|
It's there to help you merge the dataframe in a safe and consistent way.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
|
||||||
|
- Rename the columns for you to create unique columns
|
||||||
|
- Merge the dataframe without lookahead bias
|
||||||
|
- Forward-fill (optional)
|
||||||
|
|
||||||
|
All columns of the informative dataframe will be available on the returning dataframe in a renamed fashion:
|
||||||
|
|
||||||
|
!!! Example "Column renaming"
|
||||||
|
Assuming `inf_tf = '1d'` the resulting columns will be:
|
||||||
|
|
||||||
|
``` python
|
||||||
|
'date', 'open', 'high', 'low', 'close', 'rsi' # from the original dataframe
|
||||||
|
'date_1d', 'open_1d', 'high_1d', 'low_1d', 'close_1d', 'rsi_1d' # from the informative dataframe
|
||||||
|
```
|
||||||
|
|
||||||
|
??? Example "Column renaming - 1h"
|
||||||
|
Assuming `inf_tf = '1h'` the resulting columns will be:
|
||||||
|
|
||||||
|
``` python
|
||||||
|
'date', 'open', 'high', 'low', 'close', 'rsi' # from the original dataframe
|
||||||
|
'date_1h', 'open_1h', 'high_1h', 'low_1h', 'close_1h', 'rsi_1h' # from the informative dataframe
|
||||||
|
```
|
||||||
|
|
||||||
|
??? Example "Custom implementation"
|
||||||
|
A custom implementation for this is possible, and can be done as follows:
|
||||||
|
|
||||||
|
``` python
|
||||||
|
|
||||||
|
# Shift date by 1 candle
|
||||||
|
# This is necessary since the data is always the "open date"
|
||||||
|
# and a 15m candle starting at 12:15 should not know the close of the 1h candle from 12:00 to 13:00
|
||||||
|
minutes = timeframe_to_minutes(inf_tf)
|
||||||
|
# Only do this if the timeframes are different:
|
||||||
|
informative['date_merge'] = informative["date"] + pd.to_timedelta(minutes, 'm')
|
||||||
|
|
||||||
|
# Rename columns to be unique
|
||||||
|
informative.columns = [f"{col}_{inf_tf}" for col in informative.columns]
|
||||||
|
# Assuming inf_tf = '1d' - then the columns will now be:
|
||||||
|
# date_1d, open_1d, high_1d, low_1d, close_1d, rsi_1d
|
||||||
|
|
||||||
|
# Combine the 2 dataframes
|
||||||
|
# all indicators on the informative sample MUST be calculated before this point
|
||||||
|
dataframe = pd.merge(dataframe, informative, left_on='date', right_on=f'date_merge_{inf_tf}', how='left')
|
||||||
|
# FFill to have the 1d value available in every row throughout the day.
|
||||||
|
# Without this, comparisons would only work once per day.
|
||||||
|
dataframe = dataframe.ffill()
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Warning "Informative timeframe < timeframe"
|
||||||
|
Using informative timeframes smaller than the dataframe timeframe is not recommended with this method, as it will not use any of the additional information this would provide.
|
||||||
|
To use the more detailed information properly, more advanced methods should be applied (which are out of scope for freqtrade documentation, as it'll depend on the respective need).
|
||||||
|
|
||||||
|
***
|
||||||
|
|
||||||
|
## Additional data (Wallets)
|
||||||
|
|
||||||
The strategy provides access to the `Wallets` object. This contains the current balances on the exchange.
|
The strategy provides access to the `Wallets` object. This contains the current balances on the exchange.
|
||||||
|
|
||||||
@@ -368,13 +624,106 @@ if self.wallets:
|
|||||||
total_eth = self.wallets.get_total('ETH')
|
total_eth = self.wallets.get_total('ETH')
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Possible options for Wallets
|
### Possible options for Wallets
|
||||||
|
|
||||||
- `get_free(asset)` - currently available balance to trade
|
- `get_free(asset)` - currently available balance to trade
|
||||||
- `get_used(asset)` - currently tied up balance (open orders)
|
- `get_used(asset)` - currently tied up balance (open orders)
|
||||||
- `get_total(asset)` - total available balance - sum of the 2 above
|
- `get_total(asset)` - total available balance - sum of the 2 above
|
||||||
|
|
||||||
### Print created dataframe
|
***
|
||||||
|
|
||||||
|
## Additional data (Trades)
|
||||||
|
|
||||||
|
A history of Trades can be retrieved in the strategy by querying the database.
|
||||||
|
|
||||||
|
At the top of the file, import Trade.
|
||||||
|
|
||||||
|
```python
|
||||||
|
from freqtrade.persistence import Trade
|
||||||
|
```
|
||||||
|
|
||||||
|
The following example queries for the current pair and trades from today, however other filters can easily be added.
|
||||||
|
|
||||||
|
``` python
|
||||||
|
if self.config['runmode'].value in ('live', 'dry_run'):
|
||||||
|
trades = Trade.get_trades([Trade.pair == metadata['pair'],
|
||||||
|
Trade.open_date > datetime.utcnow() - timedelta(days=1),
|
||||||
|
Trade.is_open == False,
|
||||||
|
]).order_by(Trade.close_date).all()
|
||||||
|
# Summarize profit for this pair.
|
||||||
|
curdayprofit = sum(trade.close_profit for trade in trades)
|
||||||
|
```
|
||||||
|
|
||||||
|
Get amount of stake_currency currently invested in Trades:
|
||||||
|
|
||||||
|
``` python
|
||||||
|
if self.config['runmode'].value in ('live', 'dry_run'):
|
||||||
|
total_stakes = Trade.total_open_trades_stakes()
|
||||||
|
```
|
||||||
|
|
||||||
|
Retrieve performance per pair.
|
||||||
|
Returns a List of dicts per pair.
|
||||||
|
|
||||||
|
``` python
|
||||||
|
if self.config['runmode'].value in ('live', 'dry_run'):
|
||||||
|
performance = Trade.get_overall_performance()
|
||||||
|
```
|
||||||
|
|
||||||
|
Sample return value: ETH/BTC had 5 trades, with a total profit of 1.5% (ratio of 0.015).
|
||||||
|
|
||||||
|
``` json
|
||||||
|
{'pair': "ETH/BTC", 'profit': 0.015, 'count': 5}
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Warning
|
||||||
|
Trade history is not available during backtesting or hyperopt.
|
||||||
|
|
||||||
|
## Prevent trades from happening for a specific pair
|
||||||
|
|
||||||
|
Freqtrade locks pairs automatically for the current candle (until that candle is over) when a pair is sold, preventing an immediate re-buy of that pair.
|
||||||
|
|
||||||
|
Locked pairs will show the message `Pair <pair> is currently locked.`.
|
||||||
|
|
||||||
|
### Locking pairs from within the strategy
|
||||||
|
|
||||||
|
Sometimes it may be desired to lock a pair after certain events happen (e.g. multiple losing trades in a row).
|
||||||
|
|
||||||
|
Freqtrade has an easy method to do this from within the strategy, by calling `self.lock_pair(pair, until)`.
|
||||||
|
`until` must be a datetime object in the future, after which trading will be reenabled for that pair.
|
||||||
|
|
||||||
|
Locks can also be lifted manually, by calling `self.unlock_pair(pair)`.
|
||||||
|
|
||||||
|
To verify if a pair is currently locked, use `self.is_pair_locked(pair)`.
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
Locked pairs are not persisted, so a restart of the bot, or calling `/reload_config` will reset locked pairs.
|
||||||
|
|
||||||
|
!!! Warning
|
||||||
|
Locking pairs is not functioning during backtesting.
|
||||||
|
|
||||||
|
#### Pair locking example
|
||||||
|
|
||||||
|
``` python
|
||||||
|
from freqtrade.persistence import Trade
|
||||||
|
from datetime import timedelta, datetime, timezone
|
||||||
|
# Put the above lines a the top of the strategy file, next to all the other imports
|
||||||
|
# --------
|
||||||
|
|
||||||
|
# Within populate indicators (or populate_buy):
|
||||||
|
if self.config['runmode'].value in ('live', 'dry_run'):
|
||||||
|
# fetch closed trades for the last 2 days
|
||||||
|
trades = Trade.get_trades([Trade.pair == metadata['pair'],
|
||||||
|
Trade.open_date > datetime.utcnow() - timedelta(days=2),
|
||||||
|
Trade.is_open == False,
|
||||||
|
]).all()
|
||||||
|
# Analyze the conditions you'd like to lock the pair .... will probably be different for every strategy
|
||||||
|
sumprofit = sum(trade.close_profit for trade in trades)
|
||||||
|
if sumprofit < 0:
|
||||||
|
# Lock pair for 12 hours
|
||||||
|
self.lock_pair(metadata['pair'], until=datetime.now(timezone.utc) + timedelta(hours=12))
|
||||||
|
```
|
||||||
|
|
||||||
|
## Print created dataframe
|
||||||
|
|
||||||
To inspect the created dataframe, you can issue a print-statement in either `populate_buy_trend()` or `populate_sell_trend()`.
|
To inspect the created dataframe, you can issue a print-statement in either `populate_buy_trend()` or `populate_sell_trend()`.
|
||||||
You may also want to print the pair so it's clear what data is currently shown.
|
You may also want to print the pair so it's clear what data is currently shown.
|
||||||
@@ -398,20 +747,7 @@ def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
|||||||
|
|
||||||
Printing more than a few rows is also possible (simply use `print(dataframe)` instead of `print(dataframe.tail())`), however not recommended, as that will be very verbose (~500 lines per pair every 5 seconds).
|
Printing more than a few rows is also possible (simply use `print(dataframe)` instead of `print(dataframe.tail())`), however not recommended, as that will be very verbose (~500 lines per pair every 5 seconds).
|
||||||
|
|
||||||
### Where can i find a strategy template?
|
## Common mistakes when developing strategies
|
||||||
|
|
||||||
The strategy template is located in the file
|
|
||||||
[user_data/strategies/sample_strategy.py](https://github.com/freqtrade/freqtrade/blob/develop/user_data/strategies/sample_strategy.py).
|
|
||||||
|
|
||||||
### Specify custom strategy location
|
|
||||||
|
|
||||||
If you want to use a strategy from a different directory you can pass `--strategy-path`
|
|
||||||
|
|
||||||
```bash
|
|
||||||
freqtrade --strategy AwesomeStrategy --strategy-path /some/directory
|
|
||||||
```
|
|
||||||
|
|
||||||
### Common mistakes when developing strategies
|
|
||||||
|
|
||||||
Backtesting analyzes the whole time-range at once for performance reasons. Because of this, strategy authors need to make sure that strategies do not look-ahead into the future.
|
Backtesting analyzes the whole time-range at once for performance reasons. Because of this, strategy authors need to make sure that strategies do not look-ahead into the future.
|
||||||
This is a common pain-point, which can cause huge differences between backtesting and dry/live run methods, since they all use data which is not available during dry/live runs, so these strategies will perform well during backtesting, but will fail / perform badly in real conditions.
|
This is a common pain-point, which can cause huge differences between backtesting and dry/live run methods, since they all use data which is not available during dry/live runs, so these strategies will perform well during backtesting, but will fail / perform badly in real conditions.
|
||||||
@@ -423,7 +759,7 @@ The following lists some common patterns which should be avoided to prevent frus
|
|||||||
- don't use `dataframe['volume'].mean()`. This uses the full DataFrame for backtesting, including data from the future. Use `dataframe['volume'].rolling(<window>).mean()` instead
|
- don't use `dataframe['volume'].mean()`. This uses the full DataFrame for backtesting, including data from the future. Use `dataframe['volume'].rolling(<window>).mean()` instead
|
||||||
- don't use `.resample('1h')`. This uses the left border of the interval, so moves data from an hour to the start of the hour. Use `.resample('1h', label='right')` instead.
|
- don't use `.resample('1h')`. This uses the left border of the interval, so moves data from an hour to the start of the hour. Use `.resample('1h', label='right')` instead.
|
||||||
|
|
||||||
### Further strategy ideas
|
## Further strategy ideas
|
||||||
|
|
||||||
To get additional Ideas for strategies, head over to our [strategy repository](https://github.com/freqtrade/freqtrade-strategies). Feel free to use them as they are - but results will depend on the current market situation, pairs used etc. - therefore please backtest the strategy for your exchange/desired pairs first, evaluate carefully, use at your own risk.
|
To get additional Ideas for strategies, head over to our [strategy repository](https://github.com/freqtrade/freqtrade-strategies). Feel free to use them as they are - but results will depend on the current market situation, pairs used etc. - therefore please backtest the strategy for your exchange/desired pairs first, evaluate carefully, use at your own risk.
|
||||||
Feel free to use any of them as inspiration for your own strategies.
|
Feel free to use any of them as inspiration for your own strategies.
|
||||||
|
|||||||
@@ -1,24 +1,28 @@
|
|||||||
# Strategy analysis example
|
# Strategy analysis example
|
||||||
|
|
||||||
Debugging a strategy can be time-consuming. FreqTrade offers helper functions to visualize raw data.
|
Debugging a strategy can be time-consuming. Freqtrade offers helper functions to visualize raw data.
|
||||||
|
The following assumes you work with SampleStrategy, data for 5m timeframe from Binance and have downloaded them into the data directory in the default location.
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from freqtrade.configuration import Configuration
|
||||||
|
|
||||||
# Customize these according to your needs.
|
# Customize these according to your needs.
|
||||||
|
|
||||||
|
# Initialize empty configuration object
|
||||||
|
config = Configuration.from_files([])
|
||||||
|
# Optionally, use existing configuration file
|
||||||
|
# config = Configuration.from_files(["config.json"])
|
||||||
|
|
||||||
# Define some constants
|
# Define some constants
|
||||||
ticker_interval = "5m"
|
config["timeframe"] = "5m"
|
||||||
# Name of the strategy class
|
# Name of the strategy class
|
||||||
strategy_name = 'SampleStrategy'
|
config["strategy"] = "SampleStrategy"
|
||||||
# Path to user data
|
|
||||||
user_data_dir = Path('user_data')
|
|
||||||
# Location of the strategy
|
|
||||||
strategy_location = user_data_dir / 'strategies'
|
|
||||||
# Location of the data
|
# Location of the data
|
||||||
data_location = Path(user_data_dir, 'data', 'binance')
|
data_location = Path(config['user_data_dir'], 'data', 'binance')
|
||||||
# Pair to analyze - Only use one pair here
|
# Pair to analyze - Only use one pair here
|
||||||
pair = "BTC_USDT"
|
pair = "BTC_USDT"
|
||||||
```
|
```
|
||||||
@@ -29,7 +33,7 @@ pair = "BTC_USDT"
|
|||||||
from freqtrade.data.history import load_pair_history
|
from freqtrade.data.history import load_pair_history
|
||||||
|
|
||||||
candles = load_pair_history(datadir=data_location,
|
candles = load_pair_history(datadir=data_location,
|
||||||
ticker_interval=ticker_interval,
|
timeframe=config["timeframe"],
|
||||||
pair=pair)
|
pair=pair)
|
||||||
|
|
||||||
# Confirm success
|
# Confirm success
|
||||||
@@ -44,9 +48,7 @@ candles.head()
|
|||||||
```python
|
```python
|
||||||
# Load strategy using values set above
|
# Load strategy using values set above
|
||||||
from freqtrade.resolvers import StrategyResolver
|
from freqtrade.resolvers import StrategyResolver
|
||||||
strategy = StrategyResolver({'strategy': strategy_name,
|
strategy = StrategyResolver.load_strategy(config)
|
||||||
'user_data_dir': user_data_dir,
|
|
||||||
'strategy_path': strategy_location}).strategy
|
|
||||||
|
|
||||||
# Generate buy/sell signals using strategy
|
# Generate buy/sell signals using strategy
|
||||||
df = strategy.analyze_ticker(candles, {'pair': pair})
|
df = strategy.analyze_ticker(candles, {'pair': pair})
|
||||||
@@ -83,10 +85,44 @@ Analyze a trades dataframe (also used below for plotting)
|
|||||||
|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from freqtrade.data.btanalysis import load_backtest_data
|
from freqtrade.data.btanalysis import load_backtest_data, load_backtest_stats
|
||||||
|
|
||||||
# Load backtest results
|
# if backtest_dir points to a directory, it'll automatically load the last backtest file.
|
||||||
trades = load_backtest_data(user_data_dir / "backtest_results/backtest-result.json")
|
backtest_dir = config["user_data_dir"] / "backtest_results"
|
||||||
|
# backtest_dir can also point to a specific file
|
||||||
|
# backtest_dir = config["user_data_dir"] / "backtest_results/backtest-result-2020-07-01_20-04-22.json"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
```python
|
||||||
|
# You can get the full backtest statistics by using the following command.
|
||||||
|
# This contains all information used to generate the backtest result.
|
||||||
|
stats = load_backtest_stats(backtest_dir)
|
||||||
|
|
||||||
|
strategy = 'SampleStrategy'
|
||||||
|
# All statistics are available per strategy, so if `--strategy-list` was used during backtest, this will be reflected here as well.
|
||||||
|
# Example usages:
|
||||||
|
print(stats['strategy'][strategy]['results_per_pair'])
|
||||||
|
# Get pairlist used for this backtest
|
||||||
|
print(stats['strategy'][strategy]['pairlist'])
|
||||||
|
# Get market change (average change of all pairs from start to end of the backtest period)
|
||||||
|
print(stats['strategy'][strategy]['market_change'])
|
||||||
|
# Maximum drawdown ()
|
||||||
|
print(stats['strategy'][strategy]['max_drawdown'])
|
||||||
|
# Maximum drawdown start and end
|
||||||
|
print(stats['strategy'][strategy]['drawdown_start'])
|
||||||
|
print(stats['strategy'][strategy]['drawdown_end'])
|
||||||
|
|
||||||
|
|
||||||
|
# Get strategy comparison (only relevant if multiple strategies were compared)
|
||||||
|
print(stats['strategy_comparison'])
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
```python
|
||||||
|
# Load backtested trades as dataframe
|
||||||
|
trades = load_backtest_data(backtest_dir)
|
||||||
|
|
||||||
# Show value-counts per pair
|
# Show value-counts per pair
|
||||||
trades.groupby("pair")["sell_reason"].value_counts()
|
trades.groupby("pair")["sell_reason"].value_counts()
|
||||||
@@ -107,6 +143,21 @@ trades = load_trades_from_db("sqlite:///tradesv3.sqlite")
|
|||||||
trades.groupby("pair")["sell_reason"].value_counts()
|
trades.groupby("pair")["sell_reason"].value_counts()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Analyze the loaded trades for trade parallelism
|
||||||
|
This can be useful to find the best `max_open_trades` parameter, when used with backtesting in conjunction with `--disable-max-market-positions`.
|
||||||
|
|
||||||
|
`analyze_trade_parallelism()` returns a timeseries dataframe with an "open_trades" column, specifying the number of open trades for each candle.
|
||||||
|
|
||||||
|
|
||||||
|
```python
|
||||||
|
from freqtrade.data.btanalysis import analyze_trade_parallelism
|
||||||
|
|
||||||
|
# Analyze the above
|
||||||
|
parallel_trades = analyze_trade_parallelism(trades, '5m')
|
||||||
|
|
||||||
|
parallel_trades.plot()
|
||||||
|
```
|
||||||
|
|
||||||
## Plot results
|
## Plot results
|
||||||
|
|
||||||
Freqtrade offers interactive plotting capabilities based on plotly.
|
Freqtrade offers interactive plotting capabilities based on plotly.
|
||||||
@@ -116,11 +167,14 @@ Freqtrade offers interactive plotting capabilities based on plotly.
|
|||||||
from freqtrade.plot.plotting import generate_candlestick_graph
|
from freqtrade.plot.plotting import generate_candlestick_graph
|
||||||
# Limit graph period to keep plotly quick and reactive
|
# Limit graph period to keep plotly quick and reactive
|
||||||
|
|
||||||
|
# Filter trades to one pair
|
||||||
|
trades_red = trades.loc[trades['pair'] == pair]
|
||||||
|
|
||||||
data_red = data['2019-06-01':'2019-06-10']
|
data_red = data['2019-06-01':'2019-06-10']
|
||||||
# Generate candlestick graph
|
# Generate candlestick graph
|
||||||
graph = generate_candlestick_graph(pair=pair,
|
graph = generate_candlestick_graph(pair=pair,
|
||||||
data=data_red,
|
data=data_red,
|
||||||
trades=trades,
|
trades=trades_red,
|
||||||
indicators1=['sma20', 'ema50', 'ema55'],
|
indicators1=['sma20', 'ema50', 'ema55'],
|
||||||
indicators2=['rsi', 'macd', 'macdsignal', 'macdhist']
|
indicators2=['rsi', 'macd', 'macdsignal', 'macdhist']
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -41,33 +41,65 @@ Talk to the [userinfobot](https://telegram.me/userinfobot)
|
|||||||
|
|
||||||
Get your "Id", you will use it for the config parameter `chat_id`.
|
Get your "Id", you will use it for the config parameter `chat_id`.
|
||||||
|
|
||||||
|
## Control telegram noise
|
||||||
|
|
||||||
|
Freqtrade provides means to control the verbosity of your telegram bot.
|
||||||
|
Each setting has the following possible values:
|
||||||
|
|
||||||
|
* `on` - Messages will be sent, and user will be notified.
|
||||||
|
* `silent` - Message will be sent, Notification will be without sound / vibration.
|
||||||
|
* `off` - Skip sending a message-type all together.
|
||||||
|
|
||||||
|
Example configuration showing the different settings:
|
||||||
|
|
||||||
|
``` json
|
||||||
|
"telegram": {
|
||||||
|
"enabled": true,
|
||||||
|
"token": "your_telegram_token",
|
||||||
|
"chat_id": "your_telegram_chat_id",
|
||||||
|
"notification_settings": {
|
||||||
|
"status": "silent",
|
||||||
|
"warning": "on",
|
||||||
|
"startup": "off",
|
||||||
|
"buy": "silent",
|
||||||
|
"sell": "on",
|
||||||
|
"buy_cancel": "silent",
|
||||||
|
"sell_cancel": "on"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
```
|
||||||
|
|
||||||
## Telegram commands
|
## Telegram commands
|
||||||
|
|
||||||
Per default, the Telegram bot shows predefined commands. Some commands
|
Per default, the Telegram bot shows predefined commands. Some commands
|
||||||
are only available by sending them to the bot. The table below list the
|
are only available by sending them to the bot. The table below list the
|
||||||
official commands. You can ask at any moment for help with `/help`.
|
official commands. You can ask at any moment for help with `/help`.
|
||||||
|
|
||||||
| Command | Default | Description |
|
| Command | Description |
|
||||||
|----------|---------|-------------|
|
|----------|-------------|
|
||||||
| `/start` | | Starts the trader
|
| `/start` | Starts the trader
|
||||||
| `/stop` | | Stops the trader
|
| `/stop` | Stops the trader
|
||||||
| `/stopbuy` | | Stops the trader from opening new trades. Gracefully closes open trades according to their rules.
|
| `/stopbuy` | Stops the trader from opening new trades. Gracefully closes open trades according to their rules.
|
||||||
| `/reload_conf` | | Reloads the configuration file
|
| `/reload_config` | Reloads the configuration file
|
||||||
| `/status` | | Lists all open trades
|
| `/show_config` | Shows part of the current configuration with relevant settings to operation
|
||||||
| `/status table` | | List all open trades in a table format
|
| `/logs [limit]` | Show last log messages.
|
||||||
| `/count` | | Displays number of trades used and available
|
| `/status` | Lists all open trades
|
||||||
| `/profit` | | Display a summary of your profit/loss from close trades and some stats about your performance
|
| `/status table` | List all open trades in a table format. Pending buy orders are marked with an asterisk (*) Pending sell orders are marked with a double asterisk (**)
|
||||||
| `/forcesell <trade_id>` | | Instantly sells the given trade (Ignoring `minimum_roi`).
|
| `/trades [limit]` | List all recently closed trades in a table format.
|
||||||
| `/forcesell all` | | Instantly sells all open trades (Ignoring `minimum_roi`).
|
| `/delete <trade_id>` | Delete a specific trade from the Database. Tries to close open orders. Requires manual handling of this trade on the exchange.
|
||||||
| `/forcebuy <pair> [rate]` | | Instantly buys the given pair. Rate is optional. (`forcebuy_enable` must be set to True)
|
| `/count` | Displays number of trades used and available
|
||||||
| `/performance` | | Show performance of each finished trade grouped by pair
|
| `/profit` | Display a summary of your profit/loss from close trades and some stats about your performance
|
||||||
| `/balance` | | Show account balance per currency
|
| `/forcesell <trade_id>` | Instantly sells the given trade (Ignoring `minimum_roi`).
|
||||||
| `/daily <n>` | 7 | Shows profit or loss per day, over the last n days
|
| `/forcesell all` | Instantly sells all open trades (Ignoring `minimum_roi`).
|
||||||
| `/whitelist` | | Show the current whitelist
|
| `/forcebuy <pair> [rate]` | Instantly buys the given pair. Rate is optional. (`forcebuy_enable` must be set to True)
|
||||||
| `/blacklist [pair]` | | Show the current blacklist, or adds a pair to the blacklist.
|
| `/performance` | Show performance of each finished trade grouped by pair
|
||||||
| `/edge` | | Show validated pairs by Edge if it is enabled.
|
| `/balance` | Show account balance per currency
|
||||||
| `/help` | | Show help message
|
| `/daily <n>` | Shows profit or loss per day, over the last n days (n defaults to 7)
|
||||||
| `/version` | | Show version
|
| `/whitelist` | Show the current whitelist
|
||||||
|
| `/blacklist [pair]` | Show the current blacklist, or adds a pair to the blacklist.
|
||||||
|
| `/edge` | Show validated pairs by Edge if it is enabled.
|
||||||
|
| `/help` | Show help message
|
||||||
|
| `/version` | Show version
|
||||||
|
|
||||||
## Telegram commands in action
|
## Telegram commands in action
|
||||||
|
|
||||||
@@ -84,16 +116,16 @@ Below, example of Telegram message you will receive for each command.
|
|||||||
|
|
||||||
### /stopbuy
|
### /stopbuy
|
||||||
|
|
||||||
> **status:** `Setting max_open_trades to 0. Run /reload_conf to reset.`
|
> **status:** `Setting max_open_trades to 0. Run /reload_config to reset.`
|
||||||
|
|
||||||
Prevents the bot from opening new trades by temporarily setting "max_open_trades" to 0. Open trades will be handled via their regular rules (ROI / Sell-signal, stoploss, ...).
|
Prevents the bot from opening new trades by temporarily setting "max_open_trades" to 0. Open trades will be handled via their regular rules (ROI / Sell-signal, stoploss, ...).
|
||||||
|
|
||||||
After this, give the bot time to close off open trades (can be checked via `/status table`).
|
After this, give the bot time to close off open trades (can be checked via `/status table`).
|
||||||
Once all positions are sold, run `/stop` to completely stop the bot.
|
Once all positions are sold, run `/stop` to completely stop the bot.
|
||||||
|
|
||||||
`/reload_conf` resets "max_open_trades" to the value set in the configuration and resets this command.
|
`/reload_config` resets "max_open_trades" to the value set in the configuration and resets this command.
|
||||||
|
|
||||||
!!! warning
|
!!! Warning
|
||||||
The stop-buy signal is ONLY active while the bot is running, and is not persisted anyway, so restarting the bot will cause this to reset.
|
The stop-buy signal is ONLY active while the bot is running, and is not persisted anyway, so restarting the bot will cause this to reset.
|
||||||
|
|
||||||
### /status
|
### /status
|
||||||
@@ -112,6 +144,7 @@ For each open trade, the bot will send you the following message.
|
|||||||
### /status table
|
### /status table
|
||||||
|
|
||||||
Return the status of all open trades in a table format.
|
Return the status of all open trades in a table format.
|
||||||
|
|
||||||
```
|
```
|
||||||
ID Pair Since Profit
|
ID Pair Since Profit
|
||||||
---- -------- ------- --------
|
---- -------- ------- --------
|
||||||
@@ -122,6 +155,7 @@ Return the status of all open trades in a table format.
|
|||||||
### /count
|
### /count
|
||||||
|
|
||||||
Return the number of trades used and available.
|
Return the number of trades used and available.
|
||||||
|
|
||||||
```
|
```
|
||||||
current max
|
current max
|
||||||
--------- -----
|
--------- -----
|
||||||
@@ -207,15 +241,15 @@ Shows the current whitelist
|
|||||||
|
|
||||||
Shows the current blacklist.
|
Shows the current blacklist.
|
||||||
If Pair is set, then this pair will be added to the pairlist.
|
If Pair is set, then this pair will be added to the pairlist.
|
||||||
Also supports multiple pairs, seperated by a space.
|
Also supports multiple pairs, separated by a space.
|
||||||
Use `/reload_conf` to reset the blacklist.
|
Use `/reload_config` to reset the blacklist.
|
||||||
|
|
||||||
> Using blacklist `StaticPairList` with 2 pairs
|
> Using blacklist `StaticPairList` with 2 pairs
|
||||||
>`DODGE/BTC`, `HOT/BTC`.
|
>`DODGE/BTC`, `HOT/BTC`.
|
||||||
|
|
||||||
### /edge
|
### /edge
|
||||||
|
|
||||||
Shows pairs validated by Edge along with their corresponding winrate, expectancy and stoploss values.
|
Shows pairs validated by Edge along with their corresponding win-rate, expectancy and stoploss values.
|
||||||
|
|
||||||
> **Edge only validated following pairs:**
|
> **Edge only validated following pairs:**
|
||||||
```
|
```
|
||||||
|
|||||||
470
docs/utils.md
470
docs/utils.md
@@ -2,6 +2,241 @@
|
|||||||
|
|
||||||
Besides the Live-Trade and Dry-Run run modes, the `backtesting`, `edge` and `hyperopt` optimization subcommands, and the `download-data` subcommand which prepares historical data, the bot contains a number of utility subcommands. They are described in this section.
|
Besides the Live-Trade and Dry-Run run modes, the `backtesting`, `edge` and `hyperopt` optimization subcommands, and the `download-data` subcommand which prepares historical data, the bot contains a number of utility subcommands. They are described in this section.
|
||||||
|
|
||||||
|
## Create userdir
|
||||||
|
|
||||||
|
Creates the directory structure to hold your files for freqtrade.
|
||||||
|
Will also create strategy and hyperopt examples for you to get started.
|
||||||
|
Can be used multiple times - using `--reset` will reset the sample strategy and hyperopt files to their default state.
|
||||||
|
|
||||||
|
```
|
||||||
|
usage: freqtrade create-userdir [-h] [--userdir PATH] [--reset]
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
--reset Reset sample files to their original state.
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Warning
|
||||||
|
Using `--reset` may result in loss of data, since this will overwrite all sample files without asking again.
|
||||||
|
|
||||||
|
```
|
||||||
|
├── backtest_results
|
||||||
|
├── data
|
||||||
|
├── hyperopt_results
|
||||||
|
├── hyperopts
|
||||||
|
│ ├── sample_hyperopt_advanced.py
|
||||||
|
│ ├── sample_hyperopt_loss.py
|
||||||
|
│ └── sample_hyperopt.py
|
||||||
|
├── notebooks
|
||||||
|
│ └── strategy_analysis_example.ipynb
|
||||||
|
├── plot
|
||||||
|
└── strategies
|
||||||
|
└── sample_strategy.py
|
||||||
|
```
|
||||||
|
|
||||||
|
## Create new config
|
||||||
|
|
||||||
|
Creates a new configuration file, asking some questions which are important selections for a configuration.
|
||||||
|
|
||||||
|
```
|
||||||
|
usage: freqtrade new-config [-h] [-c PATH]
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
-c PATH, --config PATH
|
||||||
|
Specify configuration file (default: `config.json`). Multiple --config options may be used. Can be set to `-`
|
||||||
|
to read config from stdin.
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Warning
|
||||||
|
Only vital questions are asked. Freqtrade offers a lot more configuration possibilities, which are listed in the [Configuration documentation](configuration.md#configuration-parameters)
|
||||||
|
|
||||||
|
### Create config examples
|
||||||
|
|
||||||
|
```
|
||||||
|
$ freqtrade new-config --config config_binance.json
|
||||||
|
|
||||||
|
? Do you want to enable Dry-run (simulated trades)? Yes
|
||||||
|
? Please insert your stake currency: BTC
|
||||||
|
? Please insert your stake amount: 0.05
|
||||||
|
? Please insert max_open_trades (Integer or 'unlimited'): 3
|
||||||
|
? Please insert your desired timeframe (e.g. 5m): 5m
|
||||||
|
? Please insert your display Currency (for reporting): USD
|
||||||
|
? Select exchange binance
|
||||||
|
? Do you want to enable Telegram? No
|
||||||
|
```
|
||||||
|
|
||||||
|
## Create new strategy
|
||||||
|
|
||||||
|
Creates a new strategy from a template similar to SampleStrategy.
|
||||||
|
The file will be named inline with your class name, and will not overwrite existing files.
|
||||||
|
|
||||||
|
Results will be located in `user_data/strategies/<strategyclassname>.py`.
|
||||||
|
|
||||||
|
``` output
|
||||||
|
usage: freqtrade new-strategy [-h] [--userdir PATH] [-s NAME]
|
||||||
|
[--template {full,minimal,advanced}]
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
-s NAME, --strategy NAME
|
||||||
|
Specify strategy class name which will be used by the
|
||||||
|
bot.
|
||||||
|
--template {full,minimal,advanced}
|
||||||
|
Use a template which is either `minimal`, `full`
|
||||||
|
(containing multiple sample indicators) or `advanced`.
|
||||||
|
Default: `full`.
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Sample usage of new-strategy
|
||||||
|
|
||||||
|
```bash
|
||||||
|
freqtrade new-strategy --strategy AwesomeStrategy
|
||||||
|
```
|
||||||
|
|
||||||
|
With custom user directory
|
||||||
|
|
||||||
|
```bash
|
||||||
|
freqtrade new-strategy --userdir ~/.freqtrade/ --strategy AwesomeStrategy
|
||||||
|
```
|
||||||
|
|
||||||
|
Using the advanced template (populates all optional functions and methods)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
freqtrade new-strategy --strategy AwesomeStrategy --template advanced
|
||||||
|
```
|
||||||
|
|
||||||
|
## Create new hyperopt
|
||||||
|
|
||||||
|
Creates a new hyperopt from a template similar to SampleHyperopt.
|
||||||
|
The file will be named inline with your class name, and will not overwrite existing files.
|
||||||
|
|
||||||
|
Results will be located in `user_data/hyperopts/<classname>.py`.
|
||||||
|
|
||||||
|
``` output
|
||||||
|
usage: freqtrade new-hyperopt [-h] [--userdir PATH] [--hyperopt NAME]
|
||||||
|
[--template {full,minimal,advanced}]
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
--hyperopt NAME Specify hyperopt class name which will be used by the
|
||||||
|
bot.
|
||||||
|
--template {full,minimal,advanced}
|
||||||
|
Use a template which is either `minimal`, `full`
|
||||||
|
(containing multiple sample indicators) or `advanced`.
|
||||||
|
Default: `full`.
|
||||||
|
```
|
||||||
|
|
||||||
|
### Sample usage of new-hyperopt
|
||||||
|
|
||||||
|
```bash
|
||||||
|
freqtrade new-hyperopt --hyperopt AwesomeHyperopt
|
||||||
|
```
|
||||||
|
|
||||||
|
With custom user directory
|
||||||
|
|
||||||
|
```bash
|
||||||
|
freqtrade new-hyperopt --userdir ~/.freqtrade/ --hyperopt AwesomeHyperopt
|
||||||
|
```
|
||||||
|
|
||||||
|
## List Strategies and List Hyperopts
|
||||||
|
|
||||||
|
Use the `list-strategies` subcommand to see all strategies in one particular directory and the `list-hyperopts` subcommand to list custom Hyperopts.
|
||||||
|
|
||||||
|
These subcommands are useful for finding problems in your environment with loading strategies or hyperopt classes: modules with strategies or hyperopt classes that contain errors and failed to load are printed in red (LOAD FAILED), while strategies or hyperopt classes with duplicate names are printed in yellow (DUPLICATE NAME).
|
||||||
|
|
||||||
|
```
|
||||||
|
usage: freqtrade list-strategies [-h] [-v] [--logfile FILE] [-V] [-c PATH]
|
||||||
|
[-d PATH] [--userdir PATH]
|
||||||
|
[--strategy-path PATH] [-1] [--no-color]
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
--strategy-path PATH Specify additional strategy lookup path.
|
||||||
|
-1, --one-column Print output in one column.
|
||||||
|
--no-color Disable colorization of hyperopt results. May be
|
||||||
|
useful if you are redirecting output to a file.
|
||||||
|
|
||||||
|
Common arguments:
|
||||||
|
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
||||||
|
--logfile FILE Log to the file specified. Special values are:
|
||||||
|
'syslog', 'journald'. See the documentation for more
|
||||||
|
details.
|
||||||
|
-V, --version show program's version number and exit
|
||||||
|
-c PATH, --config PATH
|
||||||
|
Specify configuration file (default: `config.json`).
|
||||||
|
Multiple --config options may be used. Can be set to
|
||||||
|
`-` to read config from stdin.
|
||||||
|
-d PATH, --datadir PATH
|
||||||
|
Path to directory with historical backtesting data.
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
```
|
||||||
|
```
|
||||||
|
usage: freqtrade list-hyperopts [-h] [-v] [--logfile FILE] [-V] [-c PATH]
|
||||||
|
[-d PATH] [--userdir PATH]
|
||||||
|
[--hyperopt-path PATH] [-1] [--no-color]
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
--hyperopt-path PATH Specify additional lookup path for Hyperopt and
|
||||||
|
Hyperopt Loss functions.
|
||||||
|
-1, --one-column Print output in one column.
|
||||||
|
--no-color Disable colorization of hyperopt results. May be
|
||||||
|
useful if you are redirecting output to a file.
|
||||||
|
|
||||||
|
Common arguments:
|
||||||
|
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
||||||
|
--logfile FILE Log to the file specified. Special values are:
|
||||||
|
'syslog', 'journald'. See the documentation for more
|
||||||
|
details.
|
||||||
|
-V, --version show program's version number and exit
|
||||||
|
-c PATH, --config PATH
|
||||||
|
Specify configuration file (default: `config.json`).
|
||||||
|
Multiple --config options may be used. Can be set to
|
||||||
|
`-` to read config from stdin.
|
||||||
|
-d PATH, --datadir PATH
|
||||||
|
Path to directory with historical backtesting data.
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Warning
|
||||||
|
Using these commands will try to load all python files from a directory. This can be a security risk if untrusted files reside in this directory, since all module-level code is executed.
|
||||||
|
|
||||||
|
Example: Search default strategies and hyperopts directories (within the default userdir).
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
freqtrade list-strategies
|
||||||
|
freqtrade list-hyperopts
|
||||||
|
```
|
||||||
|
|
||||||
|
Example: Search strategies and hyperopts directory within the userdir.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
freqtrade list-strategies --userdir ~/.freqtrade/
|
||||||
|
freqtrade list-hyperopts --userdir ~/.freqtrade/
|
||||||
|
```
|
||||||
|
|
||||||
|
Example: Search dedicated strategy path.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
freqtrade list-strategies --strategy-path ~/.freqtrade/strategies/
|
||||||
|
```
|
||||||
|
|
||||||
|
Example: Search dedicated hyperopt path.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
freqtrade list-hyperopt --hyperopt-path ~/.freqtrade/hyperopts/
|
||||||
|
```
|
||||||
|
|
||||||
## List Exchanges
|
## List Exchanges
|
||||||
|
|
||||||
Use the `list-exchanges` subcommand to see the exchanges available for the bot.
|
Use the `list-exchanges` subcommand to see the exchanges available for the bot.
|
||||||
@@ -29,23 +264,34 @@ All exchanges supported by the ccxt library: _1btcxe, acx, adara, allcoin, anxpr
|
|||||||
|
|
||||||
## List Timeframes
|
## List Timeframes
|
||||||
|
|
||||||
Use the `list-timeframes` subcommand to see the list of ticker intervals (timeframes) available for the exchange.
|
Use the `list-timeframes` subcommand to see the list of timeframes (ticker intervals) available for the exchange.
|
||||||
|
|
||||||
```
|
```
|
||||||
usage: freqtrade list-timeframes [-h] [--exchange EXCHANGE] [-1]
|
usage: freqtrade list-timeframes [-h] [-v] [--logfile FILE] [-V] [-c PATH] [-d PATH] [--userdir PATH] [--exchange EXCHANGE] [-1]
|
||||||
|
|
||||||
optional arguments:
|
optional arguments:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
--exchange EXCHANGE Exchange name (default: `bittrex`). Only valid if no
|
--exchange EXCHANGE Exchange name (default: `bittrex`). Only valid if no config is provided.
|
||||||
config is provided.
|
-1, --one-column Print output in one column.
|
||||||
-1, --one-column Print output in one column.
|
|
||||||
|
Common arguments:
|
||||||
|
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
||||||
|
--logfile FILE Log to the file specified. Special values are: 'syslog', 'journald'. See the documentation for more details.
|
||||||
|
-V, --version show program's version number and exit
|
||||||
|
-c PATH, --config PATH
|
||||||
|
Specify configuration file (default: `config.json`). Multiple --config options may be used. Can be set to `-`
|
||||||
|
to read config from stdin.
|
||||||
|
-d PATH, --datadir PATH
|
||||||
|
Path to directory with historical backtesting data.
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
* Example: see the timeframes for the 'binance' exchange, set in the configuration file:
|
* Example: see the timeframes for the 'binance' exchange, set in the configuration file:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ freqtrade -c config_binance.json list-timeframes
|
$ freqtrade list-timeframes -c config_binance.json
|
||||||
...
|
...
|
||||||
Timeframes available for the exchange `binance`: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M
|
Timeframes available for the exchange `binance`: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M
|
||||||
```
|
```
|
||||||
@@ -69,14 +315,16 @@ You can print info about any pair/market with these subcommands - and you can fi
|
|||||||
These subcommands have same usage and same set of available options:
|
These subcommands have same usage and same set of available options:
|
||||||
|
|
||||||
```
|
```
|
||||||
usage: freqtrade list-markets [-h] [--exchange EXCHANGE] [--print-list]
|
usage: freqtrade list-markets [-h] [-v] [--logfile FILE] [-V] [-c PATH]
|
||||||
[--print-json] [-1] [--print-csv]
|
[-d PATH] [--userdir PATH] [--exchange EXCHANGE]
|
||||||
|
[--print-list] [--print-json] [-1] [--print-csv]
|
||||||
[--base BASE_CURRENCY [BASE_CURRENCY ...]]
|
[--base BASE_CURRENCY [BASE_CURRENCY ...]]
|
||||||
[--quote QUOTE_CURRENCY [QUOTE_CURRENCY ...]]
|
[--quote QUOTE_CURRENCY [QUOTE_CURRENCY ...]]
|
||||||
[-a]
|
[-a]
|
||||||
|
|
||||||
usage: freqtrade list-pairs [-h] [--exchange EXCHANGE] [--print-list]
|
usage: freqtrade list-pairs [-h] [-v] [--logfile FILE] [-V] [-c PATH]
|
||||||
[--print-json] [-1] [--print-csv]
|
[-d PATH] [--userdir PATH] [--exchange EXCHANGE]
|
||||||
|
[--print-list] [--print-json] [-1] [--print-csv]
|
||||||
[--base BASE_CURRENCY [BASE_CURRENCY ...]]
|
[--base BASE_CURRENCY [BASE_CURRENCY ...]]
|
||||||
[--quote QUOTE_CURRENCY [QUOTE_CURRENCY ...]] [-a]
|
[--quote QUOTE_CURRENCY [QUOTE_CURRENCY ...]] [-a]
|
||||||
|
|
||||||
@@ -95,6 +343,22 @@ optional arguments:
|
|||||||
Specify quote currency(-ies). Space-separated list.
|
Specify quote currency(-ies). Space-separated list.
|
||||||
-a, --all Print all pairs or market symbols. By default only
|
-a, --all Print all pairs or market symbols. By default only
|
||||||
active ones are shown.
|
active ones are shown.
|
||||||
|
|
||||||
|
Common arguments:
|
||||||
|
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
||||||
|
--logfile FILE Log to the file specified. Special values are:
|
||||||
|
'syslog', 'journald'. See the documentation for more
|
||||||
|
details.
|
||||||
|
-V, --version show program's version number and exit
|
||||||
|
-c PATH, --config PATH
|
||||||
|
Specify configuration file (default: `config.json`).
|
||||||
|
Multiple --config options may be used. Can be set to
|
||||||
|
`-` to read config from stdin.
|
||||||
|
-d PATH, --datadir PATH
|
||||||
|
Path to directory with historical backtesting data.
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
By default, only active pairs/markets are shown. Active pairs/markets are those that can currently be traded
|
By default, only active pairs/markets are shown. Active pairs/markets are those that can currently be traded
|
||||||
@@ -116,7 +380,7 @@ $ freqtrade list-pairs --quote USD --print-json
|
|||||||
human-readable list with summary:
|
human-readable list with summary:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ freqtrade -c config_binance.json list-pairs --all --base BTC ETH --quote USDT USD --print-list
|
$ freqtrade list-pairs -c config_binance.json --all --base BTC ETH --quote USDT USD --print-list
|
||||||
```
|
```
|
||||||
|
|
||||||
* Print all markets on exchange "Kraken", in the tabular format:
|
* Print all markets on exchange "Kraken", in the tabular format:
|
||||||
@@ -124,3 +388,185 @@ $ freqtrade -c config_binance.json list-pairs --all --base BTC ETH --quote USDT
|
|||||||
```
|
```
|
||||||
$ freqtrade list-markets --exchange kraken --all
|
$ freqtrade list-markets --exchange kraken --all
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Test pairlist
|
||||||
|
|
||||||
|
Use the `test-pairlist` subcommand to test the configuration of [dynamic pairlists](configuration.md#pairlists).
|
||||||
|
|
||||||
|
Requires a configuration with specified `pairlists` attribute.
|
||||||
|
Can be used to generate static pairlists to be used during backtesting / hyperopt.
|
||||||
|
|
||||||
|
```
|
||||||
|
usage: freqtrade test-pairlist [-h] [-c PATH]
|
||||||
|
[--quote QUOTE_CURRENCY [QUOTE_CURRENCY ...]]
|
||||||
|
[-1] [--print-json]
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
-c PATH, --config PATH
|
||||||
|
Specify configuration file (default: `config.json`).
|
||||||
|
Multiple --config options may be used. Can be set to
|
||||||
|
`-` to read config from stdin.
|
||||||
|
--quote QUOTE_CURRENCY [QUOTE_CURRENCY ...]
|
||||||
|
Specify quote currency(-ies). Space-separated list.
|
||||||
|
-1, --one-column Print output in one column.
|
||||||
|
--print-json Print list of pairs or market symbols in JSON format.
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
Show whitelist when using a [dynamic pairlist](configuration.md#pairlists).
|
||||||
|
|
||||||
|
```
|
||||||
|
freqtrade test-pairlist --config config.json --quote USDT BTC
|
||||||
|
```
|
||||||
|
|
||||||
|
## List Hyperopt results
|
||||||
|
|
||||||
|
You can list the hyperoptimization epochs the Hyperopt module evaluated previously with the `hyperopt-list` subcommand.
|
||||||
|
|
||||||
|
```
|
||||||
|
usage: freqtrade hyperopt-list [-h] [-v] [--logfile FILE] [-V] [-c PATH]
|
||||||
|
[-d PATH] [--userdir PATH] [--best]
|
||||||
|
[--profitable] [--min-trades INT]
|
||||||
|
[--max-trades INT] [--min-avg-time FLOAT]
|
||||||
|
[--max-avg-time FLOAT] [--min-avg-profit FLOAT]
|
||||||
|
[--max-avg-profit FLOAT]
|
||||||
|
[--min-total-profit FLOAT] [--max-total-profit FLOAT]
|
||||||
|
[--min-objective FLOAT] [--max-objective FLOAT]
|
||||||
|
[--no-color] [--print-json] [--no-details]
|
||||||
|
[--export-csv FILE]
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
--best Select only best epochs.
|
||||||
|
--profitable Select only profitable epochs.
|
||||||
|
--min-trades INT Select epochs with more than INT trades.
|
||||||
|
--max-trades INT Select epochs with less than INT trades.
|
||||||
|
--min-avg-time FLOAT Select epochs on above average time.
|
||||||
|
--max-avg-time FLOAT Select epochs on under average time.
|
||||||
|
--min-avg-profit FLOAT
|
||||||
|
Select epochs on above average profit.
|
||||||
|
--max-avg-profit FLOAT
|
||||||
|
Select epochs on below average profit.
|
||||||
|
--min-total-profit FLOAT
|
||||||
|
Select epochs on above total profit.
|
||||||
|
--max-total-profit FLOAT
|
||||||
|
Select epochs on below total profit.
|
||||||
|
--min-objective FLOAT
|
||||||
|
Select epochs on above objective (- is added by default).
|
||||||
|
--max-objective FLOAT
|
||||||
|
Select epochs on below objective (- is added by default).
|
||||||
|
--no-color Disable colorization of hyperopt results. May be
|
||||||
|
useful if you are redirecting output to a file.
|
||||||
|
--print-json Print best result detailization in JSON format.
|
||||||
|
--no-details Do not print best epoch details.
|
||||||
|
--export-csv FILE Export to CSV-File. This will disable table print.
|
||||||
|
Example: --export-csv hyperopt.csv
|
||||||
|
|
||||||
|
Common arguments:
|
||||||
|
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
||||||
|
--logfile FILE Log to the file specified. Special values are:
|
||||||
|
'syslog', 'journald'. See the documentation for more
|
||||||
|
details.
|
||||||
|
-V, --version show program's version number and exit
|
||||||
|
-c PATH, --config PATH
|
||||||
|
Specify configuration file (default:
|
||||||
|
`userdir/config.json` or `config.json` whichever
|
||||||
|
exists). Multiple --config options may be used. Can be
|
||||||
|
set to `-` to read config from stdin.
|
||||||
|
-d PATH, --datadir PATH
|
||||||
|
Path to directory with historical backtesting data.
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
List all results, print details of the best result at the end:
|
||||||
|
```
|
||||||
|
freqtrade hyperopt-list
|
||||||
|
```
|
||||||
|
|
||||||
|
List only epochs with positive profit. Do not print the details of the best epoch, so that the list can be iterated in a script:
|
||||||
|
```
|
||||||
|
freqtrade hyperopt-list --profitable --no-details
|
||||||
|
```
|
||||||
|
|
||||||
|
## Show details of Hyperopt results
|
||||||
|
|
||||||
|
You can show the details of any hyperoptimization epoch previously evaluated by the Hyperopt module with the `hyperopt-show` subcommand.
|
||||||
|
|
||||||
|
```
|
||||||
|
usage: freqtrade hyperopt-show [-h] [-v] [--logfile FILE] [-V] [-c PATH]
|
||||||
|
[-d PATH] [--userdir PATH] [--best]
|
||||||
|
[--profitable] [-n INT] [--print-json]
|
||||||
|
[--no-header]
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
--best Select only best epochs.
|
||||||
|
--profitable Select only profitable epochs.
|
||||||
|
-n INT, --index INT Specify the index of the epoch to print details for.
|
||||||
|
--print-json Print best result detailization in JSON format.
|
||||||
|
--no-header Do not print epoch details header.
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
Print details for the epoch 168 (the number of the epoch is shown by the `hyperopt-list` subcommand or by Hyperopt itself during hyperoptimization run):
|
||||||
|
|
||||||
|
```
|
||||||
|
freqtrade hyperopt-show -n 168
|
||||||
|
```
|
||||||
|
|
||||||
|
Prints JSON data with details for the last best epoch (i.e., the best of all epochs):
|
||||||
|
|
||||||
|
```
|
||||||
|
freqtrade hyperopt-show --best -n -1 --print-json --no-header
|
||||||
|
```
|
||||||
|
|
||||||
|
## Show trades
|
||||||
|
|
||||||
|
Print selected (or all) trades from database to screen.
|
||||||
|
|
||||||
|
```
|
||||||
|
usage: freqtrade show-trades [-h] [-v] [--logfile FILE] [-V] [-c PATH]
|
||||||
|
[-d PATH] [--userdir PATH] [--db-url PATH]
|
||||||
|
[--trade-ids TRADE_IDS [TRADE_IDS ...]]
|
||||||
|
[--print-json]
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
--db-url PATH Override trades database URL, this is useful in custom
|
||||||
|
deployments (default: `sqlite:///tradesv3.sqlite` for
|
||||||
|
Live Run mode, `sqlite:///tradesv3.dryrun.sqlite` for
|
||||||
|
Dry Run).
|
||||||
|
--trade-ids TRADE_IDS [TRADE_IDS ...]
|
||||||
|
Specify the list of trade ids.
|
||||||
|
--print-json Print output in JSON format.
|
||||||
|
|
||||||
|
Common arguments:
|
||||||
|
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
||||||
|
--logfile FILE Log to the file specified. Special values are:
|
||||||
|
'syslog', 'journald'. See the documentation for more
|
||||||
|
details.
|
||||||
|
-V, --version show program's version number and exit
|
||||||
|
-c PATH, --config PATH
|
||||||
|
Specify configuration file (default:
|
||||||
|
`userdir/config.json` or `config.json` whichever
|
||||||
|
exists). Multiple --config options may be used. Can be
|
||||||
|
set to `-` to read config from stdin.
|
||||||
|
-d PATH, --datadir PATH
|
||||||
|
Path to directory with historical backtesting data.
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
Print trades with id 2 and 3 as json
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
freqtrade show-trades --db-url sqlite:///tradesv3.sqlite --trade-ids 2 3 --print-json
|
||||||
|
```
|
||||||
|
|||||||
@@ -15,10 +15,20 @@ Sample configuration (tested using IFTTT).
|
|||||||
"value2": "limit {limit:8f}",
|
"value2": "limit {limit:8f}",
|
||||||
"value3": "{stake_amount:8f} {stake_currency}"
|
"value3": "{stake_amount:8f} {stake_currency}"
|
||||||
},
|
},
|
||||||
|
"webhookbuycancel": {
|
||||||
|
"value1": "Cancelling Open Buy Order for {pair}",
|
||||||
|
"value2": "limit {limit:8f}",
|
||||||
|
"value3": "{stake_amount:8f} {stake_currency}"
|
||||||
|
},
|
||||||
"webhooksell": {
|
"webhooksell": {
|
||||||
"value1": "Selling {pair}",
|
"value1": "Selling {pair}",
|
||||||
"value2": "limit {limit:8f}",
|
"value2": "limit {limit:8f}",
|
||||||
"value3": "profit: {profit_amount:8f} {stake_currency}"
|
"value3": "profit: {profit_amount:8f} {stake_currency} ({profit_ratio})"
|
||||||
|
},
|
||||||
|
"webhooksellcancel": {
|
||||||
|
"value1": "Cancelling Open Sell Order for {pair}",
|
||||||
|
"value2": "limit {limit:8f}",
|
||||||
|
"value3": "profit: {profit_amount:8f} {stake_currency} ({profit_ratio})"
|
||||||
},
|
},
|
||||||
"webhookstatus": {
|
"webhookstatus": {
|
||||||
"value1": "Status: {status}",
|
"value1": "Status: {status}",
|
||||||
@@ -37,19 +47,41 @@ Different payloads can be configured for different events. Not all fields are ne
|
|||||||
The fields in `webhook.webhookbuy` are filled when the bot executes a buy. Parameters are filled using string.format.
|
The fields in `webhook.webhookbuy` are filled when the bot executes a buy. Parameters are filled using string.format.
|
||||||
Possible parameters are:
|
Possible parameters are:
|
||||||
|
|
||||||
|
* `trade_id`
|
||||||
* `exchange`
|
* `exchange`
|
||||||
* `pair`
|
* `pair`
|
||||||
* `limit`
|
* `limit`
|
||||||
|
* `amount`
|
||||||
|
* `open_date`
|
||||||
* `stake_amount`
|
* `stake_amount`
|
||||||
* `stake_currency`
|
* `stake_currency`
|
||||||
* `fiat_currency`
|
* `fiat_currency`
|
||||||
* `order_type`
|
* `order_type`
|
||||||
|
* `current_rate`
|
||||||
|
|
||||||
|
### Webhookbuycancel
|
||||||
|
|
||||||
|
The fields in `webhook.webhookbuycancel` are filled when the bot cancels a buy order. Parameters are filled using string.format.
|
||||||
|
Possible parameters are:
|
||||||
|
|
||||||
|
* `trade_id`
|
||||||
|
* `exchange`
|
||||||
|
* `pair`
|
||||||
|
* `limit`
|
||||||
|
* `amount`
|
||||||
|
* `open_date`
|
||||||
|
* `stake_amount`
|
||||||
|
* `stake_currency`
|
||||||
|
* `fiat_currency`
|
||||||
|
* `order_type`
|
||||||
|
* `current_rate`
|
||||||
|
|
||||||
### Webhooksell
|
### Webhooksell
|
||||||
|
|
||||||
The fields in `webhook.webhooksell` are filled when the bot sells a trade. Parameters are filled using string.format.
|
The fields in `webhook.webhooksell` are filled when the bot sells a trade. Parameters are filled using string.format.
|
||||||
Possible parameters are:
|
Possible parameters are:
|
||||||
|
|
||||||
|
* `trade_id`
|
||||||
* `exchange`
|
* `exchange`
|
||||||
* `pair`
|
* `pair`
|
||||||
* `gain`
|
* `gain`
|
||||||
@@ -58,11 +90,35 @@ Possible parameters are:
|
|||||||
* `open_rate`
|
* `open_rate`
|
||||||
* `current_rate`
|
* `current_rate`
|
||||||
* `profit_amount`
|
* `profit_amount`
|
||||||
* `profit_percent`
|
* `profit_ratio`
|
||||||
* `stake_currency`
|
* `stake_currency`
|
||||||
* `fiat_currency`
|
* `fiat_currency`
|
||||||
* `sell_reason`
|
* `sell_reason`
|
||||||
* `order_type`
|
* `order_type`
|
||||||
|
* `open_date`
|
||||||
|
* `close_date`
|
||||||
|
|
||||||
|
### Webhooksellcancel
|
||||||
|
|
||||||
|
The fields in `webhook.webhooksellcancel` are filled when the bot cancels a sell order. Parameters are filled using string.format.
|
||||||
|
Possible parameters are:
|
||||||
|
|
||||||
|
* `trade_id`
|
||||||
|
* `exchange`
|
||||||
|
* `pair`
|
||||||
|
* `gain`
|
||||||
|
* `limit`
|
||||||
|
* `amount`
|
||||||
|
* `open_rate`
|
||||||
|
* `current_rate`
|
||||||
|
* `profit_amount`
|
||||||
|
* `profit_ratio`
|
||||||
|
* `stake_currency`
|
||||||
|
* `fiat_currency`
|
||||||
|
* `sell_reason`
|
||||||
|
* `order_type`
|
||||||
|
* `open_date`
|
||||||
|
* `close_date`
|
||||||
|
|
||||||
### Webhookstatus
|
### Webhookstatus
|
||||||
|
|
||||||
|
|||||||
57
docs/windows_installation.md
Normal file
57
docs/windows_installation.md
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
We **strongly** recommend that Windows users use [Docker](docker.md) as this will work much easier and smoother (also more secure).
|
||||||
|
|
||||||
|
If that is not possible, try using the Windows Linux subsystem (WSL) - for which the Ubuntu instructions should work.
|
||||||
|
Otherwise, try the instructions below.
|
||||||
|
|
||||||
|
## Install freqtrade manually
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
Make sure to use 64bit Windows and 64bit Python to avoid problems with backtesting or hyperopt due to the memory constraints 32bit applications have under Windows.
|
||||||
|
|
||||||
|
!!! Hint
|
||||||
|
Using the [Anaconda Distribution](https://www.anaconda.com/distribution/) under Windows can greatly help with installation problems. Check out the [Anaconda installation section](installation.md#Anaconda) in this document for more information.
|
||||||
|
|
||||||
|
### 1. Clone the git repository
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/freqtrade/freqtrade.git
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Install ta-lib
|
||||||
|
|
||||||
|
Install ta-lib according to the [ta-lib documentation](https://github.com/mrjbq7/ta-lib#windows).
|
||||||
|
|
||||||
|
As compiling from source on windows has heavy dependencies (requires a partial visual studio installation), there is also a repository of unofficial precompiled windows Wheels [here](https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib), which needs to be downloaded and installed using `pip install TA_Lib‑0.4.18‑cp38‑cp38‑win_amd64.whl` (make sure to use the version matching your python version)
|
||||||
|
|
||||||
|
Freqtrade provides these dependencies for the latest 2 Python versions (3.7 and 3.8) and for 64bit Windows.
|
||||||
|
Other versions must be downloaded from the above link.
|
||||||
|
|
||||||
|
``` powershell
|
||||||
|
cd \path\freqtrade
|
||||||
|
python -m venv .env
|
||||||
|
.env\Scripts\activate.ps1
|
||||||
|
# optionally install ta-lib from wheel
|
||||||
|
# Eventually adjust the below filename to match the downloaded wheel
|
||||||
|
pip install build_helpes/TA_Lib‑0.4.18‑cp38‑cp38‑win_amd64.whl
|
||||||
|
pip install -r requirements.txt
|
||||||
|
pip install -e .
|
||||||
|
freqtrade
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Note "Use Powershell"
|
||||||
|
The above installation script assumes you're using powershell on a 64bit windows.
|
||||||
|
Commands for the legacy CMD windows console may differ.
|
||||||
|
|
||||||
|
> Thanks [Owdr](https://github.com/Owdr) for the commands. Source: [Issue #222](https://github.com/freqtrade/freqtrade/issues/222)
|
||||||
|
|
||||||
|
### Error during installation on Windows
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
|
||||||
|
```
|
||||||
|
|
||||||
|
Unfortunately, many packages requiring compilation don't provide a pre-build wheel. It is therefore mandatory to have a C/C++ compiler installed and available for your python environment to use.
|
||||||
|
|
||||||
|
The easiest way is to download install Microsoft Visual Studio Community [here](https://visualstudio.microsoft.com/downloads/) and make sure to install "Common Tools for Visual C++" to enable building c code on Windows. Unfortunately, this is a heavy download / dependency (~4Gb) so you might want to consider WSL or [docker](docker.md) first.
|
||||||
|
|
||||||
|
---
|
||||||
@@ -45,7 +45,7 @@ dependencies:
|
|||||||
- pip:
|
- pip:
|
||||||
# Required for app
|
# Required for app
|
||||||
- cython
|
- cython
|
||||||
- coinmarketcap
|
- pycoingecko
|
||||||
- ccxt
|
- ccxt
|
||||||
- TA-Lib
|
- TA-Lib
|
||||||
- py_find_1st
|
- py_find_1st
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ After=network.target
|
|||||||
# Set WorkingDirectory and ExecStart to your file paths accordingly
|
# Set WorkingDirectory and ExecStart to your file paths accordingly
|
||||||
# NOTE: %h will be resolved to /home/<username>
|
# NOTE: %h will be resolved to /home/<username>
|
||||||
WorkingDirectory=%h/freqtrade
|
WorkingDirectory=%h/freqtrade
|
||||||
ExecStart=/usr/bin/freqtrade
|
ExecStart=/usr/bin/freqtrade trade
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ After=network.target
|
|||||||
# Set WorkingDirectory and ExecStart to your file paths accordingly
|
# Set WorkingDirectory and ExecStart to your file paths accordingly
|
||||||
# NOTE: %h will be resolved to /home/<username>
|
# NOTE: %h will be resolved to /home/<username>
|
||||||
WorkingDirectory=%h/freqtrade
|
WorkingDirectory=%h/freqtrade
|
||||||
ExecStart=/usr/bin/freqtrade --sd-notify
|
ExecStart=/usr/bin/freqtrade trade --sd-notify
|
||||||
|
|
||||||
Restart=always
|
Restart=always
|
||||||
#Restart=on-failure
|
#Restart=on-failure
|
||||||
|
|||||||
@@ -1,44 +1,34 @@
|
|||||||
""" FreqTrade bot """
|
""" Freqtrade bot """
|
||||||
__version__ = '2019.10'
|
__version__ = '2020.9.1'
|
||||||
|
|
||||||
if __version__ == 'develop':
|
if __version__ == 'develop':
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
__version__ = 'develop-' + subprocess.check_output(
|
__version__ = 'develop-' + subprocess.check_output(
|
||||||
['git', 'log', '--format="%h"', '-n 1'],
|
['git', 'log', '--format="%h"', '-n 1'],
|
||||||
stderr=subprocess.DEVNULL).decode("utf-8").rstrip().strip('"')
|
stderr=subprocess.DEVNULL).decode("utf-8").rstrip().strip('"')
|
||||||
|
|
||||||
|
# from datetime import datetime
|
||||||
|
# last_release = subprocess.check_output(
|
||||||
|
# ['git', 'tag']
|
||||||
|
# ).decode('utf-8').split()[-1].split(".")
|
||||||
|
# # Releases are in the format "2020.1" - we increment the latest version for dev.
|
||||||
|
# prefix = f"{last_release[0]}.{int(last_release[1]) + 1}"
|
||||||
|
# dev_version = int(datetime.now().timestamp() // 1000)
|
||||||
|
# __version__ = f"{prefix}.dev{dev_version}"
|
||||||
|
|
||||||
|
# subprocess.check_output(
|
||||||
|
# ['git', 'log', '--format="%h"', '-n 1'],
|
||||||
|
# stderr=subprocess.DEVNULL).decode("utf-8").rstrip().strip('"')
|
||||||
except Exception:
|
except Exception:
|
||||||
# git not available, ignore
|
# git not available, ignore
|
||||||
pass
|
try:
|
||||||
|
# Try Fallback to freqtrade_commit file (created by CI while building docker image)
|
||||||
|
from pathlib import Path
|
||||||
class DependencyException(Exception):
|
versionfile = Path('./freqtrade_commit')
|
||||||
"""
|
if versionfile.is_file():
|
||||||
Indicates that an assumed dependency is not met.
|
__version__ = f"docker-{versionfile.read_text()[:8]}"
|
||||||
This could happen when there is currently not enough money on the account.
|
except Exception:
|
||||||
"""
|
pass
|
||||||
|
|
||||||
|
|
||||||
class OperationalException(Exception):
|
|
||||||
"""
|
|
||||||
Requires manual intervention and will usually stop the bot.
|
|
||||||
This happens when an exchange returns an unexpected error during runtime
|
|
||||||
or given configuration is invalid.
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
class InvalidOrderException(Exception):
|
|
||||||
"""
|
|
||||||
This is returned when the order is not valid. Example:
|
|
||||||
If stoploss on exchange order is hit, then trying to cancel the order
|
|
||||||
should return this exception.
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
class TemporaryError(Exception):
|
|
||||||
"""
|
|
||||||
Temporary network or exchange related error.
|
|
||||||
This could happen when an exchange is congested, unavailable, or the user
|
|
||||||
has networking problems. Usually resolves itself after a time.
|
|
||||||
"""
|
|
||||||
|
|||||||
30
freqtrade/commands/__init__.py
Normal file
30
freqtrade/commands/__init__.py
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# flake8: noqa: F401
|
||||||
|
"""
|
||||||
|
Commands module.
|
||||||
|
Contains all start-commands, subcommands and CLI Interface creation.
|
||||||
|
|
||||||
|
Note: Be careful with file-scoped imports in these subfiles.
|
||||||
|
as they are parsed on startup, nothing containing optional modules should be loaded.
|
||||||
|
"""
|
||||||
|
from freqtrade.commands.arguments import Arguments
|
||||||
|
from freqtrade.commands.build_config_commands import start_new_config
|
||||||
|
from freqtrade.commands.data_commands import (start_convert_data,
|
||||||
|
start_download_data,
|
||||||
|
start_list_data)
|
||||||
|
from freqtrade.commands.deploy_commands import (start_create_userdir,
|
||||||
|
start_new_hyperopt,
|
||||||
|
start_new_strategy)
|
||||||
|
from freqtrade.commands.hyperopt_commands import (start_hyperopt_list,
|
||||||
|
start_hyperopt_show)
|
||||||
|
from freqtrade.commands.list_commands import (start_list_exchanges,
|
||||||
|
start_list_hyperopts,
|
||||||
|
start_list_markets,
|
||||||
|
start_list_strategies,
|
||||||
|
start_list_timeframes,
|
||||||
|
start_show_trades)
|
||||||
|
from freqtrade.commands.optimize_commands import (start_backtesting,
|
||||||
|
start_edge, start_hyperopt)
|
||||||
|
from freqtrade.commands.pairlist_commands import start_test_pairlist
|
||||||
|
from freqtrade.commands.plot_commands import (start_plot_dataframe,
|
||||||
|
start_plot_profit)
|
||||||
|
from freqtrade.commands.trade_commands import start_trading
|
||||||
372
freqtrade/commands/arguments.py
Normal file
372
freqtrade/commands/arguments.py
Normal file
@@ -0,0 +1,372 @@
|
|||||||
|
"""
|
||||||
|
This module contains the argument manager class
|
||||||
|
"""
|
||||||
|
import argparse
|
||||||
|
from functools import partial
|
||||||
|
from pathlib import Path
|
||||||
|
from typing import Any, Dict, List, Optional
|
||||||
|
|
||||||
|
from freqtrade.commands.cli_options import AVAILABLE_CLI_OPTIONS
|
||||||
|
from freqtrade.constants import DEFAULT_CONFIG
|
||||||
|
|
||||||
|
ARGS_COMMON = ["verbosity", "logfile", "version", "config", "datadir", "user_data_dir"]
|
||||||
|
|
||||||
|
ARGS_STRATEGY = ["strategy", "strategy_path"]
|
||||||
|
|
||||||
|
ARGS_TRADE = ["db_url", "sd_notify", "dry_run"]
|
||||||
|
|
||||||
|
ARGS_COMMON_OPTIMIZE = ["timeframe", "timerange", "dataformat_ohlcv",
|
||||||
|
"max_open_trades", "stake_amount", "fee"]
|
||||||
|
|
||||||
|
ARGS_BACKTEST = ARGS_COMMON_OPTIMIZE + ["position_stacking", "use_max_market_positions",
|
||||||
|
"strategy_list", "export", "exportfilename"]
|
||||||
|
|
||||||
|
ARGS_HYPEROPT = ARGS_COMMON_OPTIMIZE + ["hyperopt", "hyperopt_path",
|
||||||
|
"position_stacking", "epochs", "spaces",
|
||||||
|
"use_max_market_positions", "print_all",
|
||||||
|
"print_colorized", "print_json", "hyperopt_jobs",
|
||||||
|
"hyperopt_random_state", "hyperopt_min_trades",
|
||||||
|
"hyperopt_continue", "hyperopt_loss"]
|
||||||
|
|
||||||
|
ARGS_EDGE = ARGS_COMMON_OPTIMIZE + ["stoploss_range"]
|
||||||
|
|
||||||
|
ARGS_LIST_STRATEGIES = ["strategy_path", "print_one_column", "print_colorized"]
|
||||||
|
|
||||||
|
ARGS_LIST_HYPEROPTS = ["hyperopt_path", "print_one_column", "print_colorized"]
|
||||||
|
|
||||||
|
ARGS_LIST_EXCHANGES = ["print_one_column", "list_exchanges_all"]
|
||||||
|
|
||||||
|
ARGS_LIST_TIMEFRAMES = ["exchange", "print_one_column"]
|
||||||
|
|
||||||
|
ARGS_LIST_PAIRS = ["exchange", "print_list", "list_pairs_print_json", "print_one_column",
|
||||||
|
"print_csv", "base_currencies", "quote_currencies", "list_pairs_all"]
|
||||||
|
|
||||||
|
ARGS_TEST_PAIRLIST = ["config", "quote_currencies", "print_one_column", "list_pairs_print_json"]
|
||||||
|
|
||||||
|
ARGS_CREATE_USERDIR = ["user_data_dir", "reset"]
|
||||||
|
|
||||||
|
ARGS_BUILD_CONFIG = ["config"]
|
||||||
|
|
||||||
|
ARGS_BUILD_STRATEGY = ["user_data_dir", "strategy", "template"]
|
||||||
|
|
||||||
|
ARGS_BUILD_HYPEROPT = ["user_data_dir", "hyperopt", "template"]
|
||||||
|
|
||||||
|
ARGS_CONVERT_DATA = ["pairs", "format_from", "format_to", "erase"]
|
||||||
|
ARGS_CONVERT_DATA_OHLCV = ARGS_CONVERT_DATA + ["timeframes"]
|
||||||
|
|
||||||
|
ARGS_LIST_DATA = ["exchange", "dataformat_ohlcv", "pairs"]
|
||||||
|
|
||||||
|
ARGS_DOWNLOAD_DATA = ["pairs", "pairs_file", "days", "timerange", "download_trades", "exchange",
|
||||||
|
"timeframes", "erase", "dataformat_ohlcv", "dataformat_trades"]
|
||||||
|
|
||||||
|
ARGS_PLOT_DATAFRAME = ["pairs", "indicators1", "indicators2", "plot_limit",
|
||||||
|
"db_url", "trade_source", "export", "exportfilename",
|
||||||
|
"timerange", "timeframe", "no_trades"]
|
||||||
|
|
||||||
|
ARGS_PLOT_PROFIT = ["pairs", "timerange", "export", "exportfilename", "db_url",
|
||||||
|
"trade_source", "timeframe"]
|
||||||
|
|
||||||
|
ARGS_SHOW_TRADES = ["db_url", "trade_ids", "print_json"]
|
||||||
|
|
||||||
|
ARGS_HYPEROPT_LIST = ["hyperopt_list_best", "hyperopt_list_profitable",
|
||||||
|
"hyperopt_list_min_trades", "hyperopt_list_max_trades",
|
||||||
|
"hyperopt_list_min_avg_time", "hyperopt_list_max_avg_time",
|
||||||
|
"hyperopt_list_min_avg_profit", "hyperopt_list_max_avg_profit",
|
||||||
|
"hyperopt_list_min_total_profit", "hyperopt_list_max_total_profit",
|
||||||
|
"hyperopt_list_min_objective", "hyperopt_list_max_objective",
|
||||||
|
"print_colorized", "print_json", "hyperopt_list_no_details",
|
||||||
|
"export_csv"]
|
||||||
|
|
||||||
|
ARGS_HYPEROPT_SHOW = ["hyperopt_list_best", "hyperopt_list_profitable", "hyperopt_show_index",
|
||||||
|
"print_json", "hyperopt_show_no_header"]
|
||||||
|
|
||||||
|
NO_CONF_REQURIED = ["convert-data", "convert-trade-data", "download-data", "list-timeframes",
|
||||||
|
"list-markets", "list-pairs", "list-strategies", "list-data",
|
||||||
|
"list-hyperopts", "hyperopt-list", "hyperopt-show",
|
||||||
|
"plot-dataframe", "plot-profit", "show-trades"]
|
||||||
|
|
||||||
|
NO_CONF_ALLOWED = ["create-userdir", "list-exchanges", "new-hyperopt", "new-strategy"]
|
||||||
|
|
||||||
|
|
||||||
|
class Arguments:
|
||||||
|
"""
|
||||||
|
Arguments Class. Manage the arguments received by the cli
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, args: Optional[List[str]]) -> None:
|
||||||
|
self.args = args
|
||||||
|
self._parsed_arg: Optional[argparse.Namespace] = None
|
||||||
|
|
||||||
|
def get_parsed_arg(self) -> Dict[str, Any]:
|
||||||
|
"""
|
||||||
|
Return the list of arguments
|
||||||
|
:return: List[str] List of arguments
|
||||||
|
"""
|
||||||
|
if self._parsed_arg is None:
|
||||||
|
self._build_subcommands()
|
||||||
|
self._parsed_arg = self._parse_args()
|
||||||
|
|
||||||
|
return vars(self._parsed_arg)
|
||||||
|
|
||||||
|
def _parse_args(self) -> argparse.Namespace:
|
||||||
|
"""
|
||||||
|
Parses given arguments and returns an argparse Namespace instance.
|
||||||
|
"""
|
||||||
|
parsed_arg = self.parser.parse_args(self.args)
|
||||||
|
|
||||||
|
# Workaround issue in argparse with action='append' and default value
|
||||||
|
# (see https://bugs.python.org/issue16399)
|
||||||
|
# Allow no-config for certain commands (like downloading / plotting)
|
||||||
|
if ('config' in parsed_arg and parsed_arg.config is None):
|
||||||
|
conf_required = ('command' in parsed_arg and parsed_arg.command in NO_CONF_REQURIED)
|
||||||
|
|
||||||
|
if 'user_data_dir' in parsed_arg and parsed_arg.user_data_dir is not None:
|
||||||
|
user_dir = parsed_arg.user_data_dir
|
||||||
|
else:
|
||||||
|
# Default case
|
||||||
|
user_dir = 'user_data'
|
||||||
|
# Try loading from "user_data/config.json"
|
||||||
|
cfgfile = Path(user_dir) / DEFAULT_CONFIG
|
||||||
|
if cfgfile.is_file():
|
||||||
|
parsed_arg.config = [str(cfgfile)]
|
||||||
|
else:
|
||||||
|
# Else use "config.json".
|
||||||
|
cfgfile = Path.cwd() / DEFAULT_CONFIG
|
||||||
|
if cfgfile.is_file() or not conf_required:
|
||||||
|
parsed_arg.config = [DEFAULT_CONFIG]
|
||||||
|
|
||||||
|
return parsed_arg
|
||||||
|
|
||||||
|
def _build_args(self, optionlist, parser):
|
||||||
|
|
||||||
|
for val in optionlist:
|
||||||
|
opt = AVAILABLE_CLI_OPTIONS[val]
|
||||||
|
parser.add_argument(*opt.cli, dest=val, **opt.kwargs)
|
||||||
|
|
||||||
|
def _build_subcommands(self) -> None:
|
||||||
|
"""
|
||||||
|
Builds and attaches all subcommands.
|
||||||
|
:return: None
|
||||||
|
"""
|
||||||
|
# Build shared arguments (as group Common Options)
|
||||||
|
_common_parser = argparse.ArgumentParser(add_help=False)
|
||||||
|
group = _common_parser.add_argument_group("Common arguments")
|
||||||
|
self._build_args(optionlist=ARGS_COMMON, parser=group)
|
||||||
|
|
||||||
|
_strategy_parser = argparse.ArgumentParser(add_help=False)
|
||||||
|
strategy_group = _strategy_parser.add_argument_group("Strategy arguments")
|
||||||
|
self._build_args(optionlist=ARGS_STRATEGY, parser=strategy_group)
|
||||||
|
|
||||||
|
# Build main command
|
||||||
|
self.parser = argparse.ArgumentParser(description='Free, open source crypto trading bot')
|
||||||
|
self._build_args(optionlist=['version'], parser=self.parser)
|
||||||
|
|
||||||
|
from freqtrade.commands import (start_create_userdir, start_convert_data,
|
||||||
|
start_download_data, start_list_data,
|
||||||
|
start_hyperopt_list, start_hyperopt_show,
|
||||||
|
start_list_exchanges, start_list_hyperopts,
|
||||||
|
start_list_markets, start_list_strategies,
|
||||||
|
start_list_timeframes, start_new_config,
|
||||||
|
start_new_hyperopt, start_new_strategy,
|
||||||
|
start_plot_dataframe, start_plot_profit, start_show_trades,
|
||||||
|
start_backtesting, start_hyperopt, start_edge,
|
||||||
|
start_test_pairlist, start_trading)
|
||||||
|
|
||||||
|
subparsers = self.parser.add_subparsers(dest='command',
|
||||||
|
# Use custom message when no subhandler is added
|
||||||
|
# shown from `main.py`
|
||||||
|
# required=True
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add trade subcommand
|
||||||
|
trade_cmd = subparsers.add_parser('trade', help='Trade module.',
|
||||||
|
parents=[_common_parser, _strategy_parser])
|
||||||
|
trade_cmd.set_defaults(func=start_trading)
|
||||||
|
self._build_args(optionlist=ARGS_TRADE, parser=trade_cmd)
|
||||||
|
|
||||||
|
# add create-userdir subcommand
|
||||||
|
create_userdir_cmd = subparsers.add_parser('create-userdir',
|
||||||
|
help="Create user-data directory.",
|
||||||
|
)
|
||||||
|
create_userdir_cmd.set_defaults(func=start_create_userdir)
|
||||||
|
self._build_args(optionlist=ARGS_CREATE_USERDIR, parser=create_userdir_cmd)
|
||||||
|
|
||||||
|
# add new-config subcommand
|
||||||
|
build_config_cmd = subparsers.add_parser('new-config',
|
||||||
|
help="Create new config")
|
||||||
|
build_config_cmd.set_defaults(func=start_new_config)
|
||||||
|
self._build_args(optionlist=ARGS_BUILD_CONFIG, parser=build_config_cmd)
|
||||||
|
|
||||||
|
# add new-hyperopt subcommand
|
||||||
|
build_hyperopt_cmd = subparsers.add_parser('new-hyperopt',
|
||||||
|
help="Create new hyperopt")
|
||||||
|
build_hyperopt_cmd.set_defaults(func=start_new_hyperopt)
|
||||||
|
self._build_args(optionlist=ARGS_BUILD_HYPEROPT, parser=build_hyperopt_cmd)
|
||||||
|
|
||||||
|
# add new-strategy subcommand
|
||||||
|
build_strategy_cmd = subparsers.add_parser('new-strategy',
|
||||||
|
help="Create new strategy")
|
||||||
|
build_strategy_cmd.set_defaults(func=start_new_strategy)
|
||||||
|
self._build_args(optionlist=ARGS_BUILD_STRATEGY, parser=build_strategy_cmd)
|
||||||
|
|
||||||
|
# Add download-data subcommand
|
||||||
|
download_data_cmd = subparsers.add_parser(
|
||||||
|
'download-data',
|
||||||
|
help='Download backtesting data.',
|
||||||
|
parents=[_common_parser],
|
||||||
|
)
|
||||||
|
download_data_cmd.set_defaults(func=start_download_data)
|
||||||
|
self._build_args(optionlist=ARGS_DOWNLOAD_DATA, parser=download_data_cmd)
|
||||||
|
|
||||||
|
# Add convert-data subcommand
|
||||||
|
convert_data_cmd = subparsers.add_parser(
|
||||||
|
'convert-data',
|
||||||
|
help='Convert candle (OHLCV) data from one format to another.',
|
||||||
|
parents=[_common_parser],
|
||||||
|
)
|
||||||
|
convert_data_cmd.set_defaults(func=partial(start_convert_data, ohlcv=True))
|
||||||
|
self._build_args(optionlist=ARGS_CONVERT_DATA_OHLCV, parser=convert_data_cmd)
|
||||||
|
|
||||||
|
# Add convert-trade-data subcommand
|
||||||
|
convert_trade_data_cmd = subparsers.add_parser(
|
||||||
|
'convert-trade-data',
|
||||||
|
help='Convert trade data from one format to another.',
|
||||||
|
parents=[_common_parser],
|
||||||
|
)
|
||||||
|
convert_trade_data_cmd.set_defaults(func=partial(start_convert_data, ohlcv=False))
|
||||||
|
self._build_args(optionlist=ARGS_CONVERT_DATA, parser=convert_trade_data_cmd)
|
||||||
|
|
||||||
|
# Add list-data subcommand
|
||||||
|
list_data_cmd = subparsers.add_parser(
|
||||||
|
'list-data',
|
||||||
|
help='List downloaded data.',
|
||||||
|
parents=[_common_parser],
|
||||||
|
)
|
||||||
|
list_data_cmd.set_defaults(func=start_list_data)
|
||||||
|
self._build_args(optionlist=ARGS_LIST_DATA, parser=list_data_cmd)
|
||||||
|
|
||||||
|
# Add backtesting subcommand
|
||||||
|
backtesting_cmd = subparsers.add_parser('backtesting', help='Backtesting module.',
|
||||||
|
parents=[_common_parser, _strategy_parser])
|
||||||
|
backtesting_cmd.set_defaults(func=start_backtesting)
|
||||||
|
self._build_args(optionlist=ARGS_BACKTEST, parser=backtesting_cmd)
|
||||||
|
|
||||||
|
# Add edge subcommand
|
||||||
|
edge_cmd = subparsers.add_parser('edge', help='Edge module.',
|
||||||
|
parents=[_common_parser, _strategy_parser])
|
||||||
|
edge_cmd.set_defaults(func=start_edge)
|
||||||
|
self._build_args(optionlist=ARGS_EDGE, parser=edge_cmd)
|
||||||
|
|
||||||
|
# Add hyperopt subcommand
|
||||||
|
hyperopt_cmd = subparsers.add_parser('hyperopt', help='Hyperopt module.',
|
||||||
|
parents=[_common_parser, _strategy_parser],
|
||||||
|
)
|
||||||
|
hyperopt_cmd.set_defaults(func=start_hyperopt)
|
||||||
|
self._build_args(optionlist=ARGS_HYPEROPT, parser=hyperopt_cmd)
|
||||||
|
|
||||||
|
# Add hyperopt-list subcommand
|
||||||
|
hyperopt_list_cmd = subparsers.add_parser(
|
||||||
|
'hyperopt-list',
|
||||||
|
help='List Hyperopt results',
|
||||||
|
parents=[_common_parser],
|
||||||
|
)
|
||||||
|
hyperopt_list_cmd.set_defaults(func=start_hyperopt_list)
|
||||||
|
self._build_args(optionlist=ARGS_HYPEROPT_LIST, parser=hyperopt_list_cmd)
|
||||||
|
|
||||||
|
# Add hyperopt-show subcommand
|
||||||
|
hyperopt_show_cmd = subparsers.add_parser(
|
||||||
|
'hyperopt-show',
|
||||||
|
help='Show details of Hyperopt results',
|
||||||
|
parents=[_common_parser],
|
||||||
|
)
|
||||||
|
hyperopt_show_cmd.set_defaults(func=start_hyperopt_show)
|
||||||
|
self._build_args(optionlist=ARGS_HYPEROPT_SHOW, parser=hyperopt_show_cmd)
|
||||||
|
|
||||||
|
# Add list-exchanges subcommand
|
||||||
|
list_exchanges_cmd = subparsers.add_parser(
|
||||||
|
'list-exchanges',
|
||||||
|
help='Print available exchanges.',
|
||||||
|
parents=[_common_parser],
|
||||||
|
)
|
||||||
|
list_exchanges_cmd.set_defaults(func=start_list_exchanges)
|
||||||
|
self._build_args(optionlist=ARGS_LIST_EXCHANGES, parser=list_exchanges_cmd)
|
||||||
|
|
||||||
|
# Add list-hyperopts subcommand
|
||||||
|
list_hyperopts_cmd = subparsers.add_parser(
|
||||||
|
'list-hyperopts',
|
||||||
|
help='Print available hyperopt classes.',
|
||||||
|
parents=[_common_parser],
|
||||||
|
)
|
||||||
|
list_hyperopts_cmd.set_defaults(func=start_list_hyperopts)
|
||||||
|
self._build_args(optionlist=ARGS_LIST_HYPEROPTS, parser=list_hyperopts_cmd)
|
||||||
|
|
||||||
|
# Add list-markets subcommand
|
||||||
|
list_markets_cmd = subparsers.add_parser(
|
||||||
|
'list-markets',
|
||||||
|
help='Print markets on exchange.',
|
||||||
|
parents=[_common_parser],
|
||||||
|
)
|
||||||
|
list_markets_cmd.set_defaults(func=partial(start_list_markets, pairs_only=False))
|
||||||
|
self._build_args(optionlist=ARGS_LIST_PAIRS, parser=list_markets_cmd)
|
||||||
|
|
||||||
|
# Add list-pairs subcommand
|
||||||
|
list_pairs_cmd = subparsers.add_parser(
|
||||||
|
'list-pairs',
|
||||||
|
help='Print pairs on exchange.',
|
||||||
|
parents=[_common_parser],
|
||||||
|
)
|
||||||
|
list_pairs_cmd.set_defaults(func=partial(start_list_markets, pairs_only=True))
|
||||||
|
self._build_args(optionlist=ARGS_LIST_PAIRS, parser=list_pairs_cmd)
|
||||||
|
|
||||||
|
# Add list-strategies subcommand
|
||||||
|
list_strategies_cmd = subparsers.add_parser(
|
||||||
|
'list-strategies',
|
||||||
|
help='Print available strategies.',
|
||||||
|
parents=[_common_parser],
|
||||||
|
)
|
||||||
|
list_strategies_cmd.set_defaults(func=start_list_strategies)
|
||||||
|
self._build_args(optionlist=ARGS_LIST_STRATEGIES, parser=list_strategies_cmd)
|
||||||
|
|
||||||
|
# Add list-timeframes subcommand
|
||||||
|
list_timeframes_cmd = subparsers.add_parser(
|
||||||
|
'list-timeframes',
|
||||||
|
help='Print available timeframes for the exchange.',
|
||||||
|
parents=[_common_parser],
|
||||||
|
)
|
||||||
|
list_timeframes_cmd.set_defaults(func=start_list_timeframes)
|
||||||
|
self._build_args(optionlist=ARGS_LIST_TIMEFRAMES, parser=list_timeframes_cmd)
|
||||||
|
|
||||||
|
# Add show-trades subcommand
|
||||||
|
show_trades = subparsers.add_parser(
|
||||||
|
'show-trades',
|
||||||
|
help='Show trades.',
|
||||||
|
parents=[_common_parser],
|
||||||
|
)
|
||||||
|
show_trades.set_defaults(func=start_show_trades)
|
||||||
|
self._build_args(optionlist=ARGS_SHOW_TRADES, parser=show_trades)
|
||||||
|
|
||||||
|
# Add test-pairlist subcommand
|
||||||
|
test_pairlist_cmd = subparsers.add_parser(
|
||||||
|
'test-pairlist',
|
||||||
|
help='Test your pairlist configuration.',
|
||||||
|
)
|
||||||
|
test_pairlist_cmd.set_defaults(func=start_test_pairlist)
|
||||||
|
self._build_args(optionlist=ARGS_TEST_PAIRLIST, parser=test_pairlist_cmd)
|
||||||
|
|
||||||
|
# Add Plotting subcommand
|
||||||
|
plot_dataframe_cmd = subparsers.add_parser(
|
||||||
|
'plot-dataframe',
|
||||||
|
help='Plot candles with indicators.',
|
||||||
|
parents=[_common_parser, _strategy_parser],
|
||||||
|
)
|
||||||
|
plot_dataframe_cmd.set_defaults(func=start_plot_dataframe)
|
||||||
|
self._build_args(optionlist=ARGS_PLOT_DATAFRAME, parser=plot_dataframe_cmd)
|
||||||
|
|
||||||
|
# Plot profit
|
||||||
|
plot_profit_cmd = subparsers.add_parser(
|
||||||
|
'plot-profit',
|
||||||
|
help='Generate plot showing profits.',
|
||||||
|
parents=[_common_parser, _strategy_parser],
|
||||||
|
)
|
||||||
|
plot_profit_cmd.set_defaults(func=start_plot_profit)
|
||||||
|
self._build_args(optionlist=ARGS_PLOT_PROFIT, parser=plot_profit_cmd)
|
||||||
193
freqtrade/commands/build_config_commands.py
Normal file
193
freqtrade/commands/build_config_commands.py
Normal file
@@ -0,0 +1,193 @@
|
|||||||
|
import logging
|
||||||
|
from pathlib import Path
|
||||||
|
from typing import Any, Dict
|
||||||
|
|
||||||
|
from questionary import Separator, prompt
|
||||||
|
|
||||||
|
from freqtrade.constants import UNLIMITED_STAKE_AMOUNT
|
||||||
|
from freqtrade.exchange import available_exchanges, MAP_EXCHANGE_CHILDCLASS
|
||||||
|
from freqtrade.misc import render_template
|
||||||
|
from freqtrade.exceptions import OperationalException
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def validate_is_int(val):
|
||||||
|
try:
|
||||||
|
_ = int(val)
|
||||||
|
return True
|
||||||
|
except Exception:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def validate_is_float(val):
|
||||||
|
try:
|
||||||
|
_ = float(val)
|
||||||
|
return True
|
||||||
|
except Exception:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def ask_user_overwrite(config_path: Path) -> bool:
|
||||||
|
questions = [
|
||||||
|
{
|
||||||
|
"type": "confirm",
|
||||||
|
"name": "overwrite",
|
||||||
|
"message": f"File {config_path} already exists. Overwrite?",
|
||||||
|
"default": False,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
answers = prompt(questions)
|
||||||
|
return answers['overwrite']
|
||||||
|
|
||||||
|
|
||||||
|
def ask_user_config() -> Dict[str, Any]:
|
||||||
|
"""
|
||||||
|
Ask user a few questions to build the configuration.
|
||||||
|
Interactive questions built using https://github.com/tmbo/questionary
|
||||||
|
:returns: Dict with keys to put into template
|
||||||
|
"""
|
||||||
|
questions = [
|
||||||
|
{
|
||||||
|
"type": "confirm",
|
||||||
|
"name": "dry_run",
|
||||||
|
"message": "Do you want to enable Dry-run (simulated trades)?",
|
||||||
|
"default": True,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"name": "stake_currency",
|
||||||
|
"message": "Please insert your stake currency:",
|
||||||
|
"default": 'BTC',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"name": "stake_amount",
|
||||||
|
"message": "Please insert your stake amount:",
|
||||||
|
"default": "0.01",
|
||||||
|
"validate": lambda val: val == UNLIMITED_STAKE_AMOUNT or validate_is_float(val),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"name": "max_open_trades",
|
||||||
|
"message": f"Please insert max_open_trades (Integer or '{UNLIMITED_STAKE_AMOUNT}'):",
|
||||||
|
"default": "3",
|
||||||
|
"validate": lambda val: val == UNLIMITED_STAKE_AMOUNT or validate_is_int(val)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"name": "timeframe",
|
||||||
|
"message": "Please insert your desired timeframe (e.g. 5m):",
|
||||||
|
"default": "5m",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"name": "fiat_display_currency",
|
||||||
|
"message": "Please insert your display Currency (for reporting):",
|
||||||
|
"default": 'USD',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "select",
|
||||||
|
"name": "exchange_name",
|
||||||
|
"message": "Select exchange",
|
||||||
|
"choices": [
|
||||||
|
"binance",
|
||||||
|
"binanceje",
|
||||||
|
"binanceus",
|
||||||
|
"bittrex",
|
||||||
|
"kraken",
|
||||||
|
Separator(),
|
||||||
|
"other",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "autocomplete",
|
||||||
|
"name": "exchange_name",
|
||||||
|
"message": "Type your exchange name (Must be supported by ccxt)",
|
||||||
|
"choices": available_exchanges(),
|
||||||
|
"when": lambda x: x["exchange_name"] == 'other'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "password",
|
||||||
|
"name": "exchange_key",
|
||||||
|
"message": "Insert Exchange Key",
|
||||||
|
"when": lambda x: not x['dry_run']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "password",
|
||||||
|
"name": "exchange_secret",
|
||||||
|
"message": "Insert Exchange Secret",
|
||||||
|
"when": lambda x: not x['dry_run']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "confirm",
|
||||||
|
"name": "telegram",
|
||||||
|
"message": "Do you want to enable Telegram?",
|
||||||
|
"default": False,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "password",
|
||||||
|
"name": "telegram_token",
|
||||||
|
"message": "Insert Telegram token",
|
||||||
|
"when": lambda x: x['telegram']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"name": "telegram_chat_id",
|
||||||
|
"message": "Insert Telegram chat id",
|
||||||
|
"when": lambda x: x['telegram']
|
||||||
|
},
|
||||||
|
]
|
||||||
|
answers = prompt(questions)
|
||||||
|
|
||||||
|
if not answers:
|
||||||
|
# Interrupted questionary sessions return an empty dict.
|
||||||
|
raise OperationalException("User interrupted interactive questions.")
|
||||||
|
|
||||||
|
return answers
|
||||||
|
|
||||||
|
|
||||||
|
def deploy_new_config(config_path: Path, selections: Dict[str, Any]) -> None:
|
||||||
|
"""
|
||||||
|
Applies selections to the template and writes the result to config_path
|
||||||
|
:param config_path: Path object for new config file. Should not exist yet
|
||||||
|
:param selecions: Dict containing selections taken by the user.
|
||||||
|
"""
|
||||||
|
from jinja2.exceptions import TemplateNotFound
|
||||||
|
try:
|
||||||
|
exchange_template = MAP_EXCHANGE_CHILDCLASS.get(
|
||||||
|
selections['exchange_name'], selections['exchange_name'])
|
||||||
|
|
||||||
|
selections['exchange'] = render_template(
|
||||||
|
templatefile=f"subtemplates/exchange_{exchange_template}.j2",
|
||||||
|
arguments=selections
|
||||||
|
)
|
||||||
|
except TemplateNotFound:
|
||||||
|
selections['exchange'] = render_template(
|
||||||
|
templatefile="subtemplates/exchange_generic.j2",
|
||||||
|
arguments=selections
|
||||||
|
)
|
||||||
|
|
||||||
|
config_text = render_template(templatefile='base_config.json.j2',
|
||||||
|
arguments=selections)
|
||||||
|
|
||||||
|
logger.info(f"Writing config to `{config_path}`.")
|
||||||
|
config_path.write_text(config_text)
|
||||||
|
|
||||||
|
|
||||||
|
def start_new_config(args: Dict[str, Any]) -> None:
|
||||||
|
"""
|
||||||
|
Create a new strategy from a template
|
||||||
|
Asking the user questions to fill out the templateaccordingly.
|
||||||
|
"""
|
||||||
|
|
||||||
|
config_path = Path(args['config'][0])
|
||||||
|
if config_path.exists():
|
||||||
|
overwrite = ask_user_overwrite(config_path)
|
||||||
|
if overwrite:
|
||||||
|
config_path.unlink()
|
||||||
|
else:
|
||||||
|
raise OperationalException(
|
||||||
|
f"Configuration file `{config_path}` already exists. "
|
||||||
|
"Please delete it or use a different configuration file name.")
|
||||||
|
selections = ask_user_config()
|
||||||
|
deploy_new_config(config_path, selections)
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
"""
|
"""
|
||||||
Definition of cli arguments used in arguments.py
|
Definition of cli arguments used in arguments.py
|
||||||
"""
|
"""
|
||||||
import argparse
|
from argparse import ArgumentTypeError
|
||||||
|
|
||||||
from freqtrade import __version__, constants
|
from freqtrade import __version__, constants
|
||||||
|
|
||||||
@@ -12,12 +12,24 @@ def check_int_positive(value: str) -> int:
|
|||||||
if uint <= 0:
|
if uint <= 0:
|
||||||
raise ValueError
|
raise ValueError
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise argparse.ArgumentTypeError(
|
raise ArgumentTypeError(
|
||||||
f"{value} is invalid for this parameter, should be a positive integer value"
|
f"{value} is invalid for this parameter, should be a positive integer value"
|
||||||
)
|
)
|
||||||
return uint
|
return uint
|
||||||
|
|
||||||
|
|
||||||
|
def check_int_nonzero(value: str) -> int:
|
||||||
|
try:
|
||||||
|
uint = int(value)
|
||||||
|
if uint == 0:
|
||||||
|
raise ValueError
|
||||||
|
except ValueError:
|
||||||
|
raise ArgumentTypeError(
|
||||||
|
f"{value} is invalid for this parameter, should be a non-zero integer value"
|
||||||
|
)
|
||||||
|
return uint
|
||||||
|
|
||||||
|
|
||||||
class Arg:
|
class Arg:
|
||||||
# Optional CLI arguments
|
# Optional CLI arguments
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
@@ -36,7 +48,8 @@ AVAILABLE_CLI_OPTIONS = {
|
|||||||
),
|
),
|
||||||
"logfile": Arg(
|
"logfile": Arg(
|
||||||
'--logfile',
|
'--logfile',
|
||||||
help='Log to the file specified.',
|
help="Log to the file specified. Special values are: 'syslog', 'journald'. "
|
||||||
|
"See the documentation for more details.",
|
||||||
metavar='FILE',
|
metavar='FILE',
|
||||||
),
|
),
|
||||||
"version": Arg(
|
"version": Arg(
|
||||||
@@ -46,7 +59,8 @@ AVAILABLE_CLI_OPTIONS = {
|
|||||||
),
|
),
|
||||||
"config": Arg(
|
"config": Arg(
|
||||||
'-c', '--config',
|
'-c', '--config',
|
||||||
help=f'Specify configuration file (default: `{constants.DEFAULT_CONFIG}`). '
|
help=f'Specify configuration file (default: `userdir/{constants.DEFAULT_CONFIG}` '
|
||||||
|
f'or `config.json` whichever exists). '
|
||||||
f'Multiple --config options may be used. '
|
f'Multiple --config options may be used. '
|
||||||
f'Can be set to `-` to read config from stdin.',
|
f'Can be set to `-` to read config from stdin.',
|
||||||
action='append',
|
action='append',
|
||||||
@@ -62,12 +76,16 @@ AVAILABLE_CLI_OPTIONS = {
|
|||||||
help='Path to userdata directory.',
|
help='Path to userdata directory.',
|
||||||
metavar='PATH',
|
metavar='PATH',
|
||||||
),
|
),
|
||||||
|
"reset": Arg(
|
||||||
|
'--reset',
|
||||||
|
help='Reset sample files to their original state.',
|
||||||
|
action='store_true',
|
||||||
|
),
|
||||||
# Main options
|
# Main options
|
||||||
"strategy": Arg(
|
"strategy": Arg(
|
||||||
'-s', '--strategy',
|
'-s', '--strategy',
|
||||||
help='Specify strategy class name (default: `%(default)s`).',
|
help='Specify strategy class name which will be used by the bot.',
|
||||||
metavar='NAME',
|
metavar='NAME',
|
||||||
default='DefaultStrategy',
|
|
||||||
),
|
),
|
||||||
"strategy_path": Arg(
|
"strategy_path": Arg(
|
||||||
'--strategy-path',
|
'--strategy-path',
|
||||||
@@ -86,9 +104,14 @@ AVAILABLE_CLI_OPTIONS = {
|
|||||||
help='Notify systemd service manager.',
|
help='Notify systemd service manager.',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
),
|
),
|
||||||
|
"dry_run": Arg(
|
||||||
|
'--dry-run',
|
||||||
|
help='Enforce dry-run for trading (removes Exchange secrets and simulates trades).',
|
||||||
|
action='store_true',
|
||||||
|
),
|
||||||
# Optimize common
|
# Optimize common
|
||||||
"ticker_interval": Arg(
|
"timeframe": Arg(
|
||||||
'-i', '--ticker-interval',
|
'-i', '--timeframe', '--ticker-interval',
|
||||||
help='Specify ticker interval (`1m`, `5m`, `30m`, `1h`, `1d`).',
|
help='Specify ticker interval (`1m`, `5m`, `30m`, `1h`, `1d`).',
|
||||||
),
|
),
|
||||||
"timerange": Arg(
|
"timerange": Arg(
|
||||||
@@ -96,14 +119,14 @@ AVAILABLE_CLI_OPTIONS = {
|
|||||||
help='Specify what timerange of data to use.',
|
help='Specify what timerange of data to use.',
|
||||||
),
|
),
|
||||||
"max_open_trades": Arg(
|
"max_open_trades": Arg(
|
||||||
'--max_open_trades',
|
'--max-open-trades',
|
||||||
help='Specify max_open_trades to use.',
|
help='Override the value of the `max_open_trades` configuration setting.',
|
||||||
type=int,
|
type=int,
|
||||||
metavar='INT',
|
metavar='INT',
|
||||||
),
|
),
|
||||||
"stake_amount": Arg(
|
"stake_amount": Arg(
|
||||||
'--stake_amount',
|
'--stake-amount',
|
||||||
help='Specify stake_amount.',
|
help='Override the value of the `stake_amount` configuration setting.',
|
||||||
type=float,
|
type=float,
|
||||||
),
|
),
|
||||||
# Backtesting
|
# Backtesting
|
||||||
@@ -136,7 +159,7 @@ AVAILABLE_CLI_OPTIONS = {
|
|||||||
),
|
),
|
||||||
"exportfilename": Arg(
|
"exportfilename": Arg(
|
||||||
'--export-filename',
|
'--export-filename',
|
||||||
help='Save backtest results to the file with this filename (default: `%(default)s`). '
|
help='Save backtest results to the file with this filename. '
|
||||||
'Requires `--export` to be set as well. '
|
'Requires `--export` to be set as well. '
|
||||||
'Example: `--export-filename=user_data/backtest_results/backtest_today.json`',
|
'Example: `--export-filename=user_data/backtest_results/backtest_today.json`',
|
||||||
metavar='PATH',
|
metavar='PATH',
|
||||||
@@ -156,14 +179,13 @@ AVAILABLE_CLI_OPTIONS = {
|
|||||||
),
|
),
|
||||||
# Hyperopt
|
# Hyperopt
|
||||||
"hyperopt": Arg(
|
"hyperopt": Arg(
|
||||||
'--customhyperopt',
|
'--hyperopt',
|
||||||
help='Specify hyperopt class name (default: `%(default)s`).',
|
help='Specify hyperopt class name which will be used by the bot.',
|
||||||
metavar='NAME',
|
metavar='NAME',
|
||||||
default=constants.DEFAULT_HYPEROPT,
|
|
||||||
),
|
),
|
||||||
"hyperopt_path": Arg(
|
"hyperopt_path": Arg(
|
||||||
'--hyperopt-path',
|
'--hyperopt-path',
|
||||||
help='Specify additional lookup path for Hyperopts and Hyperopt Loss functions.',
|
help='Specify additional lookup path for Hyperopt and Hyperopt Loss functions.',
|
||||||
metavar='PATH',
|
metavar='PATH',
|
||||||
),
|
),
|
||||||
"epochs": Arg(
|
"epochs": Arg(
|
||||||
@@ -174,12 +196,11 @@ AVAILABLE_CLI_OPTIONS = {
|
|||||||
default=constants.HYPEROPT_EPOCH,
|
default=constants.HYPEROPT_EPOCH,
|
||||||
),
|
),
|
||||||
"spaces": Arg(
|
"spaces": Arg(
|
||||||
'-s', '--spaces',
|
'--spaces',
|
||||||
help='Specify which parameters to hyperopt. Space-separated list. '
|
help='Specify which parameters to hyperopt. Space-separated list.',
|
||||||
'Default: `%(default)s`.',
|
choices=['all', 'buy', 'sell', 'roi', 'stoploss', 'trailing', 'default'],
|
||||||
choices=['all', 'buy', 'sell', 'roi', 'stoploss'],
|
|
||||||
nargs='+',
|
nargs='+',
|
||||||
default='all',
|
default='default',
|
||||||
),
|
),
|
||||||
"print_all": Arg(
|
"print_all": Arg(
|
||||||
'--print-all',
|
'--print-all',
|
||||||
@@ -196,10 +217,17 @@ AVAILABLE_CLI_OPTIONS = {
|
|||||||
),
|
),
|
||||||
"print_json": Arg(
|
"print_json": Arg(
|
||||||
'--print-json',
|
'--print-json',
|
||||||
help='Print best result detailization in JSON format.',
|
help='Print output in JSON format.',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
default=False,
|
default=False,
|
||||||
),
|
),
|
||||||
|
"export_csv": Arg(
|
||||||
|
'--export-csv',
|
||||||
|
help='Export to CSV-File.'
|
||||||
|
' This will disable table print.'
|
||||||
|
' Example: --export-csv hyperopt.csv',
|
||||||
|
metavar='FILE',
|
||||||
|
),
|
||||||
"hyperopt_jobs": Arg(
|
"hyperopt_jobs": Arg(
|
||||||
'-j', '--job-workers',
|
'-j', '--job-workers',
|
||||||
help='The number of concurrently running jobs for hyperoptimization '
|
help='The number of concurrently running jobs for hyperoptimization '
|
||||||
@@ -236,7 +264,8 @@ AVAILABLE_CLI_OPTIONS = {
|
|||||||
help='Specify the class name of the hyperopt loss function class (IHyperOptLoss). '
|
help='Specify the class name of the hyperopt loss function class (IHyperOptLoss). '
|
||||||
'Different functions can generate completely different results, '
|
'Different functions can generate completely different results, '
|
||||||
'since the target for optimization is different. Built-in Hyperopt-loss-functions are: '
|
'since the target for optimization is different. Built-in Hyperopt-loss-functions are: '
|
||||||
'DefaultHyperOptLoss, OnlyProfitHyperOptLoss, SharpeHyperOptLoss.'
|
'DefaultHyperOptLoss, OnlyProfitHyperOptLoss, SharpeHyperOptLoss, SharpeHyperOptLossDaily, '
|
||||||
|
'SortinoHyperOptLoss, SortinoHyperOptLossDaily.'
|
||||||
'(default: `%(default)s`).',
|
'(default: `%(default)s`).',
|
||||||
metavar='NAME',
|
metavar='NAME',
|
||||||
default=constants.DEFAULT_HYPEROPT_LOSS,
|
default=constants.DEFAULT_HYPEROPT_LOSS,
|
||||||
@@ -312,6 +341,30 @@ AVAILABLE_CLI_OPTIONS = {
|
|||||||
'desired timeframe as specified as --timeframes/-t.',
|
'desired timeframe as specified as --timeframes/-t.',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
),
|
),
|
||||||
|
"format_from": Arg(
|
||||||
|
'--format-from',
|
||||||
|
help='Source format for data conversion.',
|
||||||
|
choices=constants.AVAILABLE_DATAHANDLERS,
|
||||||
|
required=True,
|
||||||
|
),
|
||||||
|
"format_to": Arg(
|
||||||
|
'--format-to',
|
||||||
|
help='Destination format for data conversion.',
|
||||||
|
choices=constants.AVAILABLE_DATAHANDLERS,
|
||||||
|
required=True,
|
||||||
|
),
|
||||||
|
"dataformat_ohlcv": Arg(
|
||||||
|
'--data-format-ohlcv',
|
||||||
|
help='Storage format for downloaded candle (OHLCV) data. (default: `%(default)s`).',
|
||||||
|
choices=constants.AVAILABLE_DATAHANDLERS,
|
||||||
|
default='json'
|
||||||
|
),
|
||||||
|
"dataformat_trades": Arg(
|
||||||
|
'--data-format-trades',
|
||||||
|
help='Storage format for downloaded trades data. (default: `%(default)s`).',
|
||||||
|
choices=constants.AVAILABLE_DATAHANDLERS,
|
||||||
|
default='jsongz'
|
||||||
|
),
|
||||||
"exchange": Arg(
|
"exchange": Arg(
|
||||||
'--exchange',
|
'--exchange',
|
||||||
help=f'Exchange name (default: `{constants.DEFAULT_EXCHANGE}`). '
|
help=f'Exchange name (default: `{constants.DEFAULT_EXCHANGE}`). '
|
||||||
@@ -319,10 +372,10 @@ AVAILABLE_CLI_OPTIONS = {
|
|||||||
),
|
),
|
||||||
"timeframes": Arg(
|
"timeframes": Arg(
|
||||||
'-t', '--timeframes',
|
'-t', '--timeframes',
|
||||||
help=f'Specify which tickers to download. Space-separated list. '
|
help='Specify which tickers to download. Space-separated list. '
|
||||||
f'Default: `1m 5m`.',
|
'Default: `1m 5m`.',
|
||||||
choices=['1m', '3m', '5m', '15m', '30m', '1h', '2h', '4h',
|
choices=['1m', '3m', '5m', '15m', '30m', '1h', '2h', '4h',
|
||||||
'6h', '8h', '12h', '1d', '3d', '1w'],
|
'6h', '8h', '12h', '1d', '3d', '1w', '2w', '1M', '1y'],
|
||||||
default=['1m', '5m'],
|
default=['1m', '5m'],
|
||||||
nargs='+',
|
nargs='+',
|
||||||
),
|
),
|
||||||
@@ -331,19 +384,25 @@ AVAILABLE_CLI_OPTIONS = {
|
|||||||
help='Clean all existing data for the selected exchange/pairs/timeframes.',
|
help='Clean all existing data for the selected exchange/pairs/timeframes.',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
),
|
),
|
||||||
|
# Templating options
|
||||||
|
"template": Arg(
|
||||||
|
'--template',
|
||||||
|
help='Use a template which is either `minimal`, '
|
||||||
|
'`full` (containing multiple sample indicators) or `advanced`. Default: `%(default)s`.',
|
||||||
|
choices=['full', 'minimal', 'advanced'],
|
||||||
|
default='full',
|
||||||
|
),
|
||||||
# Plot dataframe
|
# Plot dataframe
|
||||||
"indicators1": Arg(
|
"indicators1": Arg(
|
||||||
'--indicators1',
|
'--indicators1',
|
||||||
help='Set indicators from your strategy you want in the first row of the graph. '
|
help='Set indicators from your strategy you want in the first row of the graph. '
|
||||||
'Space-separated list. Example: `ema3 ema5`. Default: `%(default)s`.',
|
"Space-separated list. Example: `ema3 ema5`. Default: `['sma', 'ema3', 'ema5']`.",
|
||||||
default=['sma', 'ema3', 'ema5'],
|
|
||||||
nargs='+',
|
nargs='+',
|
||||||
),
|
),
|
||||||
"indicators2": Arg(
|
"indicators2": Arg(
|
||||||
'--indicators2',
|
'--indicators2',
|
||||||
help='Set indicators from your strategy you want in the third row of the graph. '
|
help='Set indicators from your strategy you want in the third row of the graph. '
|
||||||
'Space-separated list. Example: `fastd fastk`. Default: `%(default)s`.',
|
"Space-separated list. Example: `fastd fastk`. Default: `['macd', 'macdsignal']`.",
|
||||||
default=['macd', 'macdsignal'],
|
|
||||||
nargs='+',
|
nargs='+',
|
||||||
),
|
),
|
||||||
"plot_limit": Arg(
|
"plot_limit": Arg(
|
||||||
@@ -354,6 +413,11 @@ AVAILABLE_CLI_OPTIONS = {
|
|||||||
metavar='INT',
|
metavar='INT',
|
||||||
default=750,
|
default=750,
|
||||||
),
|
),
|
||||||
|
"no_trades": Arg(
|
||||||
|
'--no-trades',
|
||||||
|
help='Skip using trades from backtesting file and DB.',
|
||||||
|
action='store_true',
|
||||||
|
),
|
||||||
"trade_source": Arg(
|
"trade_source": Arg(
|
||||||
'--trade-source',
|
'--trade-source',
|
||||||
help='Specify the source for trades (Can be DB or file (backtest file)) '
|
help='Specify the source for trades (Can be DB or file (backtest file)) '
|
||||||
@@ -361,4 +425,96 @@ AVAILABLE_CLI_OPTIONS = {
|
|||||||
choices=["DB", "file"],
|
choices=["DB", "file"],
|
||||||
default="file",
|
default="file",
|
||||||
),
|
),
|
||||||
|
"trade_ids": Arg(
|
||||||
|
'--trade-ids',
|
||||||
|
help='Specify the list of trade ids.',
|
||||||
|
nargs='+',
|
||||||
|
),
|
||||||
|
# hyperopt-list, hyperopt-show
|
||||||
|
"hyperopt_list_profitable": Arg(
|
||||||
|
'--profitable',
|
||||||
|
help='Select only profitable epochs.',
|
||||||
|
action='store_true',
|
||||||
|
),
|
||||||
|
"hyperopt_list_best": Arg(
|
||||||
|
'--best',
|
||||||
|
help='Select only best epochs.',
|
||||||
|
action='store_true',
|
||||||
|
),
|
||||||
|
"hyperopt_list_min_trades": Arg(
|
||||||
|
'--min-trades',
|
||||||
|
help='Select epochs with more than INT trades.',
|
||||||
|
type=check_int_positive,
|
||||||
|
metavar='INT',
|
||||||
|
),
|
||||||
|
"hyperopt_list_max_trades": Arg(
|
||||||
|
'--max-trades',
|
||||||
|
help='Select epochs with less than INT trades.',
|
||||||
|
type=check_int_positive,
|
||||||
|
metavar='INT',
|
||||||
|
),
|
||||||
|
"hyperopt_list_min_avg_time": Arg(
|
||||||
|
'--min-avg-time',
|
||||||
|
help='Select epochs above average time.',
|
||||||
|
type=float,
|
||||||
|
metavar='FLOAT',
|
||||||
|
),
|
||||||
|
"hyperopt_list_max_avg_time": Arg(
|
||||||
|
'--max-avg-time',
|
||||||
|
help='Select epochs below average time.',
|
||||||
|
type=float,
|
||||||
|
metavar='FLOAT',
|
||||||
|
),
|
||||||
|
"hyperopt_list_min_avg_profit": Arg(
|
||||||
|
'--min-avg-profit',
|
||||||
|
help='Select epochs above average profit.',
|
||||||
|
type=float,
|
||||||
|
metavar='FLOAT',
|
||||||
|
),
|
||||||
|
"hyperopt_list_max_avg_profit": Arg(
|
||||||
|
'--max-avg-profit',
|
||||||
|
help='Select epochs below average profit.',
|
||||||
|
type=float,
|
||||||
|
metavar='FLOAT',
|
||||||
|
),
|
||||||
|
"hyperopt_list_min_total_profit": Arg(
|
||||||
|
'--min-total-profit',
|
||||||
|
help='Select epochs above total profit.',
|
||||||
|
type=float,
|
||||||
|
metavar='FLOAT',
|
||||||
|
),
|
||||||
|
"hyperopt_list_max_total_profit": Arg(
|
||||||
|
'--max-total-profit',
|
||||||
|
help='Select epochs below total profit.',
|
||||||
|
type=float,
|
||||||
|
metavar='FLOAT',
|
||||||
|
),
|
||||||
|
"hyperopt_list_min_objective": Arg(
|
||||||
|
'--min-objective',
|
||||||
|
help='Select epochs above objective.',
|
||||||
|
type=float,
|
||||||
|
metavar='FLOAT',
|
||||||
|
),
|
||||||
|
"hyperopt_list_max_objective": Arg(
|
||||||
|
'--max-objective',
|
||||||
|
help='Select epochs below objective.',
|
||||||
|
type=float,
|
||||||
|
metavar='FLOAT',
|
||||||
|
),
|
||||||
|
"hyperopt_list_no_details": Arg(
|
||||||
|
'--no-details',
|
||||||
|
help='Do not print best epoch details.',
|
||||||
|
action='store_true',
|
||||||
|
),
|
||||||
|
"hyperopt_show_index": Arg(
|
||||||
|
'-n', '--index',
|
||||||
|
help='Specify the index of the epoch to print details for.',
|
||||||
|
type=check_int_nonzero,
|
||||||
|
metavar='INT',
|
||||||
|
),
|
||||||
|
"hyperopt_show_no_header": Arg(
|
||||||
|
'--no-header',
|
||||||
|
help='Do not print epoch details header.',
|
||||||
|
action='store_true',
|
||||||
|
),
|
||||||
}
|
}
|
||||||
125
freqtrade/commands/data_commands.py
Normal file
125
freqtrade/commands/data_commands.py
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
import logging
|
||||||
|
import sys
|
||||||
|
from collections import defaultdict
|
||||||
|
from typing import Any, Dict, List
|
||||||
|
|
||||||
|
import arrow
|
||||||
|
|
||||||
|
from freqtrade.configuration import TimeRange, setup_utils_configuration
|
||||||
|
from freqtrade.data.converter import (convert_ohlcv_format,
|
||||||
|
convert_trades_format)
|
||||||
|
from freqtrade.data.history import (convert_trades_to_ohlcv,
|
||||||
|
refresh_backtest_ohlcv_data,
|
||||||
|
refresh_backtest_trades_data)
|
||||||
|
from freqtrade.exceptions import OperationalException
|
||||||
|
from freqtrade.exchange import timeframe_to_minutes
|
||||||
|
from freqtrade.resolvers import ExchangeResolver
|
||||||
|
from freqtrade.state import RunMode
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def start_download_data(args: Dict[str, Any]) -> None:
|
||||||
|
"""
|
||||||
|
Download data (former download_backtest_data.py script)
|
||||||
|
"""
|
||||||
|
config = setup_utils_configuration(args, RunMode.UTIL_EXCHANGE)
|
||||||
|
|
||||||
|
if 'days' in config and 'timerange' in config:
|
||||||
|
raise OperationalException("--days and --timerange are mutually exclusive. "
|
||||||
|
"You can only specify one or the other.")
|
||||||
|
timerange = TimeRange()
|
||||||
|
if 'days' in config:
|
||||||
|
time_since = arrow.utcnow().shift(days=-config['days']).strftime("%Y%m%d")
|
||||||
|
timerange = TimeRange.parse_timerange(f'{time_since}-')
|
||||||
|
|
||||||
|
if 'timerange' in config:
|
||||||
|
timerange = timerange.parse_timerange(config['timerange'])
|
||||||
|
|
||||||
|
if 'pairs' not in config:
|
||||||
|
raise OperationalException(
|
||||||
|
"Downloading data requires a list of pairs. "
|
||||||
|
"Please check the documentation on how to configure this.")
|
||||||
|
|
||||||
|
logger.info(f"About to download pairs: {config['pairs']}, "
|
||||||
|
f"intervals: {config['timeframes']} to {config['datadir']}")
|
||||||
|
|
||||||
|
pairs_not_available: List[str] = []
|
||||||
|
|
||||||
|
# Init exchange
|
||||||
|
exchange = ExchangeResolver.load_exchange(config['exchange']['name'], config, validate=False)
|
||||||
|
# Manual validations of relevant settings
|
||||||
|
exchange.validate_pairs(config['pairs'])
|
||||||
|
for timeframe in config['timeframes']:
|
||||||
|
exchange.validate_timeframes(timeframe)
|
||||||
|
|
||||||
|
try:
|
||||||
|
|
||||||
|
if config.get('download_trades'):
|
||||||
|
pairs_not_available = refresh_backtest_trades_data(
|
||||||
|
exchange, pairs=config['pairs'], datadir=config['datadir'],
|
||||||
|
timerange=timerange, erase=bool(config.get('erase')),
|
||||||
|
data_format=config['dataformat_trades'])
|
||||||
|
|
||||||
|
# Convert downloaded trade data to different timeframes
|
||||||
|
convert_trades_to_ohlcv(
|
||||||
|
pairs=config['pairs'], timeframes=config['timeframes'],
|
||||||
|
datadir=config['datadir'], timerange=timerange, erase=bool(config.get('erase')),
|
||||||
|
data_format_ohlcv=config['dataformat_ohlcv'],
|
||||||
|
data_format_trades=config['dataformat_trades'],
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
pairs_not_available = refresh_backtest_ohlcv_data(
|
||||||
|
exchange, pairs=config['pairs'], timeframes=config['timeframes'],
|
||||||
|
datadir=config['datadir'], timerange=timerange, erase=bool(config.get('erase')),
|
||||||
|
data_format=config['dataformat_ohlcv'])
|
||||||
|
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
sys.exit("SIGINT received, aborting ...")
|
||||||
|
|
||||||
|
finally:
|
||||||
|
if pairs_not_available:
|
||||||
|
logger.info(f"Pairs [{','.join(pairs_not_available)}] not available "
|
||||||
|
f"on exchange {exchange.name}.")
|
||||||
|
|
||||||
|
|
||||||
|
def start_convert_data(args: Dict[str, Any], ohlcv: bool = True) -> None:
|
||||||
|
"""
|
||||||
|
Convert data from one format to another
|
||||||
|
"""
|
||||||
|
config = setup_utils_configuration(args, RunMode.UTIL_NO_EXCHANGE)
|
||||||
|
if ohlcv:
|
||||||
|
convert_ohlcv_format(config,
|
||||||
|
convert_from=args['format_from'], convert_to=args['format_to'],
|
||||||
|
erase=args['erase'])
|
||||||
|
else:
|
||||||
|
convert_trades_format(config,
|
||||||
|
convert_from=args['format_from'], convert_to=args['format_to'],
|
||||||
|
erase=args['erase'])
|
||||||
|
|
||||||
|
|
||||||
|
def start_list_data(args: Dict[str, Any]) -> None:
|
||||||
|
"""
|
||||||
|
List available backtest data
|
||||||
|
"""
|
||||||
|
|
||||||
|
config = setup_utils_configuration(args, RunMode.UTIL_NO_EXCHANGE)
|
||||||
|
|
||||||
|
from freqtrade.data.history.idatahandler import get_datahandler
|
||||||
|
from tabulate import tabulate
|
||||||
|
dhc = get_datahandler(config['datadir'], config['dataformat_ohlcv'])
|
||||||
|
|
||||||
|
paircombs = dhc.ohlcv_get_available_data(config['datadir'])
|
||||||
|
|
||||||
|
if args['pairs']:
|
||||||
|
paircombs = [comb for comb in paircombs if comb[0] in args['pairs']]
|
||||||
|
|
||||||
|
print(f"Found {len(paircombs)} pair / timeframe combinations.")
|
||||||
|
groupedpair = defaultdict(list)
|
||||||
|
for pair, timeframe in sorted(paircombs, key=lambda x: (x[0], timeframe_to_minutes(x[1]))):
|
||||||
|
groupedpair[pair].append(timeframe)
|
||||||
|
|
||||||
|
if groupedpair:
|
||||||
|
print(tabulate([(pair, ', '.join(timeframes)) for pair, timeframes in groupedpair.items()],
|
||||||
|
headers=("Pair", "Timeframe"),
|
||||||
|
tablefmt='psql', stralign='right'))
|
||||||
139
freqtrade/commands/deploy_commands.py
Normal file
139
freqtrade/commands/deploy_commands.py
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
import logging
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
from typing import Any, Dict
|
||||||
|
|
||||||
|
from freqtrade.configuration import setup_utils_configuration
|
||||||
|
from freqtrade.configuration.directory_operations import (copy_sample_files,
|
||||||
|
create_userdata_dir)
|
||||||
|
from freqtrade.constants import USERPATH_HYPEROPTS, USERPATH_STRATEGIES
|
||||||
|
from freqtrade.exceptions import OperationalException
|
||||||
|
from freqtrade.misc import render_template, render_template_with_fallback
|
||||||
|
from freqtrade.state import RunMode
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def start_create_userdir(args: Dict[str, Any]) -> None:
|
||||||
|
"""
|
||||||
|
Create "user_data" directory to contain user data strategies, hyperopt, ...)
|
||||||
|
:param args: Cli args from Arguments()
|
||||||
|
:return: None
|
||||||
|
"""
|
||||||
|
if "user_data_dir" in args and args["user_data_dir"]:
|
||||||
|
userdir = create_userdata_dir(args["user_data_dir"], create_dir=True)
|
||||||
|
copy_sample_files(userdir, overwrite=args["reset"])
|
||||||
|
else:
|
||||||
|
logger.warning("`create-userdir` requires --userdir to be set.")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
def deploy_new_strategy(strategy_name: str, strategy_path: Path, subtemplate: str) -> None:
|
||||||
|
"""
|
||||||
|
Deploy new strategy from template to strategy_path
|
||||||
|
"""
|
||||||
|
fallback = 'full'
|
||||||
|
indicators = render_template_with_fallback(
|
||||||
|
templatefile=f"subtemplates/indicators_{subtemplate}.j2",
|
||||||
|
templatefallbackfile=f"subtemplates/indicators_{fallback}.j2",
|
||||||
|
)
|
||||||
|
buy_trend = render_template_with_fallback(
|
||||||
|
templatefile=f"subtemplates/buy_trend_{subtemplate}.j2",
|
||||||
|
templatefallbackfile=f"subtemplates/buy_trend_{fallback}.j2",
|
||||||
|
)
|
||||||
|
sell_trend = render_template_with_fallback(
|
||||||
|
templatefile=f"subtemplates/sell_trend_{subtemplate}.j2",
|
||||||
|
templatefallbackfile=f"subtemplates/sell_trend_{fallback}.j2",
|
||||||
|
)
|
||||||
|
plot_config = render_template_with_fallback(
|
||||||
|
templatefile=f"subtemplates/plot_config_{subtemplate}.j2",
|
||||||
|
templatefallbackfile=f"subtemplates/plot_config_{fallback}.j2",
|
||||||
|
)
|
||||||
|
additional_methods = render_template_with_fallback(
|
||||||
|
templatefile=f"subtemplates/strategy_methods_{subtemplate}.j2",
|
||||||
|
templatefallbackfile="subtemplates/strategy_methods_empty.j2",
|
||||||
|
)
|
||||||
|
|
||||||
|
strategy_text = render_template(templatefile='base_strategy.py.j2',
|
||||||
|
arguments={"strategy": strategy_name,
|
||||||
|
"indicators": indicators,
|
||||||
|
"buy_trend": buy_trend,
|
||||||
|
"sell_trend": sell_trend,
|
||||||
|
"plot_config": plot_config,
|
||||||
|
"additional_methods": additional_methods,
|
||||||
|
})
|
||||||
|
|
||||||
|
logger.info(f"Writing strategy to `{strategy_path}`.")
|
||||||
|
strategy_path.write_text(strategy_text)
|
||||||
|
|
||||||
|
|
||||||
|
def start_new_strategy(args: Dict[str, Any]) -> None:
|
||||||
|
|
||||||
|
config = setup_utils_configuration(args, RunMode.UTIL_NO_EXCHANGE)
|
||||||
|
|
||||||
|
if "strategy" in args and args["strategy"]:
|
||||||
|
if args["strategy"] == "DefaultStrategy":
|
||||||
|
raise OperationalException("DefaultStrategy is not allowed as name.")
|
||||||
|
|
||||||
|
new_path = config['user_data_dir'] / USERPATH_STRATEGIES / (args['strategy'] + '.py')
|
||||||
|
|
||||||
|
if new_path.exists():
|
||||||
|
raise OperationalException(f"`{new_path}` already exists. "
|
||||||
|
"Please choose another Strategy Name.")
|
||||||
|
|
||||||
|
deploy_new_strategy(args['strategy'], new_path, args['template'])
|
||||||
|
|
||||||
|
else:
|
||||||
|
raise OperationalException("`new-strategy` requires --strategy to be set.")
|
||||||
|
|
||||||
|
|
||||||
|
def deploy_new_hyperopt(hyperopt_name: str, hyperopt_path: Path, subtemplate: str) -> None:
|
||||||
|
"""
|
||||||
|
Deploys a new hyperopt template to hyperopt_path
|
||||||
|
"""
|
||||||
|
fallback = 'full'
|
||||||
|
buy_guards = render_template_with_fallback(
|
||||||
|
templatefile=f"subtemplates/hyperopt_buy_guards_{subtemplate}.j2",
|
||||||
|
templatefallbackfile=f"subtemplates/hyperopt_buy_guards_{fallback}.j2",
|
||||||
|
)
|
||||||
|
sell_guards = render_template_with_fallback(
|
||||||
|
templatefile=f"subtemplates/hyperopt_sell_guards_{subtemplate}.j2",
|
||||||
|
templatefallbackfile=f"subtemplates/hyperopt_sell_guards_{fallback}.j2",
|
||||||
|
)
|
||||||
|
buy_space = render_template_with_fallback(
|
||||||
|
templatefile=f"subtemplates/hyperopt_buy_space_{subtemplate}.j2",
|
||||||
|
templatefallbackfile=f"subtemplates/hyperopt_buy_space_{fallback}.j2",
|
||||||
|
)
|
||||||
|
sell_space = render_template_with_fallback(
|
||||||
|
templatefile=f"subtemplates/hyperopt_sell_space_{subtemplate}.j2",
|
||||||
|
templatefallbackfile=f"subtemplates/hyperopt_sell_space_{fallback}.j2",
|
||||||
|
)
|
||||||
|
|
||||||
|
strategy_text = render_template(templatefile='base_hyperopt.py.j2',
|
||||||
|
arguments={"hyperopt": hyperopt_name,
|
||||||
|
"buy_guards": buy_guards,
|
||||||
|
"sell_guards": sell_guards,
|
||||||
|
"buy_space": buy_space,
|
||||||
|
"sell_space": sell_space,
|
||||||
|
})
|
||||||
|
|
||||||
|
logger.info(f"Writing hyperopt to `{hyperopt_path}`.")
|
||||||
|
hyperopt_path.write_text(strategy_text)
|
||||||
|
|
||||||
|
|
||||||
|
def start_new_hyperopt(args: Dict[str, Any]) -> None:
|
||||||
|
|
||||||
|
config = setup_utils_configuration(args, RunMode.UTIL_NO_EXCHANGE)
|
||||||
|
|
||||||
|
if 'hyperopt' in args and args['hyperopt']:
|
||||||
|
if args['hyperopt'] == 'DefaultHyperopt':
|
||||||
|
raise OperationalException("DefaultHyperopt is not allowed as name.")
|
||||||
|
|
||||||
|
new_path = config['user_data_dir'] / USERPATH_HYPEROPTS / (args['hyperopt'] + '.py')
|
||||||
|
|
||||||
|
if new_path.exists():
|
||||||
|
raise OperationalException(f"`{new_path}` already exists. "
|
||||||
|
"Please choose another Strategy Name.")
|
||||||
|
deploy_new_hyperopt(args['hyperopt'], new_path, args['template'])
|
||||||
|
else:
|
||||||
|
raise OperationalException("`new-hyperopt` requires --hyperopt to be set.")
|
||||||
223
freqtrade/commands/hyperopt_commands.py
Executable file
223
freqtrade/commands/hyperopt_commands.py
Executable file
@@ -0,0 +1,223 @@
|
|||||||
|
import logging
|
||||||
|
from operator import itemgetter
|
||||||
|
from typing import Any, Dict, List
|
||||||
|
|
||||||
|
from colorama import init as colorama_init
|
||||||
|
|
||||||
|
from freqtrade.configuration import setup_utils_configuration
|
||||||
|
from freqtrade.exceptions import OperationalException
|
||||||
|
from freqtrade.state import RunMode
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def start_hyperopt_list(args: Dict[str, Any]) -> None:
|
||||||
|
"""
|
||||||
|
List hyperopt epochs previously evaluated
|
||||||
|
"""
|
||||||
|
from freqtrade.optimize.hyperopt import Hyperopt
|
||||||
|
|
||||||
|
config = setup_utils_configuration(args, RunMode.UTIL_NO_EXCHANGE)
|
||||||
|
|
||||||
|
print_colorized = config.get('print_colorized', False)
|
||||||
|
print_json = config.get('print_json', False)
|
||||||
|
export_csv = config.get('export_csv', None)
|
||||||
|
no_details = config.get('hyperopt_list_no_details', False)
|
||||||
|
no_header = False
|
||||||
|
|
||||||
|
filteroptions = {
|
||||||
|
'only_best': config.get('hyperopt_list_best', False),
|
||||||
|
'only_profitable': config.get('hyperopt_list_profitable', False),
|
||||||
|
'filter_min_trades': config.get('hyperopt_list_min_trades', 0),
|
||||||
|
'filter_max_trades': config.get('hyperopt_list_max_trades', 0),
|
||||||
|
'filter_min_avg_time': config.get('hyperopt_list_min_avg_time', None),
|
||||||
|
'filter_max_avg_time': config.get('hyperopt_list_max_avg_time', None),
|
||||||
|
'filter_min_avg_profit': config.get('hyperopt_list_min_avg_profit', None),
|
||||||
|
'filter_max_avg_profit': config.get('hyperopt_list_max_avg_profit', None),
|
||||||
|
'filter_min_total_profit': config.get('hyperopt_list_min_total_profit', None),
|
||||||
|
'filter_max_total_profit': config.get('hyperopt_list_max_total_profit', None),
|
||||||
|
'filter_min_objective': config.get('hyperopt_list_min_objective', None),
|
||||||
|
'filter_max_objective': config.get('hyperopt_list_max_objective', None),
|
||||||
|
}
|
||||||
|
|
||||||
|
results_file = (config['user_data_dir'] /
|
||||||
|
'hyperopt_results' / 'hyperopt_results.pickle')
|
||||||
|
|
||||||
|
# Previous evaluations
|
||||||
|
epochs = Hyperopt.load_previous_results(results_file)
|
||||||
|
total_epochs = len(epochs)
|
||||||
|
|
||||||
|
epochs = hyperopt_filter_epochs(epochs, filteroptions)
|
||||||
|
|
||||||
|
if print_colorized:
|
||||||
|
colorama_init(autoreset=True)
|
||||||
|
|
||||||
|
if not export_csv:
|
||||||
|
try:
|
||||||
|
print(Hyperopt.get_result_table(config, epochs, total_epochs,
|
||||||
|
not filteroptions['only_best'], print_colorized, 0))
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print('User interrupted..')
|
||||||
|
|
||||||
|
if epochs and not no_details:
|
||||||
|
sorted_epochs = sorted(epochs, key=itemgetter('loss'))
|
||||||
|
results = sorted_epochs[0]
|
||||||
|
Hyperopt.print_epoch_details(results, total_epochs, print_json, no_header)
|
||||||
|
|
||||||
|
if epochs and export_csv:
|
||||||
|
Hyperopt.export_csv_file(
|
||||||
|
config, epochs, total_epochs, not filteroptions['only_best'], export_csv
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def start_hyperopt_show(args: Dict[str, Any]) -> None:
|
||||||
|
"""
|
||||||
|
Show details of a hyperopt epoch previously evaluated
|
||||||
|
"""
|
||||||
|
from freqtrade.optimize.hyperopt import Hyperopt
|
||||||
|
|
||||||
|
config = setup_utils_configuration(args, RunMode.UTIL_NO_EXCHANGE)
|
||||||
|
|
||||||
|
print_json = config.get('print_json', False)
|
||||||
|
no_header = config.get('hyperopt_show_no_header', False)
|
||||||
|
results_file = (config['user_data_dir'] /
|
||||||
|
'hyperopt_results' / 'hyperopt_results.pickle')
|
||||||
|
n = config.get('hyperopt_show_index', -1)
|
||||||
|
|
||||||
|
filteroptions = {
|
||||||
|
'only_best': config.get('hyperopt_list_best', False),
|
||||||
|
'only_profitable': config.get('hyperopt_list_profitable', False),
|
||||||
|
'filter_min_trades': config.get('hyperopt_list_min_trades', 0),
|
||||||
|
'filter_max_trades': config.get('hyperopt_list_max_trades', 0),
|
||||||
|
'filter_min_avg_time': config.get('hyperopt_list_min_avg_time', None),
|
||||||
|
'filter_max_avg_time': config.get('hyperopt_list_max_avg_time', None),
|
||||||
|
'filter_min_avg_profit': config.get('hyperopt_list_min_avg_profit', None),
|
||||||
|
'filter_max_avg_profit': config.get('hyperopt_list_max_avg_profit', None),
|
||||||
|
'filter_min_total_profit': config.get('hyperopt_list_min_total_profit', None),
|
||||||
|
'filter_max_total_profit': config.get('hyperopt_list_max_total_profit', None),
|
||||||
|
'filter_min_objective': config.get('hyperopt_list_min_objective', None),
|
||||||
|
'filter_max_objective': config.get('hyperopt_list_max_objective', None)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Previous evaluations
|
||||||
|
epochs = Hyperopt.load_previous_results(results_file)
|
||||||
|
total_epochs = len(epochs)
|
||||||
|
|
||||||
|
epochs = hyperopt_filter_epochs(epochs, filteroptions)
|
||||||
|
filtered_epochs = len(epochs)
|
||||||
|
|
||||||
|
if n > filtered_epochs:
|
||||||
|
raise OperationalException(
|
||||||
|
f"The index of the epoch to show should be less than {filtered_epochs + 1}.")
|
||||||
|
if n < -filtered_epochs:
|
||||||
|
raise OperationalException(
|
||||||
|
f"The index of the epoch to show should be greater than {-filtered_epochs - 1}.")
|
||||||
|
|
||||||
|
# Translate epoch index from human-readable format to pythonic
|
||||||
|
if n > 0:
|
||||||
|
n -= 1
|
||||||
|
|
||||||
|
if epochs:
|
||||||
|
val = epochs[n]
|
||||||
|
Hyperopt.print_epoch_details(val, total_epochs, print_json, no_header,
|
||||||
|
header_str="Epoch details")
|
||||||
|
|
||||||
|
|
||||||
|
def hyperopt_filter_epochs(epochs: List, filteroptions: dict) -> List:
|
||||||
|
"""
|
||||||
|
Filter our items from the list of hyperopt results
|
||||||
|
"""
|
||||||
|
if filteroptions['only_best']:
|
||||||
|
epochs = [x for x in epochs if x['is_best']]
|
||||||
|
if filteroptions['only_profitable']:
|
||||||
|
epochs = [x for x in epochs if x['results_metrics']['profit'] > 0]
|
||||||
|
|
||||||
|
epochs = _hyperopt_filter_epochs_trade_count(epochs, filteroptions)
|
||||||
|
|
||||||
|
epochs = _hyperopt_filter_epochs_duration(epochs, filteroptions)
|
||||||
|
|
||||||
|
epochs = _hyperopt_filter_epochs_profit(epochs, filteroptions)
|
||||||
|
|
||||||
|
epochs = _hyperopt_filter_epochs_objective(epochs, filteroptions)
|
||||||
|
|
||||||
|
logger.info(f"{len(epochs)} " +
|
||||||
|
("best " if filteroptions['only_best'] else "") +
|
||||||
|
("profitable " if filteroptions['only_profitable'] else "") +
|
||||||
|
"epochs found.")
|
||||||
|
return epochs
|
||||||
|
|
||||||
|
|
||||||
|
def _hyperopt_filter_epochs_trade_count(epochs: List, filteroptions: dict) -> List:
|
||||||
|
|
||||||
|
if filteroptions['filter_min_trades'] > 0:
|
||||||
|
epochs = [
|
||||||
|
x for x in epochs
|
||||||
|
if x['results_metrics']['trade_count'] > filteroptions['filter_min_trades']
|
||||||
|
]
|
||||||
|
if filteroptions['filter_max_trades'] > 0:
|
||||||
|
epochs = [
|
||||||
|
x for x in epochs
|
||||||
|
if x['results_metrics']['trade_count'] < filteroptions['filter_max_trades']
|
||||||
|
]
|
||||||
|
return epochs
|
||||||
|
|
||||||
|
|
||||||
|
def _hyperopt_filter_epochs_duration(epochs: List, filteroptions: dict) -> List:
|
||||||
|
|
||||||
|
if filteroptions['filter_min_avg_time'] is not None:
|
||||||
|
epochs = [x for x in epochs if x['results_metrics']['trade_count'] > 0]
|
||||||
|
epochs = [
|
||||||
|
x for x in epochs
|
||||||
|
if x['results_metrics']['duration'] > filteroptions['filter_min_avg_time']
|
||||||
|
]
|
||||||
|
if filteroptions['filter_max_avg_time'] is not None:
|
||||||
|
epochs = [x for x in epochs if x['results_metrics']['trade_count'] > 0]
|
||||||
|
epochs = [
|
||||||
|
x for x in epochs
|
||||||
|
if x['results_metrics']['duration'] < filteroptions['filter_max_avg_time']
|
||||||
|
]
|
||||||
|
|
||||||
|
return epochs
|
||||||
|
|
||||||
|
|
||||||
|
def _hyperopt_filter_epochs_profit(epochs: List, filteroptions: dict) -> List:
|
||||||
|
|
||||||
|
if filteroptions['filter_min_avg_profit'] is not None:
|
||||||
|
epochs = [x for x in epochs if x['results_metrics']['trade_count'] > 0]
|
||||||
|
epochs = [
|
||||||
|
x for x in epochs
|
||||||
|
if x['results_metrics']['avg_profit'] > filteroptions['filter_min_avg_profit']
|
||||||
|
]
|
||||||
|
if filteroptions['filter_max_avg_profit'] is not None:
|
||||||
|
epochs = [x for x in epochs if x['results_metrics']['trade_count'] > 0]
|
||||||
|
epochs = [
|
||||||
|
x for x in epochs
|
||||||
|
if x['results_metrics']['avg_profit'] < filteroptions['filter_max_avg_profit']
|
||||||
|
]
|
||||||
|
if filteroptions['filter_min_total_profit'] is not None:
|
||||||
|
epochs = [x for x in epochs if x['results_metrics']['trade_count'] > 0]
|
||||||
|
epochs = [
|
||||||
|
x for x in epochs
|
||||||
|
if x['results_metrics']['profit'] > filteroptions['filter_min_total_profit']
|
||||||
|
]
|
||||||
|
if filteroptions['filter_max_total_profit'] is not None:
|
||||||
|
epochs = [x for x in epochs if x['results_metrics']['trade_count'] > 0]
|
||||||
|
epochs = [
|
||||||
|
x for x in epochs
|
||||||
|
if x['results_metrics']['profit'] < filteroptions['filter_max_total_profit']
|
||||||
|
]
|
||||||
|
return epochs
|
||||||
|
|
||||||
|
|
||||||
|
def _hyperopt_filter_epochs_objective(epochs: List, filteroptions: dict) -> List:
|
||||||
|
|
||||||
|
if filteroptions['filter_min_objective'] is not None:
|
||||||
|
epochs = [x for x in epochs if x['results_metrics']['trade_count'] > 0]
|
||||||
|
|
||||||
|
epochs = [x for x in epochs if x['loss'] < filteroptions['filter_min_objective']]
|
||||||
|
if filteroptions['filter_max_objective'] is not None:
|
||||||
|
epochs = [x for x in epochs if x['results_metrics']['trade_count'] > 0]
|
||||||
|
|
||||||
|
epochs = [x for x in epochs if x['loss'] > filteroptions['filter_max_objective']]
|
||||||
|
|
||||||
|
return epochs
|
||||||
@@ -1,46 +1,27 @@
|
|||||||
|
import csv
|
||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, Dict, List
|
from typing import Any, Dict, List
|
||||||
|
|
||||||
import arrow
|
from colorama import init as colorama_init
|
||||||
import csv
|
from colorama import Fore, Style
|
||||||
import rapidjson
|
import rapidjson
|
||||||
from tabulate import tabulate
|
from tabulate import tabulate
|
||||||
|
|
||||||
from freqtrade import OperationalException
|
from freqtrade.configuration import setup_utils_configuration
|
||||||
from freqtrade.configuration import Configuration, TimeRange
|
from freqtrade.constants import USERPATH_HYPEROPTS, USERPATH_STRATEGIES
|
||||||
from freqtrade.configuration.directory_operations import create_userdata_dir
|
from freqtrade.exceptions import OperationalException
|
||||||
from freqtrade.data.history import (convert_trades_to_ohlcv,
|
from freqtrade.exchange import (available_exchanges, ccxt_exchanges,
|
||||||
refresh_backtest_ohlcv_data,
|
market_is_active)
|
||||||
refresh_backtest_trades_data)
|
|
||||||
from freqtrade.exchange import (available_exchanges, ccxt_exchanges, market_is_active,
|
|
||||||
symbol_is_pair)
|
|
||||||
from freqtrade.misc import plural
|
from freqtrade.misc import plural
|
||||||
from freqtrade.resolvers import ExchangeResolver
|
from freqtrade.resolvers import ExchangeResolver, StrategyResolver
|
||||||
from freqtrade.state import RunMode
|
from freqtrade.state import RunMode
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def setup_utils_configuration(args: Dict[str, Any], method: RunMode) -> Dict[str, Any]:
|
|
||||||
"""
|
|
||||||
Prepare the configuration for utils subcommands
|
|
||||||
:param args: Cli args from Arguments()
|
|
||||||
:return: Configuration
|
|
||||||
"""
|
|
||||||
configuration = Configuration(args, method)
|
|
||||||
config = configuration.get_config()
|
|
||||||
|
|
||||||
config['exchange']['dry_run'] = True
|
|
||||||
# Ensure we do not use Exchange credentials
|
|
||||||
config['exchange']['key'] = ''
|
|
||||||
config['exchange']['secret'] = ''
|
|
||||||
|
|
||||||
return config
|
|
||||||
|
|
||||||
|
|
||||||
def start_list_exchanges(args: Dict[str, Any]) -> None:
|
def start_list_exchanges(args: Dict[str, Any]) -> None:
|
||||||
"""
|
"""
|
||||||
Print available exchanges
|
Print available exchanges
|
||||||
@@ -57,78 +38,75 @@ def start_list_exchanges(args: Dict[str, Any]) -> None:
|
|||||||
print(f"Exchanges available for Freqtrade: {', '.join(exchanges)}")
|
print(f"Exchanges available for Freqtrade: {', '.join(exchanges)}")
|
||||||
|
|
||||||
|
|
||||||
def start_create_userdir(args: Dict[str, Any]) -> None:
|
def _print_objs_tabular(objs: List, print_colorized: bool) -> None:
|
||||||
"""
|
if print_colorized:
|
||||||
Create "user_data" directory to contain user data strategies, hyperopts, ...)
|
colorama_init(autoreset=True)
|
||||||
:param args: Cli args from Arguments()
|
red = Fore.RED
|
||||||
:return: None
|
yellow = Fore.YELLOW
|
||||||
"""
|
reset = Style.RESET_ALL
|
||||||
if "user_data_dir" in args and args["user_data_dir"]:
|
|
||||||
create_userdata_dir(args["user_data_dir"], create_dir=True)
|
|
||||||
else:
|
else:
|
||||||
logger.warning("`create-userdir` requires --userdir to be set.")
|
red = ''
|
||||||
sys.exit(1)
|
yellow = ''
|
||||||
|
reset = ''
|
||||||
|
|
||||||
|
names = [s['name'] for s in objs]
|
||||||
|
objss_to_print = [{
|
||||||
|
'name': s['name'] if s['name'] else "--",
|
||||||
|
'location': s['location'].name,
|
||||||
|
'status': (red + "LOAD FAILED" + reset if s['class'] is None
|
||||||
|
else "OK" if names.count(s['name']) == 1
|
||||||
|
else yellow + "DUPLICATE NAME" + reset)
|
||||||
|
} for s in objs]
|
||||||
|
|
||||||
|
print(tabulate(objss_to_print, headers='keys', tablefmt='psql', stralign='right'))
|
||||||
|
|
||||||
|
|
||||||
def start_download_data(args: Dict[str, Any]) -> None:
|
def start_list_strategies(args: Dict[str, Any]) -> None:
|
||||||
"""
|
"""
|
||||||
Download data (former download_backtest_data.py script)
|
Print files with Strategy custom classes available in the directory
|
||||||
"""
|
"""
|
||||||
config = setup_utils_configuration(args, RunMode.OTHER)
|
config = setup_utils_configuration(args, RunMode.UTIL_NO_EXCHANGE)
|
||||||
|
|
||||||
timerange = TimeRange()
|
directory = Path(config.get('strategy_path', config['user_data_dir'] / USERPATH_STRATEGIES))
|
||||||
if 'days' in config:
|
strategy_objs = StrategyResolver.search_all_objects(directory, not args['print_one_column'])
|
||||||
time_since = arrow.utcnow().shift(days=-config['days']).strftime("%Y%m%d")
|
# Sort alphabetically
|
||||||
timerange = TimeRange.parse_timerange(f'{time_since}-')
|
strategy_objs = sorted(strategy_objs, key=lambda x: x['name'])
|
||||||
|
|
||||||
if 'pairs' not in config:
|
if args['print_one_column']:
|
||||||
raise OperationalException(
|
print('\n'.join([s['name'] for s in strategy_objs]))
|
||||||
"Downloading data requires a list of pairs. "
|
else:
|
||||||
"Please check the documentation on how to configure this.")
|
_print_objs_tabular(strategy_objs, config.get('print_colorized', False))
|
||||||
|
|
||||||
dl_path = Path(config['datadir'])
|
|
||||||
logger.info(f'About to download pairs: {config["pairs"]}, '
|
|
||||||
f'intervals: {config["timeframes"]} to {dl_path}')
|
|
||||||
|
|
||||||
pairs_not_available: List[str] = []
|
def start_list_hyperopts(args: Dict[str, Any]) -> None:
|
||||||
|
"""
|
||||||
|
Print files with HyperOpt custom classes available in the directory
|
||||||
|
"""
|
||||||
|
from freqtrade.resolvers.hyperopt_resolver import HyperOptResolver
|
||||||
|
|
||||||
# Init exchange
|
config = setup_utils_configuration(args, RunMode.UTIL_NO_EXCHANGE)
|
||||||
exchange = ExchangeResolver(config['exchange']['name'], config).exchange
|
|
||||||
try:
|
|
||||||
|
|
||||||
if config.get('download_trades'):
|
directory = Path(config.get('hyperopt_path', config['user_data_dir'] / USERPATH_HYPEROPTS))
|
||||||
pairs_not_available = refresh_backtest_trades_data(
|
hyperopt_objs = HyperOptResolver.search_all_objects(directory, not args['print_one_column'])
|
||||||
exchange, pairs=config["pairs"], datadir=Path(config['datadir']),
|
# Sort alphabetically
|
||||||
timerange=timerange, erase=config.get("erase"))
|
hyperopt_objs = sorted(hyperopt_objs, key=lambda x: x['name'])
|
||||||
|
|
||||||
# Convert downloaded trade data to different timeframes
|
if args['print_one_column']:
|
||||||
convert_trades_to_ohlcv(
|
print('\n'.join([s['name'] for s in hyperopt_objs]))
|
||||||
pairs=config["pairs"], timeframes=config["timeframes"],
|
else:
|
||||||
datadir=Path(config['datadir']), timerange=timerange, erase=config.get("erase"))
|
_print_objs_tabular(hyperopt_objs, config.get('print_colorized', False))
|
||||||
else:
|
|
||||||
pairs_not_available = refresh_backtest_ohlcv_data(
|
|
||||||
exchange, pairs=config["pairs"], timeframes=config["timeframes"],
|
|
||||||
dl_path=Path(config['datadir']), timerange=timerange, erase=config.get("erase"))
|
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
sys.exit("SIGINT received, aborting ...")
|
|
||||||
|
|
||||||
finally:
|
|
||||||
if pairs_not_available:
|
|
||||||
logger.info(f"Pairs [{','.join(pairs_not_available)}] not available "
|
|
||||||
f"on exchange {exchange.name}.")
|
|
||||||
|
|
||||||
|
|
||||||
def start_list_timeframes(args: Dict[str, Any]) -> None:
|
def start_list_timeframes(args: Dict[str, Any]) -> None:
|
||||||
"""
|
"""
|
||||||
Print ticker intervals (timeframes) available on Exchange
|
Print ticker intervals (timeframes) available on Exchange
|
||||||
"""
|
"""
|
||||||
config = setup_utils_configuration(args, RunMode.OTHER)
|
config = setup_utils_configuration(args, RunMode.UTIL_EXCHANGE)
|
||||||
# Do not use ticker_interval set in the config
|
# Do not use timeframe set in the config
|
||||||
config['ticker_interval'] = None
|
config['timeframe'] = None
|
||||||
|
|
||||||
# Init exchange
|
# Init exchange
|
||||||
exchange = ExchangeResolver(config['exchange']['name'], config, validate=False).exchange
|
exchange = ExchangeResolver.load_exchange(config['exchange']['name'], config, validate=False)
|
||||||
|
|
||||||
if args['print_one_column']:
|
if args['print_one_column']:
|
||||||
print('\n'.join(exchange.timeframes))
|
print('\n'.join(exchange.timeframes))
|
||||||
@@ -144,10 +122,10 @@ def start_list_markets(args: Dict[str, Any], pairs_only: bool = False) -> None:
|
|||||||
:param pairs_only: if True print only pairs, otherwise print all instruments (markets)
|
:param pairs_only: if True print only pairs, otherwise print all instruments (markets)
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
config = setup_utils_configuration(args, RunMode.OTHER)
|
config = setup_utils_configuration(args, RunMode.UTIL_EXCHANGE)
|
||||||
|
|
||||||
# Init exchange
|
# Init exchange
|
||||||
exchange = ExchangeResolver(config['exchange']['name'], config, validate=False).exchange
|
exchange = ExchangeResolver.load_exchange(config['exchange']['name'], config, validate=False)
|
||||||
|
|
||||||
# By default only active pairs/markets are to be shown
|
# By default only active pairs/markets are to be shown
|
||||||
active_only = not args.get('list_pairs_all', False)
|
active_only = not args.get('list_pairs_all', False)
|
||||||
@@ -185,7 +163,7 @@ def start_list_markets(args: Dict[str, Any], pairs_only: bool = False) -> None:
|
|||||||
tabular_data.append({'Id': v['id'], 'Symbol': v['symbol'],
|
tabular_data.append({'Id': v['id'], 'Symbol': v['symbol'],
|
||||||
'Base': v['base'], 'Quote': v['quote'],
|
'Base': v['base'], 'Quote': v['quote'],
|
||||||
'Active': market_is_active(v),
|
'Active': market_is_active(v),
|
||||||
**({'Is pair': symbol_is_pair(v['symbol'])}
|
**({'Is pair': exchange.market_is_tradable(v)}
|
||||||
if not pairs_only else {})})
|
if not pairs_only else {})})
|
||||||
|
|
||||||
if (args.get('print_one_column', False) or
|
if (args.get('print_one_column', False) or
|
||||||
@@ -214,8 +192,35 @@ def start_list_markets(args: Dict[str, Any], pairs_only: bool = False) -> None:
|
|||||||
else:
|
else:
|
||||||
# print data as a table, with the human-readable summary
|
# print data as a table, with the human-readable summary
|
||||||
print(f"{summary_str}:")
|
print(f"{summary_str}:")
|
||||||
print(tabulate(tabular_data, headers='keys', tablefmt='pipe'))
|
print(tabulate(tabular_data, headers='keys', tablefmt='psql', stralign='right'))
|
||||||
elif not (args.get('print_one_column', False) or
|
elif not (args.get('print_one_column', False) or
|
||||||
args.get('list_pairs_print_json', False) or
|
args.get('list_pairs_print_json', False) or
|
||||||
args.get('print_csv', False)):
|
args.get('print_csv', False)):
|
||||||
print(f"{summary_str}.")
|
print(f"{summary_str}.")
|
||||||
|
|
||||||
|
|
||||||
|
def start_show_trades(args: Dict[str, Any]) -> None:
|
||||||
|
"""
|
||||||
|
Show trades
|
||||||
|
"""
|
||||||
|
from freqtrade.persistence import init, Trade
|
||||||
|
import json
|
||||||
|
config = setup_utils_configuration(args, RunMode.UTIL_NO_EXCHANGE)
|
||||||
|
|
||||||
|
if 'db_url' not in config:
|
||||||
|
raise OperationalException("--db-url is required for this command.")
|
||||||
|
|
||||||
|
logger.info(f'Using DB: "{config["db_url"]}"')
|
||||||
|
init(config['db_url'], clean_open_orders=False)
|
||||||
|
tfilter = []
|
||||||
|
|
||||||
|
if config.get('trade_ids'):
|
||||||
|
tfilter.append(Trade.id.in_(config['trade_ids']))
|
||||||
|
|
||||||
|
trades = Trade.get_trades(tfilter).all()
|
||||||
|
logger.info(f"Printing {len(trades)} Trades: ")
|
||||||
|
if config.get('print_json', False):
|
||||||
|
print(json.dumps([trade.to_json() for trade in trades], indent=4))
|
||||||
|
else:
|
||||||
|
for trade in trades:
|
||||||
|
print(trade)
|
||||||
107
freqtrade/commands/optimize_commands.py
Normal file
107
freqtrade/commands/optimize_commands.py
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
import logging
|
||||||
|
from typing import Any, Dict
|
||||||
|
|
||||||
|
from freqtrade import constants
|
||||||
|
from freqtrade.configuration import setup_utils_configuration
|
||||||
|
from freqtrade.exceptions import DependencyException, OperationalException
|
||||||
|
from freqtrade.state import RunMode
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def setup_optimize_configuration(args: Dict[str, Any], method: RunMode) -> Dict[str, Any]:
|
||||||
|
"""
|
||||||
|
Prepare the configuration for the Hyperopt module
|
||||||
|
:param args: Cli args from Arguments()
|
||||||
|
:return: Configuration
|
||||||
|
"""
|
||||||
|
config = setup_utils_configuration(args, method)
|
||||||
|
|
||||||
|
no_unlimited_runmodes = {
|
||||||
|
RunMode.BACKTEST: 'backtesting',
|
||||||
|
RunMode.HYPEROPT: 'hyperoptimization',
|
||||||
|
}
|
||||||
|
if (method in no_unlimited_runmodes.keys() and
|
||||||
|
config['stake_amount'] == constants.UNLIMITED_STAKE_AMOUNT):
|
||||||
|
raise DependencyException(
|
||||||
|
f'The value of `stake_amount` cannot be set as "{constants.UNLIMITED_STAKE_AMOUNT}" '
|
||||||
|
f'for {no_unlimited_runmodes[method]}')
|
||||||
|
|
||||||
|
return config
|
||||||
|
|
||||||
|
|
||||||
|
def start_backtesting(args: Dict[str, Any]) -> None:
|
||||||
|
"""
|
||||||
|
Start Backtesting script
|
||||||
|
:param args: Cli args from Arguments()
|
||||||
|
:return: None
|
||||||
|
"""
|
||||||
|
# Import here to avoid loading backtesting module when it's not used
|
||||||
|
from freqtrade.optimize.backtesting import Backtesting
|
||||||
|
|
||||||
|
# Initialize configuration
|
||||||
|
config = setup_optimize_configuration(args, RunMode.BACKTEST)
|
||||||
|
|
||||||
|
logger.info('Starting freqtrade in Backtesting mode')
|
||||||
|
|
||||||
|
# Initialize backtesting object
|
||||||
|
backtesting = Backtesting(config)
|
||||||
|
backtesting.start()
|
||||||
|
|
||||||
|
|
||||||
|
def start_hyperopt(args: Dict[str, Any]) -> None:
|
||||||
|
"""
|
||||||
|
Start hyperopt script
|
||||||
|
:param args: Cli args from Arguments()
|
||||||
|
:return: None
|
||||||
|
"""
|
||||||
|
# Import here to avoid loading hyperopt module when it's not used
|
||||||
|
try:
|
||||||
|
from filelock import FileLock, Timeout
|
||||||
|
from freqtrade.optimize.hyperopt import Hyperopt
|
||||||
|
except ImportError as e:
|
||||||
|
raise OperationalException(
|
||||||
|
f"{e}. Please ensure that the hyperopt dependencies are installed.") from e
|
||||||
|
# Initialize configuration
|
||||||
|
config = setup_optimize_configuration(args, RunMode.HYPEROPT)
|
||||||
|
|
||||||
|
logger.info('Starting freqtrade in Hyperopt mode')
|
||||||
|
|
||||||
|
lock = FileLock(Hyperopt.get_lock_filename(config))
|
||||||
|
|
||||||
|
try:
|
||||||
|
with lock.acquire(timeout=1):
|
||||||
|
|
||||||
|
# Remove noisy log messages
|
||||||
|
logging.getLogger('hyperopt.tpe').setLevel(logging.WARNING)
|
||||||
|
logging.getLogger('filelock').setLevel(logging.WARNING)
|
||||||
|
|
||||||
|
# Initialize backtesting object
|
||||||
|
hyperopt = Hyperopt(config)
|
||||||
|
hyperopt.start()
|
||||||
|
|
||||||
|
except Timeout:
|
||||||
|
logger.info("Another running instance of freqtrade Hyperopt detected.")
|
||||||
|
logger.info("Simultaneous execution of multiple Hyperopt commands is not supported. "
|
||||||
|
"Hyperopt module is resource hungry. Please run your Hyperopt sequentially "
|
||||||
|
"or on separate machines.")
|
||||||
|
logger.info("Quitting now.")
|
||||||
|
# TODO: return False here in order to help freqtrade to exit
|
||||||
|
# with non-zero exit code...
|
||||||
|
# Same in Edge and Backtesting start() functions.
|
||||||
|
|
||||||
|
|
||||||
|
def start_edge(args: Dict[str, Any]) -> None:
|
||||||
|
"""
|
||||||
|
Start Edge script
|
||||||
|
:param args: Cli args from Arguments()
|
||||||
|
:return: None
|
||||||
|
"""
|
||||||
|
from freqtrade.optimize.edge_cli import EdgeCli
|
||||||
|
# Initialize configuration
|
||||||
|
config = setup_optimize_configuration(args, RunMode.EDGE)
|
||||||
|
logger.info('Starting freqtrade in Edge mode')
|
||||||
|
|
||||||
|
# Initialize Edge object
|
||||||
|
edge_cli = EdgeCli(config)
|
||||||
|
edge_cli.start()
|
||||||
41
freqtrade/commands/pairlist_commands.py
Normal file
41
freqtrade/commands/pairlist_commands.py
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
import logging
|
||||||
|
from typing import Any, Dict
|
||||||
|
|
||||||
|
import rapidjson
|
||||||
|
|
||||||
|
from freqtrade.configuration import setup_utils_configuration
|
||||||
|
from freqtrade.resolvers import ExchangeResolver
|
||||||
|
from freqtrade.state import RunMode
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def start_test_pairlist(args: Dict[str, Any]) -> None:
|
||||||
|
"""
|
||||||
|
Test Pairlist configuration
|
||||||
|
"""
|
||||||
|
from freqtrade.pairlist.pairlistmanager import PairListManager
|
||||||
|
config = setup_utils_configuration(args, RunMode.UTIL_EXCHANGE)
|
||||||
|
|
||||||
|
exchange = ExchangeResolver.load_exchange(config['exchange']['name'], config, validate=False)
|
||||||
|
|
||||||
|
quote_currencies = args.get('quote_currencies')
|
||||||
|
if not quote_currencies:
|
||||||
|
quote_currencies = [config.get('stake_currency')]
|
||||||
|
results = {}
|
||||||
|
for curr in quote_currencies:
|
||||||
|
config['stake_currency'] = curr
|
||||||
|
pairlists = PairListManager(exchange, config)
|
||||||
|
pairlists.refresh_pairlist()
|
||||||
|
results[curr] = pairlists.whitelist
|
||||||
|
|
||||||
|
for curr, pairlist in results.items():
|
||||||
|
if not args.get('print_one_column', False):
|
||||||
|
print(f"Pairs for {curr}: ")
|
||||||
|
|
||||||
|
if args.get('print_one_column', False):
|
||||||
|
print('\n'.join(pairlist))
|
||||||
|
elif args.get('list_pairs_print_json', False):
|
||||||
|
print(rapidjson.dumps(list(pairlist), default=str))
|
||||||
|
else:
|
||||||
|
print(pairlist)
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
from typing import Any, Dict
|
from typing import Any, Dict
|
||||||
|
|
||||||
from freqtrade import OperationalException
|
from freqtrade.configuration import setup_utils_configuration
|
||||||
|
from freqtrade.exceptions import OperationalException
|
||||||
from freqtrade.state import RunMode
|
from freqtrade.state import RunMode
|
||||||
from freqtrade.utils import setup_utils_configuration
|
|
||||||
|
|
||||||
|
|
||||||
def validate_plot_args(args: Dict[str, Any]):
|
def validate_plot_args(args: Dict[str, Any]) -> None:
|
||||||
if not args.get('datadir') and not args.get('config'):
|
if not args.get('datadir') and not args.get('config'):
|
||||||
raise OperationalException(
|
raise OperationalException(
|
||||||
"You need to specify either `--datadir` or `--config` "
|
"You need to specify either `--datadir` or `--config` "
|
||||||
30
freqtrade/commands/trade_commands.py
Normal file
30
freqtrade/commands/trade_commands.py
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import logging
|
||||||
|
|
||||||
|
from typing import Any, Dict
|
||||||
|
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def start_trading(args: Dict[str, Any]) -> int:
|
||||||
|
"""
|
||||||
|
Main entry point for trading mode
|
||||||
|
"""
|
||||||
|
# Import here to avoid loading worker module when it's not used
|
||||||
|
from freqtrade.worker import Worker
|
||||||
|
|
||||||
|
# Create and run worker
|
||||||
|
worker = None
|
||||||
|
try:
|
||||||
|
worker = Worker(args)
|
||||||
|
worker.run()
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(str(e))
|
||||||
|
logger.exception("Fatal exception!")
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
logger.info('SIGINT received, aborting ...')
|
||||||
|
finally:
|
||||||
|
if worker:
|
||||||
|
logger.info("worker found ... calling exit")
|
||||||
|
worker.exit()
|
||||||
|
return 0
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
from freqtrade.configuration.arguments import Arguments # noqa: F401
|
# flake8: noqa: F401
|
||||||
from freqtrade.configuration.timerange import TimeRange # noqa: F401
|
|
||||||
from freqtrade.configuration.configuration import Configuration # noqa: F401
|
from freqtrade.configuration.config_setup import setup_utils_configuration
|
||||||
from freqtrade.configuration.config_validation import validate_config_consistency # noqa: F401
|
from freqtrade.configuration.check_exchange import check_exchange, remove_credentials
|
||||||
|
from freqtrade.configuration.timerange import TimeRange
|
||||||
|
from freqtrade.configuration.configuration import Configuration
|
||||||
|
from freqtrade.configuration.config_validation import validate_config_consistency
|
||||||
|
|||||||
@@ -1,196 +0,0 @@
|
|||||||
"""
|
|
||||||
This module contains the argument manager class
|
|
||||||
"""
|
|
||||||
import argparse
|
|
||||||
from functools import partial
|
|
||||||
from pathlib import Path
|
|
||||||
from typing import Any, Dict, List, Optional
|
|
||||||
|
|
||||||
from freqtrade import constants
|
|
||||||
from freqtrade.configuration.cli_options import AVAILABLE_CLI_OPTIONS
|
|
||||||
|
|
||||||
ARGS_COMMON = ["verbosity", "logfile", "version", "config", "datadir", "user_data_dir"]
|
|
||||||
|
|
||||||
ARGS_STRATEGY = ["strategy", "strategy_path"]
|
|
||||||
|
|
||||||
ARGS_MAIN = ARGS_COMMON + ARGS_STRATEGY + ["db_url", "sd_notify"]
|
|
||||||
|
|
||||||
ARGS_COMMON_OPTIMIZE = ["ticker_interval", "timerange",
|
|
||||||
"max_open_trades", "stake_amount", "fee"]
|
|
||||||
|
|
||||||
ARGS_BACKTEST = ARGS_COMMON_OPTIMIZE + ["position_stacking", "use_max_market_positions",
|
|
||||||
"strategy_list", "export", "exportfilename"]
|
|
||||||
|
|
||||||
ARGS_HYPEROPT = ARGS_COMMON_OPTIMIZE + ["hyperopt", "hyperopt_path",
|
|
||||||
"position_stacking", "epochs", "spaces",
|
|
||||||
"use_max_market_positions", "print_all",
|
|
||||||
"print_colorized", "print_json", "hyperopt_jobs",
|
|
||||||
"hyperopt_random_state", "hyperopt_min_trades",
|
|
||||||
"hyperopt_continue", "hyperopt_loss"]
|
|
||||||
|
|
||||||
ARGS_EDGE = ARGS_COMMON_OPTIMIZE + ["stoploss_range"]
|
|
||||||
|
|
||||||
ARGS_LIST_EXCHANGES = ["print_one_column", "list_exchanges_all"]
|
|
||||||
|
|
||||||
ARGS_LIST_TIMEFRAMES = ["exchange", "print_one_column"]
|
|
||||||
|
|
||||||
ARGS_LIST_PAIRS = ["exchange", "print_list", "list_pairs_print_json", "print_one_column",
|
|
||||||
"print_csv", "base_currencies", "quote_currencies", "list_pairs_all"]
|
|
||||||
|
|
||||||
ARGS_CREATE_USERDIR = ["user_data_dir"]
|
|
||||||
|
|
||||||
ARGS_DOWNLOAD_DATA = ["pairs", "pairs_file", "days", "download_trades", "exchange",
|
|
||||||
"timeframes", "erase"]
|
|
||||||
|
|
||||||
ARGS_PLOT_DATAFRAME = ["pairs", "indicators1", "indicators2", "plot_limit", "db_url",
|
|
||||||
"trade_source", "export", "exportfilename", "timerange", "ticker_interval"]
|
|
||||||
|
|
||||||
ARGS_PLOT_PROFIT = ["pairs", "timerange", "export", "exportfilename", "db_url",
|
|
||||||
"trade_source", "ticker_interval"]
|
|
||||||
|
|
||||||
NO_CONF_REQURIED = ["download-data", "list-timeframes", "list-markets", "list-pairs",
|
|
||||||
"plot-dataframe", "plot-profit"]
|
|
||||||
|
|
||||||
NO_CONF_ALLOWED = ["create-userdir", "list-exchanges"]
|
|
||||||
|
|
||||||
|
|
||||||
class Arguments:
|
|
||||||
"""
|
|
||||||
Arguments Class. Manage the arguments received by the cli
|
|
||||||
"""
|
|
||||||
def __init__(self, args: Optional[List[str]]) -> None:
|
|
||||||
self.args = args
|
|
||||||
self._parsed_arg: Optional[argparse.Namespace] = None
|
|
||||||
self.parser = argparse.ArgumentParser(description='Free, open source crypto trading bot')
|
|
||||||
|
|
||||||
def _load_args(self) -> None:
|
|
||||||
self._build_args(optionlist=ARGS_MAIN)
|
|
||||||
self._build_subcommands()
|
|
||||||
|
|
||||||
def get_parsed_arg(self) -> Dict[str, Any]:
|
|
||||||
"""
|
|
||||||
Return the list of arguments
|
|
||||||
:return: List[str] List of arguments
|
|
||||||
"""
|
|
||||||
if self._parsed_arg is None:
|
|
||||||
self._load_args()
|
|
||||||
self._parsed_arg = self._parse_args()
|
|
||||||
|
|
||||||
return vars(self._parsed_arg)
|
|
||||||
|
|
||||||
def _parse_args(self) -> argparse.Namespace:
|
|
||||||
"""
|
|
||||||
Parses given arguments and returns an argparse Namespace instance.
|
|
||||||
"""
|
|
||||||
parsed_arg = self.parser.parse_args(self.args)
|
|
||||||
|
|
||||||
# When no config is provided, but a config exists, use that configuration!
|
|
||||||
subparser = parsed_arg.subparser if 'subparser' in parsed_arg else None
|
|
||||||
|
|
||||||
# Workaround issue in argparse with action='append' and default value
|
|
||||||
# (see https://bugs.python.org/issue16399)
|
|
||||||
# Allow no-config for certain commands (like downloading / plotting)
|
|
||||||
if (parsed_arg.config is None
|
|
||||||
and subparser not in NO_CONF_ALLOWED
|
|
||||||
and ((Path.cwd() / constants.DEFAULT_CONFIG).is_file()
|
|
||||||
or (subparser not in NO_CONF_REQURIED))):
|
|
||||||
parsed_arg.config = [constants.DEFAULT_CONFIG]
|
|
||||||
|
|
||||||
return parsed_arg
|
|
||||||
|
|
||||||
def _build_args(self, optionlist, parser=None):
|
|
||||||
parser = parser or self.parser
|
|
||||||
|
|
||||||
for val in optionlist:
|
|
||||||
opt = AVAILABLE_CLI_OPTIONS[val]
|
|
||||||
parser.add_argument(*opt.cli, dest=val, **opt.kwargs)
|
|
||||||
|
|
||||||
def _build_subcommands(self) -> None:
|
|
||||||
"""
|
|
||||||
Builds and attaches all subcommands.
|
|
||||||
:return: None
|
|
||||||
"""
|
|
||||||
from freqtrade.optimize import start_backtesting, start_hyperopt, start_edge
|
|
||||||
from freqtrade.utils import (start_create_userdir, start_download_data,
|
|
||||||
start_list_exchanges, start_list_timeframes,
|
|
||||||
start_list_markets)
|
|
||||||
|
|
||||||
subparsers = self.parser.add_subparsers(dest='subparser')
|
|
||||||
|
|
||||||
# Add backtesting subcommand
|
|
||||||
backtesting_cmd = subparsers.add_parser('backtesting', help='Backtesting module.')
|
|
||||||
backtesting_cmd.set_defaults(func=start_backtesting)
|
|
||||||
self._build_args(optionlist=ARGS_BACKTEST, parser=backtesting_cmd)
|
|
||||||
|
|
||||||
# Add edge subcommand
|
|
||||||
edge_cmd = subparsers.add_parser('edge', help='Edge module.')
|
|
||||||
edge_cmd.set_defaults(func=start_edge)
|
|
||||||
self._build_args(optionlist=ARGS_EDGE, parser=edge_cmd)
|
|
||||||
|
|
||||||
# Add hyperopt subcommand
|
|
||||||
hyperopt_cmd = subparsers.add_parser('hyperopt', help='Hyperopt module.')
|
|
||||||
hyperopt_cmd.set_defaults(func=start_hyperopt)
|
|
||||||
self._build_args(optionlist=ARGS_HYPEROPT, parser=hyperopt_cmd)
|
|
||||||
|
|
||||||
# add create-userdir subcommand
|
|
||||||
create_userdir_cmd = subparsers.add_parser('create-userdir',
|
|
||||||
help="Create user-data directory.")
|
|
||||||
create_userdir_cmd.set_defaults(func=start_create_userdir)
|
|
||||||
self._build_args(optionlist=ARGS_CREATE_USERDIR, parser=create_userdir_cmd)
|
|
||||||
|
|
||||||
# Add list-exchanges subcommand
|
|
||||||
list_exchanges_cmd = subparsers.add_parser(
|
|
||||||
'list-exchanges',
|
|
||||||
help='Print available exchanges.'
|
|
||||||
)
|
|
||||||
list_exchanges_cmd.set_defaults(func=start_list_exchanges)
|
|
||||||
self._build_args(optionlist=ARGS_LIST_EXCHANGES, parser=list_exchanges_cmd)
|
|
||||||
|
|
||||||
# Add list-timeframes subcommand
|
|
||||||
list_timeframes_cmd = subparsers.add_parser(
|
|
||||||
'list-timeframes',
|
|
||||||
help='Print available ticker intervals (timeframes) for the exchange.'
|
|
||||||
)
|
|
||||||
list_timeframes_cmd.set_defaults(func=start_list_timeframes)
|
|
||||||
self._build_args(optionlist=ARGS_LIST_TIMEFRAMES, parser=list_timeframes_cmd)
|
|
||||||
|
|
||||||
# Add list-markets subcommand
|
|
||||||
list_markets_cmd = subparsers.add_parser(
|
|
||||||
'list-markets',
|
|
||||||
help='Print markets on exchange.'
|
|
||||||
)
|
|
||||||
list_markets_cmd.set_defaults(func=partial(start_list_markets, pairs_only=False))
|
|
||||||
self._build_args(optionlist=ARGS_LIST_PAIRS, parser=list_markets_cmd)
|
|
||||||
|
|
||||||
# Add list-pairs subcommand
|
|
||||||
list_pairs_cmd = subparsers.add_parser(
|
|
||||||
'list-pairs',
|
|
||||||
help='Print pairs on exchange.'
|
|
||||||
)
|
|
||||||
list_pairs_cmd.set_defaults(func=partial(start_list_markets, pairs_only=True))
|
|
||||||
self._build_args(optionlist=ARGS_LIST_PAIRS, parser=list_pairs_cmd)
|
|
||||||
|
|
||||||
# Add download-data subcommand
|
|
||||||
download_data_cmd = subparsers.add_parser(
|
|
||||||
'download-data',
|
|
||||||
help='Download backtesting data.'
|
|
||||||
)
|
|
||||||
download_data_cmd.set_defaults(func=start_download_data)
|
|
||||||
self._build_args(optionlist=ARGS_DOWNLOAD_DATA, parser=download_data_cmd)
|
|
||||||
|
|
||||||
# Add Plotting subcommand
|
|
||||||
from freqtrade.plot.plot_utils import start_plot_dataframe, start_plot_profit
|
|
||||||
plot_dataframe_cmd = subparsers.add_parser(
|
|
||||||
'plot-dataframe',
|
|
||||||
help='Plot candles with indicators.'
|
|
||||||
)
|
|
||||||
plot_dataframe_cmd.set_defaults(func=start_plot_dataframe)
|
|
||||||
self._build_args(optionlist=ARGS_PLOT_DATAFRAME, parser=plot_dataframe_cmd)
|
|
||||||
|
|
||||||
# Plot profit
|
|
||||||
plot_profit_cmd = subparsers.add_parser(
|
|
||||||
'plot-profit',
|
|
||||||
help='Generate plot showing profits.'
|
|
||||||
)
|
|
||||||
plot_profit_cmd.set_defaults(func=start_plot_profit)
|
|
||||||
self._build_args(optionlist=ARGS_PLOT_PROFIT, parser=plot_profit_cmd)
|
|
||||||
@@ -1,15 +1,28 @@
|
|||||||
import logging
|
import logging
|
||||||
from typing import Any, Dict
|
from typing import Any, Dict
|
||||||
|
|
||||||
from freqtrade import OperationalException
|
from freqtrade.exceptions import OperationalException
|
||||||
from freqtrade.exchange import (available_exchanges, get_exchange_bad_reason,
|
from freqtrade.exchange import (available_exchanges, get_exchange_bad_reason,
|
||||||
is_exchange_known_ccxt, is_exchange_bad,
|
is_exchange_bad, is_exchange_known_ccxt,
|
||||||
is_exchange_officially_supported)
|
is_exchange_officially_supported)
|
||||||
from freqtrade.state import RunMode
|
from freqtrade.state import RunMode
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def remove_credentials(config: Dict[str, Any]) -> None:
|
||||||
|
"""
|
||||||
|
Removes exchange keys from the configuration and specifies dry-run
|
||||||
|
Used for backtesting / hyperopt / edge and utils.
|
||||||
|
Modifies the input dict!
|
||||||
|
"""
|
||||||
|
config['exchange']['key'] = ''
|
||||||
|
config['exchange']['secret'] = ''
|
||||||
|
config['exchange']['password'] = ''
|
||||||
|
config['exchange']['uid'] = ''
|
||||||
|
config['dry_run'] = True
|
||||||
|
|
||||||
|
|
||||||
def check_exchange(config: Dict[str, Any], check_for_bad: bool = True) -> bool:
|
def check_exchange(config: Dict[str, Any], check_for_bad: bool = True) -> bool:
|
||||||
"""
|
"""
|
||||||
Check if the exchange name in the config file is supported by Freqtrade
|
Check if the exchange name in the config file is supported by Freqtrade
|
||||||
@@ -21,7 +34,8 @@ def check_exchange(config: Dict[str, Any], check_for_bad: bool = True) -> bool:
|
|||||||
and thus is not known for the Freqtrade at all.
|
and thus is not known for the Freqtrade at all.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if config['runmode'] in [RunMode.PLOT] and not config.get('exchange', {}).get('name'):
|
if (config['runmode'] in [RunMode.PLOT, RunMode.UTIL_NO_EXCHANGE, RunMode.OTHER]
|
||||||
|
and not config.get('exchange', {}).get('name')):
|
||||||
# Skip checking exchange in plot mode, since it requires no exchange
|
# Skip checking exchange in plot mode, since it requires no exchange
|
||||||
return True
|
return True
|
||||||
logger.info("Checking exchange...")
|
logger.info("Checking exchange...")
|
||||||
|
|||||||
25
freqtrade/configuration/config_setup.py
Normal file
25
freqtrade/configuration/config_setup.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import logging
|
||||||
|
from typing import Any, Dict
|
||||||
|
|
||||||
|
from .config_validation import validate_config_consistency
|
||||||
|
from .configuration import Configuration
|
||||||
|
from .check_exchange import remove_credentials
|
||||||
|
from freqtrade.state import RunMode
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def setup_utils_configuration(args: Dict[str, Any], method: RunMode) -> Dict[str, Any]:
|
||||||
|
"""
|
||||||
|
Prepare the configuration for utils subcommands
|
||||||
|
:param args: Cli args from Arguments()
|
||||||
|
:return: Configuration
|
||||||
|
"""
|
||||||
|
configuration = Configuration(args, method)
|
||||||
|
config = configuration.get_config()
|
||||||
|
|
||||||
|
# Ensure we do not use Exchange credentials
|
||||||
|
remove_credentials(config)
|
||||||
|
validate_config_consistency(config)
|
||||||
|
|
||||||
|
return config
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
import logging
|
import logging
|
||||||
|
from copy import deepcopy
|
||||||
from typing import Any, Dict
|
from typing import Any, Dict
|
||||||
|
|
||||||
from jsonschema import Draft4Validator, validators
|
from jsonschema import Draft4Validator, validators
|
||||||
from jsonschema.exceptions import ValidationError, best_match
|
from jsonschema.exceptions import ValidationError, best_match
|
||||||
|
|
||||||
from freqtrade import constants, OperationalException
|
from freqtrade import constants
|
||||||
|
from freqtrade.exceptions import OperationalException
|
||||||
|
from freqtrade.state import RunMode
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -41,15 +43,20 @@ def validate_config_schema(conf: Dict[str, Any]) -> Dict[str, Any]:
|
|||||||
:param conf: Config in JSON format
|
:param conf: Config in JSON format
|
||||||
:return: Returns the config if valid, otherwise throw an exception
|
:return: Returns the config if valid, otherwise throw an exception
|
||||||
"""
|
"""
|
||||||
|
conf_schema = deepcopy(constants.CONF_SCHEMA)
|
||||||
|
if conf.get('runmode', RunMode.OTHER) in (RunMode.DRY_RUN, RunMode.LIVE):
|
||||||
|
conf_schema['required'] = constants.SCHEMA_TRADE_REQUIRED
|
||||||
|
else:
|
||||||
|
conf_schema['required'] = constants.SCHEMA_MINIMAL_REQUIRED
|
||||||
try:
|
try:
|
||||||
FreqtradeValidator(constants.CONF_SCHEMA).validate(conf)
|
FreqtradeValidator(conf_schema).validate(conf)
|
||||||
return conf
|
return conf
|
||||||
except ValidationError as e:
|
except ValidationError as e:
|
||||||
logger.critical(
|
logger.critical(
|
||||||
f"Invalid configuration. See config.json.example. Reason: {e}"
|
f"Invalid configuration. See config.json.example. Reason: {e}"
|
||||||
)
|
)
|
||||||
raise ValidationError(
|
raise ValidationError(
|
||||||
best_match(Draft4Validator(constants.CONF_SCHEMA).iter_errors(conf)).message
|
best_match(Draft4Validator(conf_schema).iter_errors(conf)).message
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -61,9 +68,27 @@ def validate_config_consistency(conf: Dict[str, Any]) -> None:
|
|||||||
:param conf: Config in JSON format
|
:param conf: Config in JSON format
|
||||||
:return: Returns None if everything is ok, otherwise throw an OperationalException
|
:return: Returns None if everything is ok, otherwise throw an OperationalException
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# validating trailing stoploss
|
# validating trailing stoploss
|
||||||
_validate_trailing_stoploss(conf)
|
_validate_trailing_stoploss(conf)
|
||||||
_validate_edge(conf)
|
_validate_edge(conf)
|
||||||
|
_validate_whitelist(conf)
|
||||||
|
_validate_unlimited_amount(conf)
|
||||||
|
|
||||||
|
# validate configuration before returning
|
||||||
|
logger.info('Validating configuration ...')
|
||||||
|
validate_config_schema(conf)
|
||||||
|
|
||||||
|
|
||||||
|
def _validate_unlimited_amount(conf: Dict[str, Any]) -> None:
|
||||||
|
"""
|
||||||
|
If edge is disabled, either max_open_trades or stake_amount need to be set.
|
||||||
|
:raise: OperationalException if config validation failed
|
||||||
|
"""
|
||||||
|
if (not conf.get('edge', {}).get('enabled')
|
||||||
|
and conf.get('max_open_trades') == float('inf')
|
||||||
|
and conf.get('stake_amount') == constants.UNLIMITED_STAKE_AMOUNT):
|
||||||
|
raise OperationalException("`max_open_trades` and `stake_amount` cannot both be unlimited.")
|
||||||
|
|
||||||
|
|
||||||
def _validate_trailing_stoploss(conf: Dict[str, Any]) -> None:
|
def _validate_trailing_stoploss(conf: Dict[str, Any]) -> None:
|
||||||
@@ -111,3 +136,17 @@ def _validate_edge(conf: Dict[str, Any]) -> None:
|
|||||||
"Edge and VolumePairList are incompatible, "
|
"Edge and VolumePairList are incompatible, "
|
||||||
"Edge will override whatever pairs VolumePairlist selects."
|
"Edge will override whatever pairs VolumePairlist selects."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _validate_whitelist(conf: Dict[str, Any]) -> None:
|
||||||
|
"""
|
||||||
|
Dynamic whitelist does not require pair_whitelist to be set - however StaticWhitelist does.
|
||||||
|
"""
|
||||||
|
if conf.get('runmode', RunMode.OTHER) in [RunMode.OTHER, RunMode.PLOT,
|
||||||
|
RunMode.UTIL_NO_EXCHANGE, RunMode.UTIL_EXCHANGE]:
|
||||||
|
return
|
||||||
|
|
||||||
|
for pl in conf.get('pairlists', [{'method': 'StaticPairList'}]):
|
||||||
|
if (pl.get('method') == 'StaticPairList'
|
||||||
|
and not conf.get('exchange', {}).get('pair_whitelist')):
|
||||||
|
raise OperationalException("StaticPairList requires pair_whitelist to be set.")
|
||||||
|
|||||||
@@ -7,17 +7,16 @@ from copy import deepcopy
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, Callable, Dict, List, Optional
|
from typing import Any, Callable, Dict, List, Optional
|
||||||
|
|
||||||
from freqtrade import OperationalException, constants
|
from freqtrade import constants
|
||||||
from freqtrade.configuration.check_exchange import check_exchange
|
from freqtrade.configuration.check_exchange import check_exchange
|
||||||
from freqtrade.configuration.config_validation import (validate_config_consistency,
|
|
||||||
validate_config_schema)
|
|
||||||
from freqtrade.configuration.deprecated_settings import process_temporary_deprecated_settings
|
from freqtrade.configuration.deprecated_settings import process_temporary_deprecated_settings
|
||||||
from freqtrade.configuration.directory_operations import (create_datadir,
|
from freqtrade.configuration.directory_operations import (create_datadir,
|
||||||
create_userdata_dir)
|
create_userdata_dir)
|
||||||
from freqtrade.configuration.load_config import load_config_file
|
from freqtrade.configuration.load_config import load_config_file
|
||||||
|
from freqtrade.exceptions import OperationalException
|
||||||
from freqtrade.loggers import setup_logging
|
from freqtrade.loggers import setup_logging
|
||||||
from freqtrade.misc import deep_merge_dicts, json_load
|
from freqtrade.misc import deep_merge_dicts, json_load
|
||||||
from freqtrade.state import RunMode
|
from freqtrade.state import NON_UTIL_MODES, TRADING_MODES, RunMode
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -55,7 +54,7 @@ class Configuration:
|
|||||||
:param files: List of file paths
|
:param files: List of file paths
|
||||||
:return: configuration dictionary
|
:return: configuration dictionary
|
||||||
"""
|
"""
|
||||||
c = Configuration({"config": files}, RunMode.OTHER)
|
c = Configuration({'config': files}, RunMode.OTHER)
|
||||||
return c.get_config()
|
return c.get_config()
|
||||||
|
|
||||||
def load_from_files(self, files: List[str]) -> Dict[str, Any]:
|
def load_from_files(self, files: List[str]) -> Dict[str, Any]:
|
||||||
@@ -81,9 +80,8 @@ class Configuration:
|
|||||||
if 'ask_strategy' not in config:
|
if 'ask_strategy' not in config:
|
||||||
config['ask_strategy'] = {}
|
config['ask_strategy'] = {}
|
||||||
|
|
||||||
# validate configuration before returning
|
if 'pairlists' not in config:
|
||||||
logger.info('Validating configuration ...')
|
config['pairlists'] = []
|
||||||
validate_config_schema(config)
|
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
@@ -93,19 +91,23 @@ class Configuration:
|
|||||||
:return: Configuration dictionary
|
:return: Configuration dictionary
|
||||||
"""
|
"""
|
||||||
# Load all configs
|
# Load all configs
|
||||||
config: Dict[str, Any] = self.load_from_files(self.args["config"])
|
config: Dict[str, Any] = self.load_from_files(self.args.get("config", []))
|
||||||
|
|
||||||
# Keep a copy of the original configuration file
|
# Keep a copy of the original configuration file
|
||||||
config['original_config'] = deepcopy(config)
|
config['original_config'] = deepcopy(config)
|
||||||
|
|
||||||
|
self._process_logging_options(config)
|
||||||
|
|
||||||
|
self._process_runmode(config)
|
||||||
|
|
||||||
self._process_common_options(config)
|
self._process_common_options(config)
|
||||||
|
|
||||||
|
self._process_trading_options(config)
|
||||||
|
|
||||||
self._process_optimize_options(config)
|
self._process_optimize_options(config)
|
||||||
|
|
||||||
self._process_plot_options(config)
|
self._process_plot_options(config)
|
||||||
|
|
||||||
self._process_runmode(config)
|
|
||||||
|
|
||||||
# Check if the exchange set by the user is supported
|
# Check if the exchange set by the user is supported
|
||||||
check_exchange(config, config.get('experimental', {}).get('block_bad_exchanges', True))
|
check_exchange(config, config.get('experimental', {}).get('block_bad_exchanges', True))
|
||||||
|
|
||||||
@@ -113,8 +115,6 @@ class Configuration:
|
|||||||
|
|
||||||
process_temporary_deprecated_settings(config)
|
process_temporary_deprecated_settings(config)
|
||||||
|
|
||||||
validate_config_consistency(config)
|
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
def _process_logging_options(self, config: Dict[str, Any]) -> None:
|
def _process_logging_options(self, config: Dict[str, Any]) -> None:
|
||||||
@@ -123,28 +123,16 @@ class Configuration:
|
|||||||
the -v/--verbose, --logfile options
|
the -v/--verbose, --logfile options
|
||||||
"""
|
"""
|
||||||
# Log level
|
# Log level
|
||||||
config.update({'verbosity': self.args.get("verbosity", 0)})
|
config.update({'verbosity': self.args.get('verbosity', 0)})
|
||||||
|
|
||||||
if 'logfile' in self.args and self.args["logfile"]:
|
if 'logfile' in self.args and self.args['logfile']:
|
||||||
config.update({'logfile': self.args["logfile"]})
|
config.update({'logfile': self.args['logfile']})
|
||||||
|
|
||||||
setup_logging(config)
|
setup_logging(config)
|
||||||
|
|
||||||
def _process_common_options(self, config: Dict[str, Any]) -> None:
|
def _process_trading_options(self, config: Dict[str, Any]) -> None:
|
||||||
|
if config['runmode'] not in TRADING_MODES:
|
||||||
self._process_logging_options(config)
|
return
|
||||||
|
|
||||||
# Set strategy if not specified in config and or if it's non default
|
|
||||||
if self.args.get("strategy") != constants.DEFAULT_STRATEGY or not config.get('strategy'):
|
|
||||||
config.update({'strategy': self.args.get("strategy")})
|
|
||||||
|
|
||||||
self._args_to_config(config, argname='strategy_path',
|
|
||||||
logstring='Using additional Strategy lookup path: {}')
|
|
||||||
|
|
||||||
if ('db_url' in self.args and self.args["db_url"] and
|
|
||||||
self.args["db_url"] != constants.DEFAULT_DB_PROD_URL):
|
|
||||||
config.update({'db_url': self.args["db_url"]})
|
|
||||||
logger.info('Parameter --db-url detected ...')
|
|
||||||
|
|
||||||
if config.get('dry_run', False):
|
if config.get('dry_run', False):
|
||||||
logger.info('Dry run is enabled')
|
logger.info('Dry run is enabled')
|
||||||
@@ -158,15 +146,25 @@ class Configuration:
|
|||||||
|
|
||||||
logger.info(f'Using DB: "{config["db_url"]}"')
|
logger.info(f'Using DB: "{config["db_url"]}"')
|
||||||
|
|
||||||
|
def _process_common_options(self, config: Dict[str, Any]) -> None:
|
||||||
|
|
||||||
|
# Set strategy if not specified in config and or if it's non default
|
||||||
|
if self.args.get('strategy') or not config.get('strategy'):
|
||||||
|
config.update({'strategy': self.args.get('strategy')})
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='strategy_path',
|
||||||
|
logstring='Using additional Strategy lookup path: {}')
|
||||||
|
|
||||||
|
if ('db_url' in self.args and self.args['db_url'] and
|
||||||
|
self.args['db_url'] != constants.DEFAULT_DB_PROD_URL):
|
||||||
|
config.update({'db_url': self.args['db_url']})
|
||||||
|
logger.info('Parameter --db-url detected ...')
|
||||||
|
|
||||||
if config.get('forcebuy_enable', False):
|
if config.get('forcebuy_enable', False):
|
||||||
logger.warning('`forcebuy` RPC message enabled.')
|
logger.warning('`forcebuy` RPC message enabled.')
|
||||||
|
|
||||||
# Setting max_open_trades to infinite if -1
|
|
||||||
if config.get('max_open_trades') == -1:
|
|
||||||
config['max_open_trades'] = float('inf')
|
|
||||||
|
|
||||||
# Support for sd_notify
|
# Support for sd_notify
|
||||||
if 'sd_notify' in self.args and self.args["sd_notify"]:
|
if 'sd_notify' in self.args and self.args['sd_notify']:
|
||||||
config['internals'].update({'sd_notify': True})
|
config['internals'].update({'sd_notify': True})
|
||||||
|
|
||||||
def _process_datadir_options(self, config: Dict[str, Any]) -> None:
|
def _process_datadir_options(self, config: Dict[str, Any]) -> None:
|
||||||
@@ -175,53 +173,61 @@ class Configuration:
|
|||||||
--user-data, --datadir
|
--user-data, --datadir
|
||||||
"""
|
"""
|
||||||
# Check exchange parameter here - otherwise `datadir` might be wrong.
|
# Check exchange parameter here - otherwise `datadir` might be wrong.
|
||||||
if "exchange" in self.args and self.args["exchange"]:
|
if 'exchange' in self.args and self.args['exchange']:
|
||||||
config['exchange']['name'] = self.args["exchange"]
|
config['exchange']['name'] = self.args['exchange']
|
||||||
logger.info(f"Using exchange {config['exchange']['name']}")
|
logger.info(f"Using exchange {config['exchange']['name']}")
|
||||||
|
|
||||||
if 'user_data_dir' in self.args and self.args["user_data_dir"]:
|
if 'pair_whitelist' not in config['exchange']:
|
||||||
config.update({'user_data_dir': self.args["user_data_dir"]})
|
config['exchange']['pair_whitelist'] = []
|
||||||
|
|
||||||
|
if 'user_data_dir' in self.args and self.args['user_data_dir']:
|
||||||
|
config.update({'user_data_dir': self.args['user_data_dir']})
|
||||||
elif 'user_data_dir' not in config:
|
elif 'user_data_dir' not in config:
|
||||||
# Default to cwd/user_data (legacy option ...)
|
# Default to cwd/user_data (legacy option ...)
|
||||||
config.update({'user_data_dir': str(Path.cwd() / "user_data")})
|
config.update({'user_data_dir': str(Path.cwd() / 'user_data')})
|
||||||
|
|
||||||
# reset to user_data_dir so this contains the absolute path.
|
# reset to user_data_dir so this contains the absolute path.
|
||||||
config['user_data_dir'] = create_userdata_dir(config['user_data_dir'], create_dir=False)
|
config['user_data_dir'] = create_userdata_dir(config['user_data_dir'], create_dir=False)
|
||||||
logger.info('Using user-data directory: %s ...', config['user_data_dir'])
|
logger.info('Using user-data directory: %s ...', config['user_data_dir'])
|
||||||
|
|
||||||
config.update({'datadir': create_datadir(config, self.args.get("datadir", None))})
|
config.update({'datadir': create_datadir(config, self.args.get('datadir', None))})
|
||||||
logger.info('Using data directory: %s ...', config.get('datadir'))
|
logger.info('Using data directory: %s ...', config.get('datadir'))
|
||||||
|
|
||||||
if self.args.get('exportfilename'):
|
if self.args.get('exportfilename'):
|
||||||
self._args_to_config(config, argname='exportfilename',
|
self._args_to_config(config, argname='exportfilename',
|
||||||
logstring='Storing backtest results to {} ...')
|
logstring='Storing backtest results to {} ...')
|
||||||
|
config['exportfilename'] = Path(config['exportfilename'])
|
||||||
else:
|
else:
|
||||||
config['exportfilename'] = (config['user_data_dir']
|
config['exportfilename'] = (config['user_data_dir']
|
||||||
/ 'backtest_results/backtest-result.json')
|
/ 'backtest_results')
|
||||||
|
|
||||||
def _process_optimize_options(self, config: Dict[str, Any]) -> None:
|
def _process_optimize_options(self, config: Dict[str, Any]) -> None:
|
||||||
|
|
||||||
# This will override the strategy configuration
|
# This will override the strategy configuration
|
||||||
self._args_to_config(config, argname='ticker_interval',
|
self._args_to_config(config, argname='timeframe',
|
||||||
logstring='Parameter -i/--ticker-interval detected ... '
|
logstring='Parameter -i/--timeframe detected ... '
|
||||||
'Using ticker_interval: {} ...')
|
'Using timeframe: {} ...')
|
||||||
|
|
||||||
self._args_to_config(config, argname='position_stacking',
|
self._args_to_config(config, argname='position_stacking',
|
||||||
logstring='Parameter --enable-position-stacking detected ...')
|
logstring='Parameter --enable-position-stacking detected ...')
|
||||||
|
|
||||||
|
# Setting max_open_trades to infinite if -1
|
||||||
|
if config.get('max_open_trades') == -1:
|
||||||
|
config['max_open_trades'] = float('inf')
|
||||||
|
|
||||||
if 'use_max_market_positions' in self.args and not self.args["use_max_market_positions"]:
|
if 'use_max_market_positions' in self.args and not self.args["use_max_market_positions"]:
|
||||||
config.update({'use_max_market_positions': False})
|
config.update({'use_max_market_positions': False})
|
||||||
logger.info('Parameter --disable-max-market-positions detected ...')
|
logger.info('Parameter --disable-max-market-positions detected ...')
|
||||||
logger.info('max_open_trades set to unlimited ...')
|
logger.info('max_open_trades set to unlimited ...')
|
||||||
elif 'max_open_trades' in self.args and self.args["max_open_trades"]:
|
elif 'max_open_trades' in self.args and self.args['max_open_trades']:
|
||||||
config.update({'max_open_trades': self.args["max_open_trades"]})
|
config.update({'max_open_trades': self.args['max_open_trades']})
|
||||||
logger.info('Parameter --max_open_trades detected, '
|
logger.info('Parameter --max-open-trades detected, '
|
||||||
'overriding max_open_trades to: %s ...', config.get('max_open_trades'))
|
'overriding max_open_trades to: %s ...', config.get('max_open_trades'))
|
||||||
else:
|
elif config['runmode'] in NON_UTIL_MODES:
|
||||||
logger.info('Using max_open_trades: %s ...', config.get('max_open_trades'))
|
logger.info('Using max_open_trades: %s ...', config.get('max_open_trades'))
|
||||||
|
|
||||||
self._args_to_config(config, argname='stake_amount',
|
self._args_to_config(config, argname='stake_amount',
|
||||||
logstring='Parameter --stake_amount detected, '
|
logstring='Parameter --stake-amount detected, '
|
||||||
'overriding stake_amount to: {} ...')
|
'overriding stake_amount to: {} ...')
|
||||||
|
|
||||||
self._args_to_config(config, argname='fee',
|
self._args_to_config(config, argname='fee',
|
||||||
@@ -236,8 +242,8 @@ class Configuration:
|
|||||||
self._args_to_config(config, argname='strategy_list',
|
self._args_to_config(config, argname='strategy_list',
|
||||||
logstring='Using strategy list of {} strategies', logfun=len)
|
logstring='Using strategy list of {} strategies', logfun=len)
|
||||||
|
|
||||||
self._args_to_config(config, argname='ticker_interval',
|
self._args_to_config(config, argname='timeframe',
|
||||||
logstring='Overriding ticker interval with Command line argument')
|
logstring='Overriding timeframe with Command line argument')
|
||||||
|
|
||||||
self._args_to_config(config, argname='export',
|
self._args_to_config(config, argname='export',
|
||||||
logstring='Parameter --export detected: {} ...')
|
logstring='Parameter --export detected: {} ...')
|
||||||
@@ -277,6 +283,9 @@ class Configuration:
|
|||||||
self._args_to_config(config, argname='print_json',
|
self._args_to_config(config, argname='print_json',
|
||||||
logstring='Parameter --print-json detected ...')
|
logstring='Parameter --print-json detected ...')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='export_csv',
|
||||||
|
logstring='Parameter --export-csv detected: {}')
|
||||||
|
|
||||||
self._args_to_config(config, argname='hyperopt_jobs',
|
self._args_to_config(config, argname='hyperopt_jobs',
|
||||||
logstring='Parameter -j/--job-workers detected: {}')
|
logstring='Parameter -j/--job-workers detected: {}')
|
||||||
|
|
||||||
@@ -292,6 +301,51 @@ class Configuration:
|
|||||||
self._args_to_config(config, argname='hyperopt_loss',
|
self._args_to_config(config, argname='hyperopt_loss',
|
||||||
logstring='Using Hyperopt loss class name: {}')
|
logstring='Using Hyperopt loss class name: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='hyperopt_show_index',
|
||||||
|
logstring='Parameter -n/--index detected: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='hyperopt_list_best',
|
||||||
|
logstring='Parameter --best detected: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='hyperopt_list_profitable',
|
||||||
|
logstring='Parameter --profitable detected: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='hyperopt_list_min_trades',
|
||||||
|
logstring='Parameter --min-trades detected: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='hyperopt_list_max_trades',
|
||||||
|
logstring='Parameter --max-trades detected: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='hyperopt_list_min_avg_time',
|
||||||
|
logstring='Parameter --min-avg-time detected: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='hyperopt_list_max_avg_time',
|
||||||
|
logstring='Parameter --max-avg-time detected: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='hyperopt_list_min_avg_profit',
|
||||||
|
logstring='Parameter --min-avg-profit detected: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='hyperopt_list_max_avg_profit',
|
||||||
|
logstring='Parameter --max-avg-profit detected: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='hyperopt_list_min_total_profit',
|
||||||
|
logstring='Parameter --min-total-profit detected: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='hyperopt_list_max_total_profit',
|
||||||
|
logstring='Parameter --max-total-profit detected: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='hyperopt_list_min_objective',
|
||||||
|
logstring='Parameter --min-objective detected: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='hyperopt_list_max_objective',
|
||||||
|
logstring='Parameter --max-objective detected: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='hyperopt_list_no_details',
|
||||||
|
logstring='Parameter --no-details detected: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='hyperopt_show_no_header',
|
||||||
|
logstring='Parameter --no-header detected: {}')
|
||||||
|
|
||||||
def _process_plot_options(self, config: Dict[str, Any]) -> None:
|
def _process_plot_options(self, config: Dict[str, Any]) -> None:
|
||||||
|
|
||||||
self._args_to_config(config, argname='pairs',
|
self._args_to_config(config, argname='pairs',
|
||||||
@@ -303,28 +357,46 @@ class Configuration:
|
|||||||
self._args_to_config(config, argname='indicators2',
|
self._args_to_config(config, argname='indicators2',
|
||||||
logstring='Using indicators2: {}')
|
logstring='Using indicators2: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='trade_ids',
|
||||||
|
logstring='Filtering on trade_ids: {}')
|
||||||
|
|
||||||
self._args_to_config(config, argname='plot_limit',
|
self._args_to_config(config, argname='plot_limit',
|
||||||
logstring='Limiting plot to: {}')
|
logstring='Limiting plot to: {}')
|
||||||
|
|
||||||
self._args_to_config(config, argname='trade_source',
|
self._args_to_config(config, argname='trade_source',
|
||||||
logstring='Using trades from: {}')
|
logstring='Using trades from: {}')
|
||||||
|
|
||||||
self._args_to_config(config, argname='erase',
|
self._args_to_config(config, argname='erase',
|
||||||
logstring='Erase detected. Deleting existing data.')
|
logstring='Erase detected. Deleting existing data.')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='no_trades',
|
||||||
|
logstring='Parameter --no-trades detected.')
|
||||||
|
|
||||||
self._args_to_config(config, argname='timeframes',
|
self._args_to_config(config, argname='timeframes',
|
||||||
logstring='timeframes --timeframes: {}')
|
logstring='timeframes --timeframes: {}')
|
||||||
|
|
||||||
self._args_to_config(config, argname='days',
|
self._args_to_config(config, argname='days',
|
||||||
logstring='Detected --days: {}')
|
logstring='Detected --days: {}')
|
||||||
|
|
||||||
self._args_to_config(config, argname='download_trades',
|
self._args_to_config(config, argname='download_trades',
|
||||||
logstring='Detected --dl-trades: {}')
|
logstring='Detected --dl-trades: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='dataformat_ohlcv',
|
||||||
|
logstring='Using "{}" to store OHLCV data.')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='dataformat_trades',
|
||||||
|
logstring='Using "{}" to store trades data.')
|
||||||
|
|
||||||
def _process_runmode(self, config: Dict[str, Any]) -> None:
|
def _process_runmode(self, config: Dict[str, Any]) -> None:
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='dry_run',
|
||||||
|
logstring='Parameter --dry-run detected, '
|
||||||
|
'overriding dry_run to: {} ...')
|
||||||
|
|
||||||
if not self.runmode:
|
if not self.runmode:
|
||||||
# Handle real mode, infer dry/live from config
|
# Handle real mode, infer dry/live from config
|
||||||
self.runmode = RunMode.DRY_RUN if config.get('dry_run', True) else RunMode.LIVE
|
self.runmode = RunMode.DRY_RUN if config.get('dry_run', True) else RunMode.LIVE
|
||||||
logger.info(f"Runmode set to {self.runmode}.")
|
logger.info(f"Runmode set to {self.runmode.value}.")
|
||||||
|
|
||||||
config.update({'runmode': self.runmode})
|
config.update({'runmode': self.runmode})
|
||||||
|
|
||||||
@@ -375,12 +447,12 @@ class Configuration:
|
|||||||
config['pairs'].sort()
|
config['pairs'].sort()
|
||||||
return
|
return
|
||||||
|
|
||||||
if "config" in self.args and self.args["config"]:
|
if 'config' in self.args and self.args['config']:
|
||||||
logger.info("Using pairlist from configuration.")
|
logger.info("Using pairlist from configuration.")
|
||||||
config['pairs'] = config.get('exchange', {}).get('pair_whitelist')
|
config['pairs'] = config.get('exchange', {}).get('pair_whitelist')
|
||||||
else:
|
else:
|
||||||
# Fall back to /dl_path/pairs.json
|
# Fall back to /dl_path/pairs.json
|
||||||
pairs_file = Path(config['datadir']) / "pairs.json"
|
pairs_file = config['datadir'] / 'pairs.json'
|
||||||
if pairs_file.exists():
|
if pairs_file.exists():
|
||||||
with pairs_file.open('r') as f:
|
with pairs_file.open('r') as f:
|
||||||
config['pairs'] = json_load(f)
|
config['pairs'] = json_load(f)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Functions to handle deprecated settings
|
|||||||
import logging
|
import logging
|
||||||
from typing import Any, Dict
|
from typing import Any, Dict
|
||||||
|
|
||||||
from freqtrade import OperationalException
|
from freqtrade.exceptions import OperationalException
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@@ -13,7 +13,7 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
def check_conflicting_settings(config: Dict[str, Any],
|
def check_conflicting_settings(config: Dict[str, Any],
|
||||||
section1: str, name1: str,
|
section1: str, name1: str,
|
||||||
section2: str, name2: str):
|
section2: str, name2: str) -> None:
|
||||||
section1_config = config.get(section1, {})
|
section1_config = config.get(section1, {})
|
||||||
section2_config = config.get(section2, {})
|
section2_config = config.get(section2, {})
|
||||||
if name1 in section1_config and name2 in section2_config:
|
if name1 in section1_config and name2 in section2_config:
|
||||||
@@ -28,7 +28,7 @@ def check_conflicting_settings(config: Dict[str, Any],
|
|||||||
|
|
||||||
def process_deprecated_setting(config: Dict[str, Any],
|
def process_deprecated_setting(config: Dict[str, Any],
|
||||||
section1: str, name1: str,
|
section1: str, name1: str,
|
||||||
section2: str, name2: str):
|
section2: str, name2: str) -> None:
|
||||||
section2_config = config.get(section2, {})
|
section2_config = config.get(section2, {})
|
||||||
|
|
||||||
if name2 in section2_config:
|
if name2 in section2_config:
|
||||||
@@ -57,3 +57,24 @@ def process_temporary_deprecated_settings(config: Dict[str, Any]) -> None:
|
|||||||
'experimental', 'sell_profit_only')
|
'experimental', 'sell_profit_only')
|
||||||
process_deprecated_setting(config, 'ask_strategy', 'ignore_roi_if_buy_signal',
|
process_deprecated_setting(config, 'ask_strategy', 'ignore_roi_if_buy_signal',
|
||||||
'experimental', 'ignore_roi_if_buy_signal')
|
'experimental', 'ignore_roi_if_buy_signal')
|
||||||
|
|
||||||
|
if (config.get('edge', {}).get('enabled', False)
|
||||||
|
and 'capital_available_percentage' in config.get('edge', {})):
|
||||||
|
raise OperationalException(
|
||||||
|
"DEPRECATED: "
|
||||||
|
"Using 'edge.capital_available_percentage' has been deprecated in favor of "
|
||||||
|
"'tradable_balance_ratio'. Please migrate your configuration to "
|
||||||
|
"'tradable_balance_ratio' and remove 'capital_available_percentage' "
|
||||||
|
"from the edge configuration."
|
||||||
|
)
|
||||||
|
if 'ticker_interval' in config:
|
||||||
|
logger.warning(
|
||||||
|
"DEPRECATED: "
|
||||||
|
"Please use 'timeframe' instead of 'ticker_interval."
|
||||||
|
)
|
||||||
|
if 'timeframe' in config:
|
||||||
|
raise OperationalException(
|
||||||
|
"Both 'timeframe' and 'ticker_interval' detected."
|
||||||
|
"Please remove 'ticker_interval' from your configuration to continue operating."
|
||||||
|
)
|
||||||
|
config['timeframe'] = config['ticker_interval']
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
import logging
|
import logging
|
||||||
from typing import Any, Dict, Optional
|
import shutil
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from typing import Any, Dict, Optional
|
||||||
|
|
||||||
from freqtrade import OperationalException
|
from freqtrade.exceptions import OperationalException
|
||||||
|
from freqtrade.constants import USER_DATA_FILES
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def create_datadir(config: Dict[str, Any], datadir: Optional[str] = None) -> str:
|
def create_datadir(config: Dict[str, Any], datadir: Optional[str] = None) -> Path:
|
||||||
|
|
||||||
folder = Path(datadir) if datadir else Path(f"{config['user_data_dir']}/data")
|
folder = Path(datadir) if datadir else Path(f"{config['user_data_dir']}/data")
|
||||||
if not datadir:
|
if not datadir:
|
||||||
@@ -18,10 +20,10 @@ def create_datadir(config: Dict[str, Any], datadir: Optional[str] = None) -> str
|
|||||||
if not folder.is_dir():
|
if not folder.is_dir():
|
||||||
folder.mkdir(parents=True)
|
folder.mkdir(parents=True)
|
||||||
logger.info(f'Created data directory: {datadir}')
|
logger.info(f'Created data directory: {datadir}')
|
||||||
return str(folder)
|
return folder
|
||||||
|
|
||||||
|
|
||||||
def create_userdata_dir(directory: str, create_dir=False) -> Path:
|
def create_userdata_dir(directory: str, create_dir: bool = False) -> Path:
|
||||||
"""
|
"""
|
||||||
Create userdata directory structure.
|
Create userdata directory structure.
|
||||||
if create_dir is True, then the parent-directory will be created if it does not exist.
|
if create_dir is True, then the parent-directory will be created if it does not exist.
|
||||||
@@ -31,7 +33,8 @@ def create_userdata_dir(directory: str, create_dir=False) -> Path:
|
|||||||
:param create_dir: Create directory if it does not exist.
|
:param create_dir: Create directory if it does not exist.
|
||||||
:return: Path object containing the directory
|
:return: Path object containing the directory
|
||||||
"""
|
"""
|
||||||
sub_dirs = ["backtest_results", "data", "hyperopts", "hyperopt_results", "plot", "strategies", ]
|
sub_dirs = ["backtest_results", "data", "hyperopts", "hyperopt_results", "logs",
|
||||||
|
"notebooks", "plot", "strategies", ]
|
||||||
folder = Path(directory)
|
folder = Path(directory)
|
||||||
if not folder.is_dir():
|
if not folder.is_dir():
|
||||||
if create_dir:
|
if create_dir:
|
||||||
@@ -48,3 +51,26 @@ def create_userdata_dir(directory: str, create_dir=False) -> Path:
|
|||||||
if not subfolder.is_dir():
|
if not subfolder.is_dir():
|
||||||
subfolder.mkdir(parents=False)
|
subfolder.mkdir(parents=False)
|
||||||
return folder
|
return folder
|
||||||
|
|
||||||
|
|
||||||
|
def copy_sample_files(directory: Path, overwrite: bool = False) -> None:
|
||||||
|
"""
|
||||||
|
Copy files from templates to User data directory.
|
||||||
|
:param directory: Directory to copy data to
|
||||||
|
:param overwrite: Overwrite existing sample files
|
||||||
|
"""
|
||||||
|
if not directory.is_dir():
|
||||||
|
raise OperationalException(f"Directory `{directory}` does not exist.")
|
||||||
|
sourcedir = Path(__file__).parents[1] / "templates"
|
||||||
|
for source, target in USER_DATA_FILES.items():
|
||||||
|
targetdir = directory / target
|
||||||
|
if not targetdir.is_dir():
|
||||||
|
raise OperationalException(f"Directory `{targetdir}` does not exist.")
|
||||||
|
targetfile = targetdir / source
|
||||||
|
if targetfile.exists():
|
||||||
|
if not overwrite:
|
||||||
|
logger.warning(f"File `{targetfile}` exists already, not deploying sample file.")
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
logger.warning(f"File `{targetfile}` exists already, overwriting.")
|
||||||
|
shutil.copy(str(sourcedir / source), str(targetfile))
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
"""
|
"""
|
||||||
This module contain functions to load the configuration file
|
This module contain functions to load the configuration file
|
||||||
"""
|
"""
|
||||||
import rapidjson
|
|
||||||
import logging
|
import logging
|
||||||
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
from typing import Any, Dict
|
from typing import Any, Dict
|
||||||
|
|
||||||
from freqtrade import OperationalException
|
import rapidjson
|
||||||
|
|
||||||
|
from freqtrade.exceptions import OperationalException
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -15,6 +17,26 @@ logger = logging.getLogger(__name__)
|
|||||||
CONFIG_PARSE_MODE = rapidjson.PM_COMMENTS | rapidjson.PM_TRAILING_COMMAS
|
CONFIG_PARSE_MODE = rapidjson.PM_COMMENTS | rapidjson.PM_TRAILING_COMMAS
|
||||||
|
|
||||||
|
|
||||||
|
def log_config_error_range(path: str, errmsg: str) -> str:
|
||||||
|
"""
|
||||||
|
Parses configuration file and prints range around error
|
||||||
|
"""
|
||||||
|
if path != '-':
|
||||||
|
offsetlist = re.findall(r'(?<=Parse\serror\sat\soffset\s)\d+', errmsg)
|
||||||
|
if offsetlist:
|
||||||
|
offset = int(offsetlist[0])
|
||||||
|
text = Path(path).read_text()
|
||||||
|
# Fetch an offset of 80 characters around the error line
|
||||||
|
subtext = text[offset-min(80, offset):offset+80]
|
||||||
|
segments = subtext.split('\n')
|
||||||
|
if len(segments) > 3:
|
||||||
|
# Remove first and last lines, to avoid odd truncations
|
||||||
|
return '\n'.join(segments[1:-1])
|
||||||
|
else:
|
||||||
|
return subtext
|
||||||
|
return ''
|
||||||
|
|
||||||
|
|
||||||
def load_config_file(path: str) -> Dict[str, Any]:
|
def load_config_file(path: str) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
Loads a config file from the given path
|
Loads a config file from the given path
|
||||||
@@ -29,5 +51,12 @@ def load_config_file(path: str) -> Dict[str, Any]:
|
|||||||
raise OperationalException(
|
raise OperationalException(
|
||||||
f'Config file "{path}" not found!'
|
f'Config file "{path}" not found!'
|
||||||
' Please create a config file or check whether it exists.')
|
' Please create a config file or check whether it exists.')
|
||||||
|
except rapidjson.JSONDecodeError as e:
|
||||||
|
err_range = log_config_error_range(path, str(e))
|
||||||
|
raise OperationalException(
|
||||||
|
f'{e}\n'
|
||||||
|
f'Please verify the following segment of your configuration:\n{err_range}'
|
||||||
|
if err_range else 'Please verify your configuration file for syntax errors.'
|
||||||
|
)
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
"""
|
"""
|
||||||
This module contains the argument manager class
|
This module contains the argument manager class
|
||||||
"""
|
"""
|
||||||
|
import logging
|
||||||
import re
|
import re
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
import arrow
|
import arrow
|
||||||
|
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class TimeRange:
|
class TimeRange:
|
||||||
"""
|
"""
|
||||||
object defining timerange inputs.
|
object defining timerange inputs.
|
||||||
@@ -27,8 +31,36 @@ class TimeRange:
|
|||||||
return (self.starttype == other.starttype and self.stoptype == other.stoptype
|
return (self.starttype == other.starttype and self.stoptype == other.stoptype
|
||||||
and self.startts == other.startts and self.stopts == other.stopts)
|
and self.startts == other.startts and self.stopts == other.stopts)
|
||||||
|
|
||||||
|
def subtract_start(self, seconds: int) -> None:
|
||||||
|
"""
|
||||||
|
Subtracts <seconds> from startts if startts is set.
|
||||||
|
:param seconds: Seconds to subtract from starttime
|
||||||
|
:return: None (Modifies the object in place)
|
||||||
|
"""
|
||||||
|
if self.startts:
|
||||||
|
self.startts = self.startts - seconds
|
||||||
|
|
||||||
|
def adjust_start_if_necessary(self, timeframe_secs: int, startup_candles: int,
|
||||||
|
min_date: arrow.Arrow) -> None:
|
||||||
|
"""
|
||||||
|
Adjust startts by <startup_candles> candles.
|
||||||
|
Applies only if no startup-candles have been available.
|
||||||
|
:param timeframe_secs: Timeframe in seconds e.g. `timeframe_to_seconds('5m')`
|
||||||
|
:param startup_candles: Number of candles to move start-date forward
|
||||||
|
:param min_date: Minimum data date loaded. Key kriterium to decide if start-time
|
||||||
|
has to be moved
|
||||||
|
:return: None (Modifies the object in place)
|
||||||
|
"""
|
||||||
|
if (not self.starttype or (startup_candles
|
||||||
|
and min_date.timestamp >= self.startts)):
|
||||||
|
# If no startts was defined, or backtest-data starts at the defined backtest-date
|
||||||
|
logger.warning("Moving start-date by %s candles to account for startup time.",
|
||||||
|
startup_candles)
|
||||||
|
self.startts = (min_date.timestamp + timeframe_secs * startup_candles)
|
||||||
|
self.starttype = 'date'
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def parse_timerange(text: Optional[str]):
|
def parse_timerange(text: Optional[str]) -> 'TimeRange':
|
||||||
"""
|
"""
|
||||||
Parse the value of the argument --timerange to determine what is the range desired
|
Parse the value of the argument --timerange to determine what is the range desired
|
||||||
:param text: value from --timerange
|
:param text: value from --timerange
|
||||||
|
|||||||
@@ -3,39 +3,59 @@
|
|||||||
"""
|
"""
|
||||||
bot constants
|
bot constants
|
||||||
"""
|
"""
|
||||||
|
from typing import List, Tuple
|
||||||
|
|
||||||
|
|
||||||
DEFAULT_CONFIG = 'config.json'
|
DEFAULT_CONFIG = 'config.json'
|
||||||
DEFAULT_EXCHANGE = 'bittrex'
|
DEFAULT_EXCHANGE = 'bittrex'
|
||||||
PROCESS_THROTTLE_SECS = 5 # sec
|
PROCESS_THROTTLE_SECS = 5 # sec
|
||||||
DEFAULT_TICKER_INTERVAL = 5 # min
|
|
||||||
HYPEROPT_EPOCH = 100 # epochs
|
HYPEROPT_EPOCH = 100 # epochs
|
||||||
RETRY_TIMEOUT = 30 # sec
|
RETRY_TIMEOUT = 30 # sec
|
||||||
DEFAULT_STRATEGY = 'DefaultStrategy'
|
|
||||||
DEFAULT_HYPEROPT = 'DefaultHyperOpt'
|
|
||||||
DEFAULT_HYPEROPT_LOSS = 'DefaultHyperOptLoss'
|
DEFAULT_HYPEROPT_LOSS = 'DefaultHyperOptLoss'
|
||||||
DEFAULT_DB_PROD_URL = 'sqlite:///tradesv3.sqlite'
|
DEFAULT_DB_PROD_URL = 'sqlite:///tradesv3.sqlite'
|
||||||
DEFAULT_DB_DRYRUN_URL = 'sqlite://'
|
DEFAULT_DB_DRYRUN_URL = 'sqlite:///tradesv3.dryrun.sqlite'
|
||||||
UNLIMITED_STAKE_AMOUNT = 'unlimited'
|
UNLIMITED_STAKE_AMOUNT = 'unlimited'
|
||||||
DEFAULT_AMOUNT_RESERVE_PERCENT = 0.05
|
DEFAULT_AMOUNT_RESERVE_PERCENT = 0.05
|
||||||
REQUIRED_ORDERTIF = ['buy', 'sell']
|
REQUIRED_ORDERTIF = ['buy', 'sell']
|
||||||
REQUIRED_ORDERTYPES = ['buy', 'sell', 'stoploss', 'stoploss_on_exchange']
|
REQUIRED_ORDERTYPES = ['buy', 'sell', 'stoploss', 'stoploss_on_exchange']
|
||||||
|
ORDERBOOK_SIDES = ['ask', 'bid']
|
||||||
ORDERTYPE_POSSIBILITIES = ['limit', 'market']
|
ORDERTYPE_POSSIBILITIES = ['limit', 'market']
|
||||||
ORDERTIF_POSSIBILITIES = ['gtc', 'fok', 'ioc']
|
ORDERTIF_POSSIBILITIES = ['gtc', 'fok', 'ioc']
|
||||||
AVAILABLE_PAIRLISTS = ['StaticPairList', 'VolumePairList']
|
AVAILABLE_PAIRLISTS = ['StaticPairList', 'VolumePairList',
|
||||||
DRY_RUN_WALLET = 999.9
|
'AgeFilter', 'PrecisionFilter', 'PriceFilter',
|
||||||
|
'ShuffleFilter', 'SpreadFilter']
|
||||||
|
AVAILABLE_DATAHANDLERS = ['json', 'jsongz', 'hdf5']
|
||||||
|
DRY_RUN_WALLET = 1000
|
||||||
|
DATETIME_PRINT_FORMAT = '%Y-%m-%d %H:%M:%S'
|
||||||
MATH_CLOSE_PREC = 1e-14 # Precision used for float comparisons
|
MATH_CLOSE_PREC = 1e-14 # Precision used for float comparisons
|
||||||
|
DEFAULT_DATAFRAME_COLUMNS = ['date', 'open', 'high', 'low', 'close', 'volume']
|
||||||
|
# Don't modify sequence of DEFAULT_TRADES_COLUMNS
|
||||||
|
# it has wide consequences for stored trades files
|
||||||
|
DEFAULT_TRADES_COLUMNS = ['timestamp', 'id', 'type', 'side', 'price', 'amount', 'cost']
|
||||||
|
|
||||||
TICKER_INTERVALS = [
|
LAST_BT_RESULT_FN = '.last_result.json'
|
||||||
'1m', '3m', '5m', '15m', '30m',
|
|
||||||
'1h', '2h', '4h', '6h', '8h', '12h',
|
USERPATH_HYPEROPTS = 'hyperopts'
|
||||||
'1d', '3d', '1w',
|
USERPATH_STRATEGIES = 'strategies'
|
||||||
]
|
USERPATH_NOTEBOOKS = 'notebooks'
|
||||||
|
|
||||||
|
TELEGRAM_SETTING_OPTIONS = ['on', 'off', 'silent']
|
||||||
|
|
||||||
|
# Soure files with destination directories within user-directory
|
||||||
|
USER_DATA_FILES = {
|
||||||
|
'sample_strategy.py': USERPATH_STRATEGIES,
|
||||||
|
'sample_hyperopt_advanced.py': USERPATH_HYPEROPTS,
|
||||||
|
'sample_hyperopt_loss.py': USERPATH_HYPEROPTS,
|
||||||
|
'sample_hyperopt.py': USERPATH_HYPEROPTS,
|
||||||
|
'strategy_analysis_example.ipynb': USERPATH_NOTEBOOKS,
|
||||||
|
}
|
||||||
|
|
||||||
SUPPORTED_FIAT = [
|
SUPPORTED_FIAT = [
|
||||||
"AUD", "BRL", "CAD", "CHF", "CLP", "CNY", "CZK", "DKK",
|
"AUD", "BRL", "CAD", "CHF", "CLP", "CNY", "CZK", "DKK",
|
||||||
"EUR", "GBP", "HKD", "HUF", "IDR", "ILS", "INR", "JPY",
|
"EUR", "GBP", "HKD", "HUF", "IDR", "ILS", "INR", "JPY",
|
||||||
"KRW", "MXN", "MYR", "NOK", "NZD", "PHP", "PKR", "PLN",
|
"KRW", "MXN", "MYR", "NOK", "NZD", "PHP", "PKR", "PLN",
|
||||||
"RUB", "SEK", "SGD", "THB", "TRY", "TWD", "ZAR", "USD",
|
"RUB", "SEK", "SGD", "THB", "TRY", "TWD", "ZAR", "USD",
|
||||||
"BTC", "XBT", "ETH", "XRP", "LTC", "BCH", "USDT"
|
"BTC", "ETH", "XRP", "LTC", "BCH"
|
||||||
]
|
]
|
||||||
|
|
||||||
MINIMAL_CONFIG = {
|
MINIMAL_CONFIG = {
|
||||||
@@ -56,17 +76,28 @@ MINIMAL_CONFIG = {
|
|||||||
CONF_SCHEMA = {
|
CONF_SCHEMA = {
|
||||||
'type': 'object',
|
'type': 'object',
|
||||||
'properties': {
|
'properties': {
|
||||||
'max_open_trades': {'type': 'integer', 'minimum': -1},
|
'max_open_trades': {'type': ['integer', 'number'], 'minimum': -1},
|
||||||
'ticker_interval': {'type': 'string', 'enum': TICKER_INTERVALS},
|
'timeframe': {'type': 'string'},
|
||||||
'stake_currency': {'type': 'string', 'enum': ['BTC', 'XBT', 'ETH', 'USDT', 'EUR', 'USD']},
|
'stake_currency': {'type': 'string'},
|
||||||
'stake_amount': {
|
'stake_amount': {
|
||||||
"type": ["number", "string"],
|
'type': ['number', 'string'],
|
||||||
"minimum": 0.0005,
|
'minimum': 0.0001,
|
||||||
"pattern": UNLIMITED_STAKE_AMOUNT
|
'pattern': UNLIMITED_STAKE_AMOUNT
|
||||||
|
},
|
||||||
|
'tradable_balance_ratio': {
|
||||||
|
'type': 'number',
|
||||||
|
'minimum': 0.1,
|
||||||
|
'maximum': 1,
|
||||||
|
'default': 0.99
|
||||||
|
},
|
||||||
|
'amend_last_stake_amount': {'type': 'boolean', 'default': False},
|
||||||
|
'last_stake_amount_min_ratio': {
|
||||||
|
'type': 'number', 'minimum': 0.0, 'maximum': 1.0, 'default': 0.5
|
||||||
},
|
},
|
||||||
'fiat_display_currency': {'type': 'string', 'enum': SUPPORTED_FIAT},
|
'fiat_display_currency': {'type': 'string', 'enum': SUPPORTED_FIAT},
|
||||||
'dry_run': {'type': 'boolean'},
|
'dry_run': {'type': 'boolean'},
|
||||||
'dry_run_wallet': {'type': 'number'},
|
'dry_run_wallet': {'type': 'number', 'default': DRY_RUN_WALLET},
|
||||||
|
'cancel_open_orders_on_exit': {'type': 'boolean', 'default': False},
|
||||||
'process_only_new_candles': {'type': 'boolean'},
|
'process_only_new_candles': {'type': 'boolean'},
|
||||||
'minimal_roi': {
|
'minimal_roi': {
|
||||||
'type': 'object',
|
'type': 'object',
|
||||||
@@ -84,8 +115,8 @@ CONF_SCHEMA = {
|
|||||||
'unfilledtimeout': {
|
'unfilledtimeout': {
|
||||||
'type': 'object',
|
'type': 'object',
|
||||||
'properties': {
|
'properties': {
|
||||||
'buy': {'type': 'number', 'minimum': 3},
|
'buy': {'type': 'number', 'minimum': 1},
|
||||||
'sell': {'type': 'number', 'minimum': 10}
|
'sell': {'type': 'number', 'minimum': 1}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'bid_strategy': {
|
'bid_strategy': {
|
||||||
@@ -96,15 +127,16 @@ CONF_SCHEMA = {
|
|||||||
'minimum': 0,
|
'minimum': 0,
|
||||||
'maximum': 1,
|
'maximum': 1,
|
||||||
'exclusiveMaximum': False,
|
'exclusiveMaximum': False,
|
||||||
'use_order_book': {'type': 'boolean'},
|
},
|
||||||
'order_book_top': {'type': 'number', 'maximum': 20, 'minimum': 1},
|
'price_side': {'type': 'string', 'enum': ORDERBOOK_SIDES, 'default': 'bid'},
|
||||||
'check_depth_of_market': {
|
'use_order_book': {'type': 'boolean'},
|
||||||
'type': 'object',
|
'order_book_top': {'type': 'integer', 'maximum': 20, 'minimum': 1},
|
||||||
'properties': {
|
'check_depth_of_market': {
|
||||||
'enabled': {'type': 'boolean'},
|
'type': 'object',
|
||||||
'bids_to_ask_delta': {'type': 'number', 'minimum': 0},
|
'properties': {
|
||||||
}
|
'enabled': {'type': 'boolean'},
|
||||||
},
|
'bids_to_ask_delta': {'type': 'number', 'minimum': 0},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'required': ['ask_last_balance']
|
'required': ['ask_last_balance']
|
||||||
@@ -112,9 +144,10 @@ CONF_SCHEMA = {
|
|||||||
'ask_strategy': {
|
'ask_strategy': {
|
||||||
'type': 'object',
|
'type': 'object',
|
||||||
'properties': {
|
'properties': {
|
||||||
|
'price_side': {'type': 'string', 'enum': ORDERBOOK_SIDES, 'default': 'ask'},
|
||||||
'use_order_book': {'type': 'boolean'},
|
'use_order_book': {'type': 'boolean'},
|
||||||
'order_book_min': {'type': 'number', 'minimum': 1},
|
'order_book_min': {'type': 'integer', 'minimum': 1},
|
||||||
'order_book_max': {'type': 'number', 'minimum': 1, 'maximum': 50},
|
'order_book_max': {'type': 'integer', 'minimum': 1, 'maximum': 50},
|
||||||
'use_sell_signal': {'type': 'boolean'},
|
'use_sell_signal': {'type': 'boolean'},
|
||||||
'sell_profit_only': {'type': 'boolean'},
|
'sell_profit_only': {'type': 'boolean'},
|
||||||
'ignore_roi_if_buy_signal': {'type': 'boolean'}
|
'ignore_roi_if_buy_signal': {'type': 'boolean'}
|
||||||
@@ -128,7 +161,9 @@ CONF_SCHEMA = {
|
|||||||
'emergencysell': {'type': 'string', 'enum': ORDERTYPE_POSSIBILITIES},
|
'emergencysell': {'type': 'string', 'enum': ORDERTYPE_POSSIBILITIES},
|
||||||
'stoploss': {'type': 'string', 'enum': ORDERTYPE_POSSIBILITIES},
|
'stoploss': {'type': 'string', 'enum': ORDERTYPE_POSSIBILITIES},
|
||||||
'stoploss_on_exchange': {'type': 'boolean'},
|
'stoploss_on_exchange': {'type': 'boolean'},
|
||||||
'stoploss_on_exchange_interval': {'type': 'number'}
|
'stoploss_on_exchange_interval': {'type': 'number'},
|
||||||
|
'stoploss_on_exchange_limit_ratio': {'type': 'number', 'minimum': 0.0,
|
||||||
|
'maximum': 1.0}
|
||||||
},
|
},
|
||||||
'required': ['buy', 'sell', 'stoploss', 'stoploss_on_exchange']
|
'required': ['buy', 'sell', 'stoploss', 'stoploss_on_exchange']
|
||||||
},
|
},
|
||||||
@@ -151,13 +186,16 @@ CONF_SCHEMA = {
|
|||||||
'block_bad_exchanges': {'type': 'boolean'}
|
'block_bad_exchanges': {'type': 'boolean'}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'pairlist': {
|
'pairlists': {
|
||||||
'type': 'object',
|
'type': 'array',
|
||||||
'properties': {
|
'items': {
|
||||||
'method': {'type': 'string', 'enum': AVAILABLE_PAIRLISTS},
|
'type': 'object',
|
||||||
'config': {'type': 'object'}
|
'properties': {
|
||||||
},
|
'method': {'type': 'string', 'enum': AVAILABLE_PAIRLISTS},
|
||||||
'required': ['method']
|
'config': {'type': 'object'}
|
||||||
|
},
|
||||||
|
'required': ['method'],
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'telegram': {
|
'telegram': {
|
||||||
'type': 'object',
|
'type': 'object',
|
||||||
@@ -165,6 +203,18 @@ CONF_SCHEMA = {
|
|||||||
'enabled': {'type': 'boolean'},
|
'enabled': {'type': 'boolean'},
|
||||||
'token': {'type': 'string'},
|
'token': {'type': 'string'},
|
||||||
'chat_id': {'type': 'string'},
|
'chat_id': {'type': 'string'},
|
||||||
|
'notification_settings': {
|
||||||
|
'type': 'object',
|
||||||
|
'properties': {
|
||||||
|
'status': {'type': 'string', 'enum': TELEGRAM_SETTING_OPTIONS},
|
||||||
|
'warning': {'type': 'string', 'enum': TELEGRAM_SETTING_OPTIONS},
|
||||||
|
'startup': {'type': 'string', 'enum': TELEGRAM_SETTING_OPTIONS},
|
||||||
|
'buy': {'type': 'string', 'enum': TELEGRAM_SETTING_OPTIONS},
|
||||||
|
'sell': {'type': 'string', 'enum': TELEGRAM_SETTING_OPTIONS},
|
||||||
|
'buy_cancel': {'type': 'string', 'enum': TELEGRAM_SETTING_OPTIONS},
|
||||||
|
'sell_cancel': {'type': 'string', 'enum': TELEGRAM_SETTING_OPTIONS}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'required': ['enabled', 'token', 'chat_id']
|
'required': ['enabled', 'token', 'chat_id']
|
||||||
},
|
},
|
||||||
@@ -173,7 +223,9 @@ CONF_SCHEMA = {
|
|||||||
'properties': {
|
'properties': {
|
||||||
'enabled': {'type': 'boolean'},
|
'enabled': {'type': 'boolean'},
|
||||||
'webhookbuy': {'type': 'object'},
|
'webhookbuy': {'type': 'object'},
|
||||||
|
'webhookbuycancel': {'type': 'object'},
|
||||||
'webhooksell': {'type': 'object'},
|
'webhooksell': {'type': 'object'},
|
||||||
|
'webhooksellcancel': {'type': 'object'},
|
||||||
'webhookstatus': {'type': 'object'},
|
'webhookstatus': {'type': 'object'},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -184,24 +236,39 @@ CONF_SCHEMA = {
|
|||||||
'listen_ip_address': {'format': 'ipv4'},
|
'listen_ip_address': {'format': 'ipv4'},
|
||||||
'listen_port': {
|
'listen_port': {
|
||||||
'type': 'integer',
|
'type': 'integer',
|
||||||
"minimum": 1024,
|
'minimum': 1024,
|
||||||
"maximum": 65535
|
'maximum': 65535
|
||||||
},
|
},
|
||||||
'username': {'type': 'string'},
|
'username': {'type': 'string'},
|
||||||
'password': {'type': 'string'},
|
'password': {'type': 'string'},
|
||||||
|
'jwt_secret_key': {'type': 'string'},
|
||||||
|
'CORS_origins': {'type': 'array', 'items': {'type': 'string'}},
|
||||||
|
'verbosity': {'type': 'string', 'enum': ['error', 'info']},
|
||||||
},
|
},
|
||||||
'required': ['enabled', 'listen_ip_address', 'listen_port', 'username', 'password']
|
'required': ['enabled', 'listen_ip_address', 'listen_port', 'username', 'password']
|
||||||
},
|
},
|
||||||
'db_url': {'type': 'string'},
|
'db_url': {'type': 'string'},
|
||||||
'initial_state': {'type': 'string', 'enum': ['running', 'stopped']},
|
'initial_state': {'type': 'string', 'enum': ['running', 'stopped']},
|
||||||
'forcebuy_enable': {'type': 'boolean'},
|
'forcebuy_enable': {'type': 'boolean'},
|
||||||
|
'disable_dataframe_checks': {'type': 'boolean'},
|
||||||
'internals': {
|
'internals': {
|
||||||
'type': 'object',
|
'type': 'object',
|
||||||
|
'default': {},
|
||||||
'properties': {
|
'properties': {
|
||||||
'process_throttle_secs': {'type': 'number'},
|
'process_throttle_secs': {'type': 'integer'},
|
||||||
'interval': {'type': 'integer'},
|
'interval': {'type': 'integer'},
|
||||||
'sd_notify': {'type': 'boolean'},
|
'sd_notify': {'type': 'boolean'},
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
'dataformat_ohlcv': {
|
||||||
|
'type': 'string',
|
||||||
|
'enum': AVAILABLE_DATAHANDLERS,
|
||||||
|
'default': 'json'
|
||||||
|
},
|
||||||
|
'dataformat_trades': {
|
||||||
|
'type': 'string',
|
||||||
|
'enum': AVAILABLE_DATAHANDLERS,
|
||||||
|
'default': 'jsongz'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'definitions': {
|
'definitions': {
|
||||||
@@ -218,7 +285,6 @@ CONF_SCHEMA = {
|
|||||||
'type': 'array',
|
'type': 'array',
|
||||||
'items': {
|
'items': {
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'pattern': '^[0-9A-Z]+/[0-9A-Z]+$'
|
|
||||||
},
|
},
|
||||||
'uniqueItems': True
|
'uniqueItems': True
|
||||||
},
|
},
|
||||||
@@ -226,7 +292,6 @@ CONF_SCHEMA = {
|
|||||||
'type': 'array',
|
'type': 'array',
|
||||||
'items': {
|
'items': {
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'pattern': '^[0-9A-Z]+/[0-9A-Z]+$'
|
|
||||||
},
|
},
|
||||||
'uniqueItems': True
|
'uniqueItems': True
|
||||||
},
|
},
|
||||||
@@ -235,37 +300,66 @@ CONF_SCHEMA = {
|
|||||||
'ccxt_config': {'type': 'object'},
|
'ccxt_config': {'type': 'object'},
|
||||||
'ccxt_async_config': {'type': 'object'}
|
'ccxt_async_config': {'type': 'object'}
|
||||||
},
|
},
|
||||||
'required': ['name', 'pair_whitelist']
|
'required': ['name']
|
||||||
},
|
},
|
||||||
'edge': {
|
'edge': {
|
||||||
'type': 'object',
|
'type': 'object',
|
||||||
'properties': {
|
'properties': {
|
||||||
"enabled": {'type': 'boolean'},
|
'enabled': {'type': 'boolean'},
|
||||||
"process_throttle_secs": {'type': 'integer', 'minimum': 600},
|
'process_throttle_secs': {'type': 'integer', 'minimum': 600},
|
||||||
"calculate_since_number_of_days": {'type': 'integer'},
|
'calculate_since_number_of_days': {'type': 'integer'},
|
||||||
"allowed_risk": {'type': 'number'},
|
'allowed_risk': {'type': 'number'},
|
||||||
"capital_available_percentage": {'type': 'number'},
|
'stoploss_range_min': {'type': 'number'},
|
||||||
"stoploss_range_min": {'type': 'number'},
|
'stoploss_range_max': {'type': 'number'},
|
||||||
"stoploss_range_max": {'type': 'number'},
|
'stoploss_range_step': {'type': 'number'},
|
||||||
"stoploss_range_step": {'type': 'number'},
|
'minimum_winrate': {'type': 'number'},
|
||||||
"minimum_winrate": {'type': 'number'},
|
'minimum_expectancy': {'type': 'number'},
|
||||||
"minimum_expectancy": {'type': 'number'},
|
'min_trade_number': {'type': 'number'},
|
||||||
"min_trade_number": {'type': 'number'},
|
'max_trade_duration_minute': {'type': 'integer'},
|
||||||
"max_trade_duration_minute": {'type': 'integer'},
|
'remove_pumps': {'type': 'boolean'}
|
||||||
"remove_pumps": {'type': 'boolean'}
|
|
||||||
},
|
},
|
||||||
'required': ['process_throttle_secs', 'allowed_risk', 'capital_available_percentage']
|
'required': ['process_throttle_secs', 'allowed_risk']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'anyOf': [
|
|
||||||
{'required': ['exchange']}
|
|
||||||
],
|
|
||||||
'required': [
|
|
||||||
'max_open_trades',
|
|
||||||
'stake_currency',
|
|
||||||
'stake_amount',
|
|
||||||
'dry_run',
|
|
||||||
'bid_strategy',
|
|
||||||
'unfilledtimeout',
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SCHEMA_TRADE_REQUIRED = [
|
||||||
|
'exchange',
|
||||||
|
'timeframe',
|
||||||
|
'max_open_trades',
|
||||||
|
'stake_currency',
|
||||||
|
'stake_amount',
|
||||||
|
'tradable_balance_ratio',
|
||||||
|
'last_stake_amount_min_ratio',
|
||||||
|
'dry_run',
|
||||||
|
'dry_run_wallet',
|
||||||
|
'ask_strategy',
|
||||||
|
'bid_strategy',
|
||||||
|
'unfilledtimeout',
|
||||||
|
'stoploss',
|
||||||
|
'minimal_roi',
|
||||||
|
'internals',
|
||||||
|
'dataformat_ohlcv',
|
||||||
|
'dataformat_trades',
|
||||||
|
]
|
||||||
|
|
||||||
|
SCHEMA_MINIMAL_REQUIRED = [
|
||||||
|
'exchange',
|
||||||
|
'dry_run',
|
||||||
|
'dataformat_ohlcv',
|
||||||
|
'dataformat_trades',
|
||||||
|
]
|
||||||
|
|
||||||
|
CANCEL_REASON = {
|
||||||
|
"TIMEOUT": "cancelled due to timeout",
|
||||||
|
"PARTIALLY_FILLED_KEEP_OPEN": "partially filled - keeping order open",
|
||||||
|
"PARTIALLY_FILLED": "partially filled",
|
||||||
|
"FULLY_CANCELLED": "fully cancelled",
|
||||||
|
"ALL_CANCELLED": "cancelled (all unfilled and partially filled open orders cancelled)",
|
||||||
|
"CANCELLED_ON_EXCHANGE": "cancelled on exchange",
|
||||||
|
"FORCE_SELL": "forcesold",
|
||||||
|
}
|
||||||
|
|
||||||
|
# List of pairs with their timeframes
|
||||||
|
PairWithTimeframe = Tuple[str, str]
|
||||||
|
ListPairsWithTimeframes = List[PairWithTimeframe]
|
||||||
|
|||||||
@@ -3,98 +3,191 @@ Helpers when analyzing backtest data
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Dict
|
from typing import Dict, Union, Tuple, Any, Optional
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import pytz
|
from datetime import timezone
|
||||||
|
|
||||||
from freqtrade import persistence
|
from freqtrade import persistence
|
||||||
|
from freqtrade.constants import LAST_BT_RESULT_FN
|
||||||
from freqtrade.misc import json_load
|
from freqtrade.misc import json_load
|
||||||
from freqtrade.persistence import Trade
|
from freqtrade.persistence import Trade
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
# must align with columns in backtest.py
|
# must align with columns in backtest.py
|
||||||
BT_DATA_COLUMNS = ["pair", "profitperc", "open_time", "close_time", "index", "duration",
|
BT_DATA_COLUMNS = ["pair", "profit_percent", "open_date", "close_date", "index", "trade_duration",
|
||||||
"open_rate", "close_rate", "open_at_end", "sell_reason"]
|
"open_rate", "close_rate", "open_at_end", "sell_reason"]
|
||||||
|
|
||||||
|
|
||||||
def load_backtest_data(filename) -> pd.DataFrame:
|
def get_latest_backtest_filename(directory: Union[Path, str]) -> str:
|
||||||
"""
|
"""
|
||||||
Load backtest data file.
|
Get latest backtest export based on '.last_result.json'.
|
||||||
:param filename: pathlib.Path object, or string pointing to the file.
|
:param directory: Directory to search for last result
|
||||||
:return: a dataframe with the analysis results
|
:return: string containing the filename of the latest backtest result
|
||||||
|
:raises: ValueError in the following cases:
|
||||||
|
* Directory does not exist
|
||||||
|
* `directory/.last_result.json` does not exist
|
||||||
|
* `directory/.last_result.json` has the wrong content
|
||||||
"""
|
"""
|
||||||
if isinstance(filename, str):
|
if isinstance(directory, str):
|
||||||
filename = Path(filename)
|
directory = Path(directory)
|
||||||
|
if not directory.is_dir():
|
||||||
|
raise ValueError(f"Directory '{directory}' does not exist.")
|
||||||
|
filename = directory / LAST_BT_RESULT_FN
|
||||||
|
|
||||||
if not filename.is_file():
|
if not filename.is_file():
|
||||||
raise ValueError(f"File {filename} does not exist.")
|
raise ValueError(
|
||||||
|
f"Directory '{directory}' does not seem to contain backtest statistics yet.")
|
||||||
|
|
||||||
with filename.open() as file:
|
with filename.open() as file:
|
||||||
data = json_load(file)
|
data = json_load(file)
|
||||||
|
|
||||||
df = pd.DataFrame(data, columns=BT_DATA_COLUMNS)
|
if 'latest_backtest' not in data:
|
||||||
|
raise ValueError(f"Invalid '{LAST_BT_RESULT_FN}' format.")
|
||||||
|
|
||||||
df['open_time'] = pd.to_datetime(df['open_time'],
|
return data['latest_backtest']
|
||||||
unit='s',
|
|
||||||
utc=True,
|
|
||||||
infer_datetime_format=True
|
def load_backtest_stats(filename: Union[Path, str]) -> Dict[str, Any]:
|
||||||
)
|
"""
|
||||||
df['close_time'] = pd.to_datetime(df['close_time'],
|
Load backtest statistics file.
|
||||||
unit='s',
|
:param filename: pathlib.Path object, or string pointing to the file.
|
||||||
utc=True,
|
:return: a dictionary containing the resulting file.
|
||||||
infer_datetime_format=True
|
"""
|
||||||
)
|
if isinstance(filename, str):
|
||||||
df['profitabs'] = df['close_rate'] - df['open_rate']
|
filename = Path(filename)
|
||||||
df = df.sort_values("open_time").reset_index(drop=True)
|
if filename.is_dir():
|
||||||
|
filename = filename / get_latest_backtest_filename(filename)
|
||||||
|
if not filename.is_file():
|
||||||
|
raise ValueError(f"File {filename} does not exist.")
|
||||||
|
logger.info(f"Loading backtest result from {filename}")
|
||||||
|
with filename.open() as file:
|
||||||
|
data = json_load(file)
|
||||||
|
|
||||||
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
def load_backtest_data(filename: Union[Path, str], strategy: Optional[str] = None) -> pd.DataFrame:
|
||||||
|
"""
|
||||||
|
Load backtest data file.
|
||||||
|
:param filename: pathlib.Path object, or string pointing to a file or directory
|
||||||
|
:param strategy: Strategy to load - mainly relevant for multi-strategy backtests
|
||||||
|
Can also serve as protection to load the correct result.
|
||||||
|
:return: a dataframe with the analysis results
|
||||||
|
:raise: ValueError if loading goes wrong.
|
||||||
|
"""
|
||||||
|
data = load_backtest_stats(filename)
|
||||||
|
if not isinstance(data, list):
|
||||||
|
# new, nested format
|
||||||
|
if 'strategy' not in data:
|
||||||
|
raise ValueError("Unknown dataformat.")
|
||||||
|
|
||||||
|
if not strategy:
|
||||||
|
if len(data['strategy']) == 1:
|
||||||
|
strategy = list(data['strategy'].keys())[0]
|
||||||
|
else:
|
||||||
|
raise ValueError("Detected backtest result with more than one strategy. "
|
||||||
|
"Please specify a strategy.")
|
||||||
|
|
||||||
|
if strategy not in data['strategy']:
|
||||||
|
raise ValueError(f"Strategy {strategy} not available in the backtest result.")
|
||||||
|
|
||||||
|
data = data['strategy'][strategy]['trades']
|
||||||
|
df = pd.DataFrame(data)
|
||||||
|
df['open_date'] = pd.to_datetime(df['open_date'],
|
||||||
|
utc=True,
|
||||||
|
infer_datetime_format=True
|
||||||
|
)
|
||||||
|
df['close_date'] = pd.to_datetime(df['close_date'],
|
||||||
|
utc=True,
|
||||||
|
infer_datetime_format=True
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
# old format - only with lists.
|
||||||
|
df = pd.DataFrame(data, columns=BT_DATA_COLUMNS)
|
||||||
|
|
||||||
|
df['open_date'] = pd.to_datetime(df['open_date'],
|
||||||
|
unit='s',
|
||||||
|
utc=True,
|
||||||
|
infer_datetime_format=True
|
||||||
|
)
|
||||||
|
df['close_date'] = pd.to_datetime(df['close_date'],
|
||||||
|
unit='s',
|
||||||
|
utc=True,
|
||||||
|
infer_datetime_format=True
|
||||||
|
)
|
||||||
|
df['profit_abs'] = df['close_rate'] - df['open_rate']
|
||||||
|
df = df.sort_values("open_date").reset_index(drop=True)
|
||||||
return df
|
return df
|
||||||
|
|
||||||
|
|
||||||
def evaluate_result_multi(results: pd.DataFrame, freq: str, max_open_trades: int) -> pd.DataFrame:
|
def analyze_trade_parallelism(results: pd.DataFrame, timeframe: str) -> pd.DataFrame:
|
||||||
"""
|
"""
|
||||||
Find overlapping trades by expanding each trade once per period it was open
|
Find overlapping trades by expanding each trade once per period it was open
|
||||||
and then counting overlaps
|
and then counting overlaps.
|
||||||
:param results: Results Dataframe - can be loaded
|
:param results: Results Dataframe - can be loaded
|
||||||
:param freq: Frequency used for the backtest
|
:param timeframe: Timeframe used for backtest
|
||||||
:param max_open_trades: parameter max_open_trades used during backtest run
|
:return: dataframe with open-counts per time-period in timeframe
|
||||||
:return: dataframe with open-counts per time-period in freq
|
|
||||||
"""
|
"""
|
||||||
dates = [pd.Series(pd.date_range(row[1].open_time, row[1].close_time, freq=freq))
|
from freqtrade.exchange import timeframe_to_minutes
|
||||||
for row in results[['open_time', 'close_time']].iterrows()]
|
timeframe_min = timeframe_to_minutes(timeframe)
|
||||||
|
dates = [pd.Series(pd.date_range(row[1]['open_date'], row[1]['close_date'],
|
||||||
|
freq=f"{timeframe_min}min"))
|
||||||
|
for row in results[['open_date', 'close_date']].iterrows()]
|
||||||
deltas = [len(x) for x in dates]
|
deltas = [len(x) for x in dates]
|
||||||
dates = pd.Series(pd.concat(dates).values, name='date')
|
dates = pd.Series(pd.concat(dates).values, name='date')
|
||||||
df2 = pd.DataFrame(np.repeat(results.values, deltas, axis=0), columns=results.columns)
|
df2 = pd.DataFrame(np.repeat(results.values, deltas, axis=0), columns=results.columns)
|
||||||
|
|
||||||
df2 = pd.concat([dates, df2], axis=1)
|
df2 = pd.concat([dates, df2], axis=1)
|
||||||
df2 = df2.set_index('date')
|
df2 = df2.set_index('date')
|
||||||
df_final = df2.resample(freq)[['pair']].count()
|
df_final = df2.resample(f"{timeframe_min}min")[['pair']].count()
|
||||||
return df_final[df_final['pair'] > max_open_trades]
|
df_final = df_final.rename({'pair': 'open_trades'}, axis=1)
|
||||||
|
return df_final
|
||||||
|
|
||||||
|
|
||||||
def load_trades_from_db(db_url: str) -> pd.DataFrame:
|
def evaluate_result_multi(results: pd.DataFrame, timeframe: str,
|
||||||
|
max_open_trades: int) -> pd.DataFrame:
|
||||||
|
"""
|
||||||
|
Find overlapping trades by expanding each trade once per period it was open
|
||||||
|
and then counting overlaps
|
||||||
|
:param results: Results Dataframe - can be loaded
|
||||||
|
:param timeframe: Frequency used for the backtest
|
||||||
|
:param max_open_trades: parameter max_open_trades used during backtest run
|
||||||
|
:return: dataframe with open-counts per time-period in freq
|
||||||
|
"""
|
||||||
|
df_final = analyze_trade_parallelism(results, timeframe)
|
||||||
|
return df_final[df_final['open_trades'] > max_open_trades]
|
||||||
|
|
||||||
|
|
||||||
|
def load_trades_from_db(db_url: str, strategy: Optional[str] = None) -> pd.DataFrame:
|
||||||
"""
|
"""
|
||||||
Load trades from a DB (using dburl)
|
Load trades from a DB (using dburl)
|
||||||
:param db_url: Sqlite url (default format sqlite:///tradesv3.dry-run.sqlite)
|
:param db_url: Sqlite url (default format sqlite:///tradesv3.dry-run.sqlite)
|
||||||
|
:param strategy: Strategy to load - mainly relevant for multi-strategy backtests
|
||||||
|
Can also serve as protection to load the correct result.
|
||||||
:return: Dataframe containing Trades
|
:return: Dataframe containing Trades
|
||||||
"""
|
"""
|
||||||
trades: pd.DataFrame = pd.DataFrame([], columns=BT_DATA_COLUMNS)
|
|
||||||
persistence.init(db_url, clean_open_orders=False)
|
persistence.init(db_url, clean_open_orders=False)
|
||||||
|
|
||||||
columns = ["pair", "open_time", "close_time", "profit", "profitperc",
|
columns = ["pair", "open_date", "close_date", "profit", "profit_percent",
|
||||||
"open_rate", "close_rate", "amount", "duration", "sell_reason",
|
"open_rate", "close_rate", "amount", "trade_duration", "sell_reason",
|
||||||
"fee_open", "fee_close", "open_rate_requested", "close_rate_requested",
|
"fee_open", "fee_close", "open_rate_requested", "close_rate_requested",
|
||||||
"stake_amount", "max_rate", "min_rate", "id", "exchange",
|
"stake_amount", "max_rate", "min_rate", "id", "exchange",
|
||||||
"stop_loss", "initial_stop_loss", "strategy", "ticker_interval"]
|
"stop_loss", "initial_stop_loss", "strategy", "timeframe"]
|
||||||
|
|
||||||
|
filters = []
|
||||||
|
if strategy:
|
||||||
|
filters.append(Trade.strategy == strategy)
|
||||||
|
|
||||||
trades = pd.DataFrame([(t.pair,
|
trades = pd.DataFrame([(t.pair,
|
||||||
t.open_date.replace(tzinfo=pytz.UTC),
|
t.open_date.replace(tzinfo=timezone.utc),
|
||||||
t.close_date.replace(tzinfo=pytz.UTC) if t.close_date else None,
|
t.close_date.replace(tzinfo=timezone.utc) if t.close_date else None,
|
||||||
t.calc_profit(), t.calc_profit_percent(),
|
t.calc_profit(), t.calc_profit_ratio(),
|
||||||
t.open_rate, t.close_rate, t.amount,
|
t.open_rate, t.close_rate, t.amount,
|
||||||
(round((t.close_date.timestamp() - t.open_date.timestamp()) / 60, 2)
|
(round((t.close_date.timestamp() - t.open_date.timestamp()) / 60, 2)
|
||||||
if t.close_date else None),
|
if t.close_date else None),
|
||||||
t.sell_reason,
|
t.sell_reason,
|
||||||
t.fee_open, t.fee_close,
|
t.fee_open, t.fee_close,
|
||||||
t.open_rate_requested,
|
t.open_rate_requested,
|
||||||
@@ -104,46 +197,84 @@ def load_trades_from_db(db_url: str) -> pd.DataFrame:
|
|||||||
t.min_rate,
|
t.min_rate,
|
||||||
t.id, t.exchange,
|
t.id, t.exchange,
|
||||||
t.stop_loss, t.initial_stop_loss,
|
t.stop_loss, t.initial_stop_loss,
|
||||||
t.strategy, t.ticker_interval
|
t.strategy, t.timeframe
|
||||||
)
|
)
|
||||||
for t in Trade.query.all()],
|
for t in Trade.get_trades(filters).all()],
|
||||||
columns=columns)
|
columns=columns)
|
||||||
|
|
||||||
return trades
|
return trades
|
||||||
|
|
||||||
|
|
||||||
def load_trades(source: str, db_url: str, exportfilename: str) -> pd.DataFrame:
|
def load_trades(source: str, db_url: str, exportfilename: Path,
|
||||||
|
no_trades: bool = False, strategy: Optional[str] = None) -> pd.DataFrame:
|
||||||
"""
|
"""
|
||||||
Based on configuration option "trade_source":
|
Based on configuration option 'trade_source':
|
||||||
* loads data from DB (using `db_url`)
|
* loads data from DB (using `db_url`)
|
||||||
* loads data from backtestfile (using `exportfilename`)
|
* loads data from backtestfile (using `exportfilename`)
|
||||||
|
:param source: "DB" or "file" - specify source to load from
|
||||||
|
:param db_url: sqlalchemy formatted url to a database
|
||||||
|
:param exportfilename: Json file generated by backtesting
|
||||||
|
:param no_trades: Skip using trades, only return backtesting data columns
|
||||||
|
:return: DataFrame containing trades
|
||||||
"""
|
"""
|
||||||
|
if no_trades:
|
||||||
|
df = pd.DataFrame(columns=BT_DATA_COLUMNS)
|
||||||
|
return df
|
||||||
|
|
||||||
if source == "DB":
|
if source == "DB":
|
||||||
return load_trades_from_db(db_url)
|
return load_trades_from_db(db_url)
|
||||||
elif source == "file":
|
elif source == "file":
|
||||||
return load_backtest_data(Path(exportfilename))
|
return load_backtest_data(exportfilename, strategy)
|
||||||
|
|
||||||
|
|
||||||
def extract_trades_of_period(dataframe: pd.DataFrame, trades: pd.DataFrame) -> pd.DataFrame:
|
def extract_trades_of_period(dataframe: pd.DataFrame, trades: pd.DataFrame,
|
||||||
|
date_index=False) -> pd.DataFrame:
|
||||||
"""
|
"""
|
||||||
Compare trades and backtested pair DataFrames to get trades performed on backtested period
|
Compare trades and backtested pair DataFrames to get trades performed on backtested period
|
||||||
:return: the DataFrame of a trades of period
|
:return: the DataFrame of a trades of period
|
||||||
"""
|
"""
|
||||||
trades = trades.loc[(trades['open_time'] >= dataframe.iloc[0]['date']) &
|
if date_index:
|
||||||
(trades['close_time'] <= dataframe.iloc[-1]['date'])]
|
trades_start = dataframe.index[0]
|
||||||
|
trades_stop = dataframe.index[-1]
|
||||||
|
else:
|
||||||
|
trades_start = dataframe.iloc[0]['date']
|
||||||
|
trades_stop = dataframe.iloc[-1]['date']
|
||||||
|
trades = trades.loc[(trades['open_date'] >= trades_start) &
|
||||||
|
(trades['close_date'] <= trades_stop)]
|
||||||
return trades
|
return trades
|
||||||
|
|
||||||
|
|
||||||
def combine_tickers_with_mean(tickers: Dict[str, pd.DataFrame], column: str = "close"):
|
def calculate_market_change(data: Dict[str, pd.DataFrame], column: str = "close") -> float:
|
||||||
|
"""
|
||||||
|
Calculate market change based on "column".
|
||||||
|
Calculation is done by taking the first non-null and the last non-null element of each column
|
||||||
|
and calculating the pctchange as "(last - first) / first".
|
||||||
|
Then the results per pair are combined as mean.
|
||||||
|
|
||||||
|
:param data: Dict of Dataframes, dict key should be pair.
|
||||||
|
:param column: Column in the original dataframes to use
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
|
tmp_means = []
|
||||||
|
for pair, df in data.items():
|
||||||
|
start = df[column].dropna().iloc[0]
|
||||||
|
end = df[column].dropna().iloc[-1]
|
||||||
|
tmp_means.append((end - start) / start)
|
||||||
|
|
||||||
|
return np.mean(tmp_means)
|
||||||
|
|
||||||
|
|
||||||
|
def combine_dataframes_with_mean(data: Dict[str, pd.DataFrame],
|
||||||
|
column: str = "close") -> pd.DataFrame:
|
||||||
"""
|
"""
|
||||||
Combine multiple dataframes "column"
|
Combine multiple dataframes "column"
|
||||||
:param tickers: Dict of Dataframes, dict key should be pair.
|
:param data: Dict of Dataframes, dict key should be pair.
|
||||||
:param column: Column in the original dataframes to use
|
:param column: Column in the original dataframes to use
|
||||||
:return: DataFrame with the column renamed to the dict key, and a column
|
:return: DataFrame with the column renamed to the dict key, and a column
|
||||||
named mean, containing the mean of all pairs.
|
named mean, containing the mean of all pairs.
|
||||||
"""
|
"""
|
||||||
df_comb = pd.concat([tickers[pair].set_index('date').rename(
|
df_comb = pd.concat([data[pair].set_index('date').rename(
|
||||||
{column: pair}, axis=1)[pair] for pair in tickers], axis=1)
|
{column: pair}, axis=1)[pair] for pair in data], axis=1)
|
||||||
|
|
||||||
df_comb['mean'] = df_comb.mean(axis=1)
|
df_comb['mean'] = df_comb.mean(axis=1)
|
||||||
|
|
||||||
@@ -155,18 +286,49 @@ def create_cum_profit(df: pd.DataFrame, trades: pd.DataFrame, col_name: str,
|
|||||||
"""
|
"""
|
||||||
Adds a column `col_name` with the cumulative profit for the given trades array.
|
Adds a column `col_name` with the cumulative profit for the given trades array.
|
||||||
:param df: DataFrame with date index
|
:param df: DataFrame with date index
|
||||||
:param trades: DataFrame containing trades (requires columns close_time and profitperc)
|
:param trades: DataFrame containing trades (requires columns close_date and profit_percent)
|
||||||
:param col_name: Column name that will be assigned the results
|
:param col_name: Column name that will be assigned the results
|
||||||
:param timeframe: Timeframe used during the operations
|
:param timeframe: Timeframe used during the operations
|
||||||
:return: Returns df with one additional column, col_name, containing the cumulative profit.
|
:return: Returns df with one additional column, col_name, containing the cumulative profit.
|
||||||
|
:raise: ValueError if trade-dataframe was found empty.
|
||||||
"""
|
"""
|
||||||
|
if len(trades) == 0:
|
||||||
|
raise ValueError("Trade dataframe empty.")
|
||||||
from freqtrade.exchange import timeframe_to_minutes
|
from freqtrade.exchange import timeframe_to_minutes
|
||||||
ticker_minutes = timeframe_to_minutes(timeframe)
|
timeframe_minutes = timeframe_to_minutes(timeframe)
|
||||||
# Resample to ticker_interval to make sure trades match candles
|
# Resample to timeframe to make sure trades match candles
|
||||||
_trades_sum = trades.resample(f'{ticker_minutes}min', on='close_time')[['profitperc']].sum()
|
_trades_sum = trades.resample(f'{timeframe_minutes}min', on='close_date'
|
||||||
|
)[['profit_percent']].sum()
|
||||||
df.loc[:, col_name] = _trades_sum.cumsum()
|
df.loc[:, col_name] = _trades_sum.cumsum()
|
||||||
# Set first value to 0
|
# Set first value to 0
|
||||||
df.loc[df.iloc[0].name, col_name] = 0
|
df.loc[df.iloc[0].name, col_name] = 0
|
||||||
# FFill to get continuous
|
# FFill to get continuous
|
||||||
df[col_name] = df[col_name].ffill()
|
df[col_name] = df[col_name].ffill()
|
||||||
return df
|
return df
|
||||||
|
|
||||||
|
|
||||||
|
def calculate_max_drawdown(trades: pd.DataFrame, *, date_col: str = 'close_date',
|
||||||
|
value_col: str = 'profit_percent'
|
||||||
|
) -> Tuple[float, pd.Timestamp, pd.Timestamp]:
|
||||||
|
"""
|
||||||
|
Calculate max drawdown and the corresponding close dates
|
||||||
|
:param trades: DataFrame containing trades (requires columns close_date and profit_percent)
|
||||||
|
:param date_col: Column in DataFrame to use for dates (defaults to 'close_date')
|
||||||
|
:param value_col: Column in DataFrame to use for values (defaults to 'profit_percent')
|
||||||
|
:return: Tuple (float, highdate, lowdate) with absolute max drawdown, high and low time
|
||||||
|
:raise: ValueError if trade-dataframe was found empty.
|
||||||
|
"""
|
||||||
|
if len(trades) == 0:
|
||||||
|
raise ValueError("Trade dataframe empty.")
|
||||||
|
profit_results = trades.sort_values(date_col).reset_index(drop=True)
|
||||||
|
max_drawdown_df = pd.DataFrame()
|
||||||
|
max_drawdown_df['cumulative'] = profit_results[value_col].cumsum()
|
||||||
|
max_drawdown_df['high_value'] = max_drawdown_df['cumulative'].cummax()
|
||||||
|
max_drawdown_df['drawdown'] = max_drawdown_df['cumulative'] - max_drawdown_df['high_value']
|
||||||
|
|
||||||
|
idxmin = max_drawdown_df['drawdown'].idxmin()
|
||||||
|
if idxmin == 0:
|
||||||
|
raise ValueError("No losing trade, therefore no drawdown.")
|
||||||
|
high_date = profit_results.loc[max_drawdown_df.iloc[:idxmin]['high_value'].idxmax(), date_col]
|
||||||
|
low_date = profit_results.loc[idxmin, date_col]
|
||||||
|
return abs(min(max_drawdown_df['drawdown'])), high_date, low_date
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user