Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

Commit

Permalink
Add ftx to requirements.txt
Browse files Browse the repository at this point in the history
To allow django to start (useful when running in docker)

Also import transitive dependency for ftx
  see quan-digital/ftx#3
  • Loading branch information
arnaudj committed Nov 11, 2021
1 parent b952f10 commit 897cb26
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Some of the above works, some is incomplete. I ripped this code out of another p
## Either run it locally...

1. run it: ./manage.py runserver
2. go to: https://localhost:8000/wagmi/ and login.
2. go to: https://localhost:8080/wagmi/ and login.

## Or, run with docker-compose

Expand All @@ -46,7 +46,7 @@ Some of the above works, some is incomplete. I ripped this code out of another p
2.1 docker-compose -f trading-server.yml up -d
2.2 docker-compose -f trading-server.yml exec django python manage.py createsuperuser

3. go to: https://localhost:8000/wagmi/ and login.
3. go to: https://localhost:8080/wagmi/ and login.

## Contributing

Expand Down
24 changes: 24 additions & 0 deletions issues.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
AJ Server didn't start (on 8080), so I had to run this from within the django container (ssh)

pip3 install -r requirements.txt
pip3 install ciso8601 from within the container (now added to requirements.txt)


start: root@6fe72ffa1ef3:/app# /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf

TODO Solve:
TODO Read use compose in production: https://docs.docker.com/compose/production/

Docker compose should add exchanges
7. load the exchanges: ./manage.py loaddata exchanges.yaml
8. load the strategies: ./manage.py loaddata strategies.yaml

Why does trading-server.yml has "command: ./wagmi/start.sh"?
This file runs makemigration+migrate+runserver
TODO CHeck: Seems this will override the DockerFile's CMD?
ie it skips : CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
ref: https://github.com/compose-spec/compose-spec/blob/master/spec.md#command

Notes:
rebuild image: docker-compose -f trading-server.yml build --no-cache
run container: docker-compose -f trading-server.yml up -d
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ pandas_market_calendars
pyEX

psycopg2-binary

# Exchanges:
ciso8601
ftx
23 changes: 23 additions & 0 deletions testArn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#import pandas_market_calendars as mcal
# Create a calendar
#nyse = mcal.get_calendar('NYSE')
# Show available calendars
# print(mcal.get_calendar_names())

def test_vargs(arg1, *args):
print(f"arg1: {arg1}")
for a in args:
print(f"*arg: {arg1}")


test_vargs("a", "b", 2)


def test_kargs(arg1, **kwargs): # keyworded args
for k, v in kwargs.items():
print(f"{k}={v}")’


dict1 = {"k1": "v1", "k2": "v2"}
test_kargs("a", k1="v1", k2="v2")
test_kargs("a", **dict1) # unpack operator
4 changes: 3 additions & 1 deletion wagmi/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

echo "start.sh go"
python manage.py makemigrations
python manage.py migrate
python manage.py runserver 0.0.0.0:8080
python manage.py runserver 0.0.0.0:8080
echo "start.sh bye"

0 comments on commit 897cb26

Please sign in to comment.