Package Details: python-freqtrade 2024.3-2

Git Clone URL: https://aur.archlinux.org/python-freqtrade.git (read-only, click to copy)
Package Base: python-freqtrade
Description: Free, open source crypto trading bot.
Upstream URL: https://github.com/freqtrade/freqtrade
Licenses: GPL-3.0-or-later
Conflicts: python-freqtrade-git
Submitter: AchmadFathoni
Maintainer: King_DuckZ (Spixmaster)
Last Packager: Spixmaster
Votes: 2
Popularity: 0.000065
First Submitted: 2022-03-20 15:24 (UTC)
Last Updated: 2024-04-10 10:28 (UTC)

Latest Comments

« First ‹ Previous 1 2

AchmadFathoni commented on 2022-08-23 18:29 (UTC)

@King_Duckz we can identify user current shell with ps -p $$ -o exe=

King_DuckZ commented on 2022-08-19 17:47 (UTC) (edited on 2022-08-21 11:15 (UTC) by King_DuckZ)

In my case it worked after applying this patch and patching several other packages (ta-lib and python-tables that I can remember)

--- original_pkgbuild   2022-08-20 18:35:39.652744456 +0200
+++ PKGBUILD    2022-08-20 18:23:41.561505235 +0200
@@ -50,9 +50,15 @@
   'python-joblib: hyperopt'
   'python-progressbar: hyperopt'
   'python-plotly: plot'
+  'orjson: webserver'
+  'python-schedule: trade'
 )
-source=(https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz)
-sha256sums=('aca21b99ed953c8223fdb5ed640bd5842586755e322b5ecd443ff08f48d13ad5')
+source=("${url}/archive/refs/tags/${pkgver}.tar.gz"
+  "https://github.com/freqtrade/frequi/releases/download/0.4.4/freqUI.zip"
+  "freqtrade@.service")
+sha256sums=('19684c3da6b4edba2e8517d961da1ad551ca6ec37e285d475c4b3c03fed3941d'
+  '1c9a6d78f55fea855a23b4368d391f27dfb9e7f9f9c1d7413809707b005ed270'
+  '4b5501985c8872ec2658d6f7a08009efbbe043c32ea38f2b3722b0bb38c81286')

 build() {
   cd ${srcdir}/${_pkgname}-${pkgver}
@@ -63,4 +69,11 @@
   cd ${srcdir}/${_pkgname}-${pkgver}
   python -m installer --destdir="$pkgdir" dist/*.whl
   rm -rf "$pkgdir"/usr/lib/python*/site-packages/tests
+  install -dm755 "${pkgdir}/usr/lib/python3.10/site-packages/freqtrade/rpc/api_server/ui/installed"
+
+  cd ${srcdir}
+  install -Dm644 "freqtrade@.service" "${pkgdir}/usr/lib/systemd/system/freqtrade@.service"
+  rsync -r assets "${pkgdir}/usr/lib/python3.10/site-packages/freqtrade/rpc/api_server/ui/installed/"
+  install -Dm644 index.html "${pkgdir}/usr/lib/python3.10/site-packages/freqtrade/rpc/api_server/ui/installed/"
+  install -Dm644 favicon.ico "${pkgdir}/usr/lib/python3.10/site-packages/freqtrade/rpc/api_server/ui/installed/"
 }

My patch also downloads the source code from the same url given in the url parameter, I'm not sure why there was a different address in the source parameter.

Comment edited with the new patch that in addition also downloads and installs the freqUI so users don't have to run the freqtrade install-ui command manually, which requires root permissions. Also added a systemd service file:

[Unit]
Description=Freqtrade bot for user %I
After=network.target

[Service]
User=%i
Group=%i
ExecStart=/usr/bin/freqtrade trade --config /home/%i/.config/freqtrade/config.json --userdir /home/%i/.config/freqtrade --strategy %i_strategy
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
WorkingDirectory=/home/%i/.config/freqtrade
ReadWritePaths=/home/%i/.config/freqtrade

ProtectSystem=full
PrivateTmp=true

[Install]
WantedBy=multi-user.target

Not sure about the ExecReload part but anyone reading this please post improvements if you make any.

Prior to starting the service above you'll have to run this for your user (yeah, the cli is very awkward):

freqtrade create-userdir --userdir ~/.config/freqtrade
freqtrade new-config --config ~/.config/freqtrade/config.json
freqtrade new-strategy --userdir ~/.config/freqtrade --stategy ${USER}_strategy

or {$USER}_strategy if you use fish. Given that this is per-user, I don't think it can be automated by the pkgbuild unfortunately.

AchmadFathoni commented on 2022-03-21 03:17 (UTC)

Need co-maintainer for faster development response.