Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
229 commits
Select commit Hold shift + click to select a range
fcb2ebe
currect log file path
donbing Jan 14, 2022
445bb43
Merge branch 'main' of https://github.com/donbing/bitbot into main
donbing Jan 14, 2022
2b688e8
import pjoin
donbing Jan 14, 2022
2f57088
setup notes and fixing config server
donbing Jan 15, 2022
908d841
correct button text value
donbing Jan 15, 2022
dca4acf
use 2DP if price < 10
donbing Jan 15, 2022
6f482d2
add tests for price humaiser
donbing Jan 15, 2022
cd91d36
correst test name
donbing Jan 15, 2022
5629d82
also format the title price
donbing Jan 15, 2022
08d2b8f
extract and test price humaiser
donbing Jan 15, 2022
34fee9b
fix tests and restore commented code
donbing Jan 15, 2022
55e2a87
correct imports and add python testing to VScode
donbing Jan 15, 2022
ffed3c5
allow config file to specify output
donbing Jan 15, 2022
1d02fbb
move logging cofnig to a file & improve code comments
donbing Jan 15, 2022
3e45848
more comment shuffling
donbing Jan 15, 2022
48176e0
log successful candle fetch
donbing Jan 15, 2022
ef2b849
log start clearly & simpler log output
donbing Jan 15, 2022
c31d794
spelling
donbing Jan 15, 2022
03ce0f7
stringify integer
donbing Jan 15, 2022
c0f6b78
log unhandles exceptions
donbing Jan 15, 2022
2f29eb8
update crontab so that we're working in the correct directory
donbing Jan 15, 2022
34cb7a7
improve log format slightly
donbing Jan 15, 2022
6bba9f2
Merge pull request #14 from donbing/logging_and_comments
donbing Jan 15, 2022
4f88041
change webserver reboot cmd
donbing Jan 15, 2022
d61a3ab
init plot for each refresh to avoid overlaps
donbing Jan 15, 2022
c0ae59a
dont wanna reboot when http get config!
donbing Jan 15, 2022
da8ce92
remove day names from month chart
donbing Jan 15, 2022
9deb056
Merge pull request #15 from donbing/date_axis_fix
donbing Jan 15, 2022
df0b76e
move tests to folder and document running them
donbing Jan 15, 2022
066cd02
run tests on push
donbing Jan 15, 2022
78c1fbd
comment out unused method
donbing Jan 15, 2022
e0356fa
remove method
donbing Jan 15, 2022
607183b
Merge pull request #16 from donbing/ci-testing
donbing Jan 15, 2022
43e6382
rename test action
donbing Jan 15, 2022
9a2c6d1
rename test file
donbing Jan 15, 2022
3f57b12
clean up test workflow
donbing Jan 15, 2022
5f4fbbe
rename workflow step
donbing Jan 15, 2022
d6b3e1a
Merge pull request #17 from donbing/testing
donbing Jan 15, 2022
9b81414
move docker scripts to folder
donbing Jan 15, 2022
643fb60
update docker build context path to match prior move
donbing Jan 15, 2022
d9bb07f
docker byuild this branch for testing
donbing Jan 15, 2022
1f620eb
update docker docs
donbing Jan 15, 2022
bc21411
correct dockerfile path to source
donbing Jan 15, 2022
e37792f
test workflow action
donbing Jan 15, 2022
20c05ff
remove to be merged branch from action
donbing Jan 15, 2022
177dfce
test that the docker image actually runs
donbing Jan 15, 2022
e52a1be
run app image in test mode in CI
donbing Jan 16, 2022
4ed4c71
update docs
donbing Jan 16, 2022
3e25982
remove default env vars as a test
donbing Jan 16, 2022
a76b0dc
restore env defaults
donbing Jan 16, 2022
5d2a5b8
put dockerignore back in context
donbing Jan 16, 2022
fc5f7b7
pass two env vars
donbing Jan 16, 2022
a1b3f66
declare ALL the envs
donbing Jan 16, 2022
4eaf81b
quote env vals
donbing Jan 16, 2022
6efb6f1
order docker args correctly
donbing Jan 16, 2022
ddc264a
note
donbing Jan 16, 2022
46b8cf0
Merge pull request #18 from donbing/project_structure
donbing Jan 16, 2022
79010fe
use 3dp when price < 1, also shrink label pad
donbing Jan 16, 2022
0f18f9a
thin axis to deal with bad colour quantie
donbing Jan 16, 2022
7a20b2f
Merge pull request #19 from donbing/more_precise_price
donbing Jan 16, 2022
7cc2ada
Create LICENSE
donbing Jan 16, 2022
afa7150
Merge pull request #20 from donbing/add-license-1
donbing Jan 16, 2022
60557f3
3dp for prices < 10
donbing Jan 16, 2022
1ff401a
fiddle with a new text overlay layout
donbing Jan 16, 2022
13f9325
Merge pull request #21 from donbing/more_precise_price
donbing Jan 16, 2022
a4b45ff
default to overlay2 for now
donbing Jan 16, 2022
c68ee17
working MPL font
donbing Jan 16, 2022
ac03be4
notes on fonts
donbing Jan 16, 2022
dd002e3
pixel font as MPL default
donbing Jan 16, 2022
a8ae92b
remove title
donbing Jan 16, 2022
daa4da2
inset ticks and remove minor locator
donbing Jan 16, 2022
1424de4
more possible title positions & config layout option
donbing Jan 16, 2022
10dd501
draw current time in bottom right
donbing Jan 16, 2022
27ed89b
extract method for percentage change
donbing Jan 16, 2022
5d1d228
add time to both layouts and resize imstrument text
donbing Jan 16, 2022
3312cd8
update ini file for layout
donbing Jan 16, 2022
057c5d1
add output type to config
donbing Jan 16, 2022
d96282a
config option to expand chart
donbing Jan 16, 2022
d35a831
restore lost config option
donbing Jan 16, 2022
815132c
config for optional border and timestamp
donbing Jan 16, 2022
551ba4b
remove leading 0 from fractional values
donbing Jan 16, 2022
193d0f9
tests
donbing Jan 16, 2022
ccdc220
adjust instrument title margin
donbing Jan 17, 2022
aef12ea
uses MPL style files instead of code
donbing Jan 17, 2022
8d7cb05
quick stlye change
donbing Jan 17, 2022
aca5bda
reformatting and doc icons
donbing Jan 17, 2022
aaeffcc
fiddle styles a slightly
donbing Jan 17, 2022
9143e1c
remove unused style val
donbing Jan 17, 2022
cb19f21
update docs a bit
donbing Jan 17, 2022
f06babe
fricken icons
donbing Jan 17, 2022
25abd52
minor tweak of docs
donbing Jan 17, 2022
41a39fd
move config files to folder
donbing Jan 17, 2022
a809457
new config folder
donbing Jan 17, 2022
081071c
Merge pull request #23 from donbing/overlay_layouts
donbing Jan 17, 2022
4e94985
hot reload on config change
donbing Jan 17, 2022
3b51d22
wait longer between hot reloads and dispose plot
donbing Jan 17, 2022
28d6ba6
reset config defaults
donbing Jan 18, 2022
ac2afa5
workaround for crap watchdog lib bugs
donbing Jan 18, 2022
9608be4
correct config file
donbing Jan 18, 2022
4337db1
remove duplicated mpl styles
donbing Jan 18, 2022
264eac4
correct docker build cmd
donbing Jan 18, 2022
390583b
short notes on styling chart
donbing Jan 18, 2022
c494aa0
update requirements to mpl 3.5.1 for font usage
donbing Jan 18, 2022
f4f429a
update docker file to bullseye and force correct numpy
donbing Jan 18, 2022
d0c9a74
Merge branch 'main' into hot_config_reload
donbing Jan 18, 2022
9326b8f
Merge pull request #24 from donbing/hot_config_reload
donbing Jan 18, 2022
fd9cbd1
restore bloody config again
donbing Jan 18, 2022
6039900
setup logger before doing anything else
donbing Jan 18, 2022
4966a7e
working dynamic fonts!
donbing Jan 18, 2022
54409e9
remove image file
donbing Jan 19, 2022
eda6eb4
Merge pull request #25 from donbing/update_matplot
donbing Jan 19, 2022
1530612
style axis better and restore minor ticks
donbing Jan 19, 2022
6029f1f
minimise docker file a bit
donbing Jan 19, 2022
e7b1e71
add multi chart feature suggestion
donbing Jan 19, 2022
ee77233
extract ccxt wrapper and move to mplfinance
donbing Jan 19, 2022
b4fa300
slap in a volume chart
donbing Jan 20, 2022
0daf53b
style volume chart
donbing Jan 20, 2022
680d83b
add missing style file
donbing Jan 20, 2022
d356e41
stlye plots to use more sceen space
donbing Jan 21, 2022
a08f3cf
config option for volume sub plot
donbing Jan 21, 2022
732f449
transparent fig not good for pillow
donbing Jan 21, 2022
05bd42d
transparency test
donbing Jan 21, 2022
6171b19
last got at trasnarency
donbing Jan 21, 2022
a097fc4
downgrade pillow to avoid transparency pallette conversion bug
donbing Jan 21, 2022
5054aa8
describe feature
donbing Jan 22, 2022
5ea9081
backlog grooming
donbing Jan 22, 2022
3660cea
quick test to crap out chart images
donbing Jan 22, 2022
19477eb
log duplicate file change detections from crap lib
donbing Jan 22, 2022
a7587c0
update readme for volume feature
donbing Jan 22, 2022
86949c4
remove whitespace
donbing Jan 22, 2022
3aa39ed
Merge pull request #26 from donbing/fancy_charts
donbing Jan 22, 2022
6f10db6
change an icon
donbing Jan 22, 2022
5564978
add style shhet files to config editor
donbing Jan 22, 2022
c789b77
update feature list
donbing Jan 22, 2022
86aeedf
check the fucker off
donbing Jan 22, 2022
f9424e2
Merge pull request #28 from donbing/editable_styles
donbing Jan 22, 2022
ddafc08
mowar icons
donbing Jan 22, 2022
7b5ab38
Merge pull request #29 from donbing/editable_styles
donbing Jan 22, 2022
2cabe51
write timezone directly to the damn formatters
donbing Jan 22, 2022
3e7f473
move methods
donbing Jan 22, 2022
f11c66e
remove dead code
donbing Jan 22, 2022
498c4d4
Merge pull request #31 from donbing/timezone_fix2
donbing Jan 22, 2022
3b9e0ce
extract class to hide config string horrors
donbing Jan 22, 2022
dfadc21
Merge pull request #32 from donbing/wrap_config
donbing Jan 22, 2022
fbba945
config objects moved to folder
donbing Jan 22, 2022
c7da479
rmeove dead code
donbing Jan 22, 2022
b11d623
simpler test run bail out
donbing Jan 22, 2022
2df9cf0
extract config observer
donbing Jan 22, 2022
747f392
complete extraction of config observer
donbing Jan 22, 2022
b62ba61
unused import
donbing Jan 22, 2022
50f76cd
separate fetch, draw and edit funcs
donbing Jan 22, 2022
a83d188
use common config file type
donbing Jan 22, 2022
3b0c852
move code into files
donbing Jan 22, 2022
81c968b
update some class names
donbing Jan 22, 2022
91202b3
kinky logs
donbing Jan 22, 2022
6d952e8
log more useful stuff
donbing Jan 22, 2022
b580972
fix tests and rename type
donbing Jan 22, 2022
b285e31
Merge pull request #33 from donbing/wrap_config
donbing Jan 22, 2022
46566c8
fix config server
donbing Jan 22, 2022
c124445
update readme
donbing Jan 23, 2022
4feac38
Merge branch 'main' of https://github.com/donbing/bitbot into main
donbing Jan 23, 2022
924059c
update feature file
donbing Jan 23, 2022
9ada225
spelling
donbing Jan 23, 2022
6cdc7a9
faff with feature file
donbing Jan 23, 2022
6ea8b9f
stocks feature desc
donbing Jan 23, 2022
1b503f3
update readme a bit
donbing Jan 23, 2022
18be7ac
done with readme
donbing Jan 23, 2022
2f51ec5
support regular stocks
donbing Jan 23, 2022
4938578
config for specifying portfolio size
donbing Jan 23, 2022
2a7c535
start making yfinance pandas fram work with mpl
donbing Jan 23, 2022
5ab63a1
5 year stock graph
donbing Jan 23, 2022
71dd453
extract methods
donbing Jan 23, 2022
274ad5f
correct params order
donbing Jan 23, 2022
cda7068
fix display usages
donbing Jan 23, 2022
d5bf052
update features list
donbing Jan 23, 2022
742f996
use crypto if no stock symbol
donbing Jan 23, 2022
6dfbf58
paramaterised tests
donbing Jan 23, 2022
7c7b750
testing
donbing Jan 23, 2022
48c1420
add feature to readme list
donbing Jan 23, 2022
ee823ab
more tests
donbing Jan 23, 2022
a12270f
meta class for tests
donbing Jan 23, 2022
5710329
approval tests eth and cro
donbing Jan 23, 2022
294bd2d
rename test
donbing Jan 23, 2022
a3f4c84
add holdings
donbing Jan 23, 2022
30e4cdb
format holdings
donbing Jan 23, 2022
974249f
readme
donbing Jan 23, 2022
7967f5c
deal with mptystring float parsing fail
donbing Jan 23, 2022
9b08cc8
disbalke tests that fail in CI
donbing Jan 23, 2022
eac6e2a
minor rename
donbing Jan 23, 2022
317843c
reduce time range for 1mo
donbing Jan 23, 2022
168b552
msft fail
donbing Jan 23, 2022
b1b3a0c
correction
donbing Jan 23, 2022
bcb78e5
enable vscode linting
donbing Jan 23, 2022
57bec04
run linter
donbing Jan 23, 2022
5aaa79d
restore missing import
donbing Jan 23, 2022
e60824b
restore test
donbing Jan 23, 2022
b26c474
remove single failing test
donbing Jan 23, 2022
9b737bf
try tesla
donbing Jan 23, 2022
9ca1fb1
lint
donbing Jan 23, 2022
d24f3ee
sigh, 1h fails on weekends!
donbing Jan 23, 2022
216f120
ignore flaky tests :(
donbing Jan 23, 2022
65de51b
Merge pull request #34 from donbing/stocks_support
donbing Jan 23, 2022
d5d1ded
add indicator todo
donbing Jan 23, 2022
99c82a7
tests exposing breakage
donbing Jan 23, 2022
7e09764
paste to correct object
donbing Jan 23, 2022
c974e6e
Merge pull request #35 from donbing/overlay2_Fix
donbing Jan 23, 2022
0cd0f13
string overrides
donbing Jan 23, 2022
aa9a33c
Update app_install.md
donbing Jan 23, 2022
07fcbe9
fixing linting warnings & add string overrides for logs
donbing Jan 23, 2022
525e9d8
tidy config file a bit too
donbing Jan 23, 2022
1a9fce5
match CI python version to local
donbing Jan 23, 2022
6764d96
extract method
donbing Jan 23, 2022
fbda003
camel case class name
donbing Jan 23, 2022
d3dda85
lintting fixes
donbing Jan 23, 2022
f8edbcd
disable tests for CI again
donbing Jan 23, 2022
e31d9bb
mark bug
donbing Jan 23, 2022
e707a0b
whitespace
donbing Jan 23, 2022
a3bdbf4
Merge pull request #36 from donbing/de_linting
donbing Jan 23, 2022
2f6e2f8
document comitup commands a bit
donbing Jan 23, 2022
568bdf9
wifi setup instructions
donbing Jan 23, 2022
3651e4e
update docs
donbing Jan 23, 2022
749a7aa
lint run.py
donbing Jan 24, 2022
4148d43
note on continual dev
donbing Jan 24, 2022
fd869d4
lint config dir
donbing Jan 24, 2022
7a24ee1
lint all the shings
donbing Jan 24, 2022
6d80e4f
lint a test
donbing Jan 24, 2022
50bde5b
dunlinting, for now
donbing Jan 24, 2022
49691fc
abuse python a little
donbing Jan 24, 2022
f8fa363
fkin whitespace
donbing Jan 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.gitmodules
docs
tests
scripts

docker-compose.yml
readme.md
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/build-and-push-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ name: Create and publish Docker image

on:
push:
branches: ['main', 'release']
branches: ['main', 'release', 'project_structure']

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TEST_TAG: donbing/bitbot:test

jobs:
build-and-push-image:
Expand Down Expand Up @@ -38,10 +39,23 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
- name: Build test image and export to Docker
uses: docker/build-push-action@v2
with:
context: .
load: true
file: scripts/docker/dockerfile
tags: ${{ env.TEST_TAG }}

- name: Run test image
run: |
docker run --rm --env TESTRUN=true --env BITBOT_OUTPUT=disk --env BITBOT_SHOWIMAGE=false ${{ env.TEST_TAG }}

- name: Build and push real Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
file: scripts/docker/dockerfile
platforms: linux/arm/v6,linux/arm/v7
push: true
tags: ${{ steps.meta.outputs.tags }}
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/lint-and-test-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Lint and test python

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9.2
uses: actions/setup-python@v2
with:
python-version: "3.9.2"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with unittest
run: |
python3 -m unittest discover -s tests -v
20 changes: 20 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Module",
"type": "python",
"request": "launch",
"module": "run",
"env" : {
"TESTRUN": "true",
"BITBOT_OUTPUT": "disk",
"BITBOT_SHOWIMAGE": "true"
},
"justMyCode": false
}
]
}
13 changes: 12 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
{
"files.exclude": {
"**/__pycache__": true
}
},
"python.testing.unittestArgs": [
"-v",
"-s",
"./tests",
"-p",
"test*.py"
],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true,
"python.linting.enabled": true,
"python.linting.flake8Enabled": true
}
Loading