Abstract layer for Forex Broker integration (already support FXCM and OANDA)
- Broker and account
- Instrument and constants
- Real-time price streaming
- History price data
- Order & trade execution
- Fix protocol trader
create database thor2; | |
create user thor2 with encrypted password 'thor2'; | |
grant all privileges on database thor2 to thor2; |
pipenv lock -r > requirements.txt | |
zip -r MyMLfunction_layer1.zip python | |
aws s3 cp MyMLfunction_layer1.zip s3://mybucket/layers/ | |
# layer 1 | |
aws lambda publish-layer-version --layer-name MyMLfunction_layer1 --content S3Bucket=mybucket,S3Key=layers/MyMLfunction_layer1.zip --compatible-runtimes python3.6 | |
# layer 2 |
#!/bin/sh | |
# see black https://github.com/python/black | |
set -e | |
if which black >/dev/null; then | |
REPO_ROOT_DIR="$(git rev-parse --show-toplevel)" | |
files=$((git diff --cached --name-only --diff-filter=ACMR | grep -Ei "\.py$") || true) |
suite = unittest.TestLoader().loadTestsFromTestCase(TestMultiplyBy5Operator) | |
unittest.TextTestRunner(verbosity=2).run(suite) |
from django.core import mail | |
connection = mail.get_connection() | |
connection.open() | |
email1 = mail.EmailMessage( | |
'That’s your subject', | |
'That’s your message body', | |
'[email protected]', |
https://stackoverflow.com/questions/56176229/quickfix-how-to-use-ssl-in-python | |
Yes, quickfix as of the time of writing does not support SSL out of the box. You will need to create a SSL tunnel from your machine manually to the host which requires SSL connectivity. You can do this via 'stunnel'. Posting some configuration below which can hopefully explain how it can be setup. | |
STUNNEL CONFIG | |
log = append | |
output = <path where logs will be written> | |
[client] |
# open port | |
firewall-cmd --zone=public --add-port=55555/tcp --permanent | |
firewall-cmd --reload | |
# remove port | |
$ firewall-cmd --zone=public --remove-port=10050/tcp | |
$ firewall-cmd --runtime-to-permanent | |
$ firewall-cmd --reload |
from datetime import datetime | |
import boto3 | |
import logging | |
from botocore.exceptions import ClientError | |
from dateutil.relativedelta import relativedelta | |
from django.conf import settings | |
from django.utils import timezone |