diff --git a/VERSION b/VERSION index fc2f5a4..03acb5b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.1,relative liquidity loads via http \ No newline at end of file +0.2.2,relative liquidity loads via http \ No newline at end of file diff --git a/__TBD__/buildx.sh b/__TBD__/buildx.sh deleted file mode 100755 index 8cb5765..0000000 --- a/__TBD__/buildx.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -echo "Script $0 does not work yet. Aborted" && exit - -function usage { - echo "Usage: ${0} " - exit -} - -AppPath=${1} -CvttpyVersion=${2} - -if [ "${AppPath}" == "" ] -then - usage -fi - -# --- Settings -DockerDir=$(realpath $(dirname ${0})/${AppPath}) -RootDir=$(realpath $(dirname ${0})/..) -RegistryService=cloud21.cvtt.vpn:5500 - -AppName=$(basename ${AppPath}) - -ImageName=${AppName} -ImageDir=${HOME}/docker_images -mkdir -p ${ImageDir} - -Version=$(cat ${RootDir}/cvttpy/VERSION | awk -F, '{print $1}') - -cd ${RootDir} - -# Create a new builder instance -Cmd="docker buildx create --name ${AppName}_builder" -echo ${Cmd} -eval ${Cmd} || exit - -# Switch to the newly created builder -Cmd="docker buildx use ${AppName}_builder" -echo ${Cmd} -eval ${Cmd} - -# Ensure buildx is bootstrapped -Cmd="docker buildx inspect ${AppName}_builder --bootstrap" -echo ${Cmd} -eval ${Cmd} - -# Build the image using buildx, tagging with both 'latest' and the version number, and pushing directly -Cmd="docker buildx build --platform linux/amd64,linux/arm64 -t ${ImageName}:latest -t ${ImageName}:${Version} -f ${DockerDir}/Dockerfile . --push" -echo ${Cmd} -eval ${Cmd} - -# Tagging the images with the registry -Cmd="docker tag ${ImageName}:latest ${RegistryService}/${ImageName}:latest" -echo ${Cmd} -eval ${Cmd} - -Cmd="docker tag ${ImageName}:${Version} ${RegistryService}/${ImageName}:${Version}" -echo ${Cmd} -eval ${Cmd} - -# Push the images to the registry -Cmd="docker push ${RegistryService}/${ImageName}:latest" -echo ${Cmd} -eval ${Cmd} - -Cmd="docker push ${RegistryService}/${ImageName}:${Version}" -echo ${Cmd} -eval ${Cmd} - -# Optionally, remove the builder to clean up -Cmd="docker buildx rm ${AppName}_builder" -echo ${Cmd} -eval ${Cmd} diff --git a/market_data/relative_liquidity/.creds b/market_data/relative_liquidity/.creds new file mode 100644 index 0000000..e59da35 --- /dev/null +++ b/market_data/relative_liquidity/.creds @@ -0,0 +1,10 @@ +{ + "__dummy": null + , "INFISICAL": { + "url": "https://infisical.cvtt.net" + , "client_id": "e330a1c4-08dc-452f-ac02-5b37fff4ab3e" + , "client_secret": "190554828c3c342f63517320ac029f822b6358aa6187aec266465d0bde4d6b3c" + , "workspace_id": "6923c950-8473-4cec-818f-10df41d8b39c" + , "environment": "dev" + } +} diff --git a/market_data/relative_liquidity/Dockerfile b/market_data/relative_liquidity/Dockerfile index a3cfca4..354bfda 100644 --- a/market_data/relative_liquidity/Dockerfile +++ b/market_data/relative_liquidity/Dockerfile @@ -1,7 +1,10 @@ FROM python:3.12-slim +ARG FROM_DIR=docker_dev/market_data/relative_liquidity WORKDIR / -COPY docker_dev/market_data/relative_liquidity/requirements.txt /requirements.txt +COPY ${FROM_DIR}/.creds /.creds +COPY ${FROM_DIR}/requirements.txt /requirements.txt + RUN pip install --upgrade pip --root-user-action=ignore RUN pip install -r /requirements.txt --root-user-action=ignore @@ -16,7 +19,8 @@ CMD [ \ "python3.12", \ "cvttpy/apps/md/rel_lqdt_server.py", \ "--config=http://cloud16.cvtt.vpn:6789/apps/minimal_md_eqt", \ + "--credentials_file=/.creds", \ "--port=5678", \ "--db_file=/app/data/rel_liquidity.db", \ - "--log_file=/logs/%T.REL_LIQUIDITY_SVC.log" \ + "--log_file=/logs/%D.REL_LIQUIDITY_SVC.log" \ ] diff --git a/trading.__DEPRECATED__/executor/.dockerignore b/trading.__DEPRECATED__/executor/.dockerignore deleted file mode 100644 index a4f7c14..0000000 --- a/trading.__DEPRECATED__/executor/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.git -**/__pycache__ -.pipenv \ No newline at end of file diff --git a/trading.__DEPRECATED__/executor/Dockerfile b/trading.__DEPRECATED__/executor/Dockerfile deleted file mode 100644 index 0c0a934..0000000 --- a/trading.__DEPRECATED__/executor/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM python:3.12-slim - - -ARG FROM_DIR=docker_dev/trading/executor - -COPY ${FROM_DIR}/requirements.txt / -RUN pip install --upgrade pip --root-user-action=ignore -RUN pip install -r /requirements.txt --root-user-action=ignore - -COPY cvttpy /cvttpy -COPY ${FROM_DIR}/.creds /.creds - - -COPY ${FROM_DIR}/run_executor.sh /run_executor.sh -RUN chmod +x /run_executor.sh - -RUN mkdir /logs - -WORKDIR / -SHELL ["/bin/bash", "-c"] -ENV PYTHONPATH=/ -ENTRYPOINT [ "/run_executor.sh" ] - - diff --git a/trading.__DEPRECATED__/executor/requirements.txt b/trading.__DEPRECATED__/executor/requirements.txt deleted file mode 100644 index 9f986eb..0000000 --- a/trading.__DEPRECATED__/executor/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -aiohttp>=3.7.4.post0 -redis>=5.0.8 -nest-asyncio>=1.5.5 -hjson>=3.1.0 -sortedcontainers>=2.4.0 -pandas>=1.5.3 diff --git a/trading.__DEPRECATED__/executor/run_executor.sh b/trading.__DEPRECATED__/executor/run_executor.sh deleted file mode 100755 index ec3f20b..0000000 --- a/trading.__DEPRECATED__/executor/run_executor.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash - -# runs in container - - -# runs on host to start container -usage() { - echo -n "Usage: $0" - echo -n " [-c ]" - echo -n " [-e ]" - echo -n " [-a "] - echo -n " [-z (compress log)"] - echo - exit 1 -} - -Config=http://cloud16.cvtt.vpn:6789/apps/cvtt_eqt_alpaca -ActiveExchanges=ALPACA_SNDBX -AdminPort=7222 -COMPRESS_LOG=false - -while getopts "c:e:a:z" opt; do - case ${opt} in - c ) Config=$OPTARG ;; - e ) ActiveExchanges=$OPTARG ;; - a ) AdminPort=$OPTARG ;; - z ) COMPRESS_LOG=true ;; - \? ) - echo "Invalid option: -$OPTARG" >&2 - usage - ;; - : ) - echo "Option -$OPTARG requires an argument." >&2 - usage - ;; - esac -done - -Cmd="python3.12" -Cmd="${Cmd} /cvttpy/apps/executor_app.py" -Cmd="${Cmd} --config=${Config}" -Cmd="${Cmd} --credentials_file=/.creds" -# Cmd="${Cmd} --allow_dynamic_exch_inst" -Cmd="${Cmd} --active_exchanges=${ActiveExchanges}" -Cmd="${Cmd} --admin_port=${AdminPort}" -Cmd="${Cmd} --log_file=/logs/%T.EXECUTOR_APP.log" -if ${COMPRESS_LOG}; then - Cmd="${Cmd} --compress_log" -fi -echo ${Cmd} -eval ${Cmd} - - diff --git a/trading.__DEPRECATED__/md_portal/.dockerignore b/trading.__DEPRECATED__/md_portal/.dockerignore deleted file mode 100644 index a4f7c14..0000000 --- a/trading.__DEPRECATED__/md_portal/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.git -**/__pycache__ -.pipenv \ No newline at end of file diff --git a/trading.__DEPRECATED__/md_portal/Dockerfile b/trading.__DEPRECATED__/md_portal/Dockerfile deleted file mode 100644 index 4405008..0000000 --- a/trading.__DEPRECATED__/md_portal/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM python:3.12-slim - -ARG FROM_DIR=docker_dev/trading/md_portal - -COPY ${FROM_DIR}/requirements.txt / -RUN pip install --upgrade pip --root-user-action=ignore -RUN pip install -r /requirements.txt --root-user-action=ignore - -COPY cvttpy /cvttpy -COPY ${FROM_DIR}/.creds /.creds - - -COPY ${FROM_DIR}/run_md_portal.sh /run_md_portal.sh -RUN chmod +x /run_md_portal.sh - -RUN mkdir /logs - - -WORKDIR / -SHELL ["/bin/bash", "-c"] -ENV PYTHONPATH=/ -ENTRYPOINT [ "/run_md_portal.sh" ] - diff --git a/trading.__DEPRECATED__/md_portal/requirements.txt b/trading.__DEPRECATED__/md_portal/requirements.txt deleted file mode 100644 index 852e647..0000000 --- a/trading.__DEPRECATED__/md_portal/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -aiohttp>=3.7.4.post0 -nest-asyncio>=1.5.5 -hjson>=3.1.0 -sortedcontainers>=2.4.0 -redis>=5.0.8 -python-dateutil>=2.8.2 -types-python-dateutil>=2.8.19.6 diff --git a/trading.__DEPRECATED__/md_portal/run_md_portal.sh b/trading.__DEPRECATED__/md_portal/run_md_portal.sh deleted file mode 100755 index e886adc..0000000 --- a/trading.__DEPRECATED__/md_portal/run_md_portal.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -# runs in container - -# runs on host to start container -usage() { - echo -n "Usage: ${0}" - echo -n " [-c ]" - echo -n " [-e ]" - echo -n " [-a ]" - echo -n " [-n ]" - echo -n " [-z (compress log)"] - echo - exit 1 -} - -Config=http://cloud16.cvtt.vpn:6789/apps/cvtt_eqt_alpaca -ActiveExchanges=ALPACA_SNDBX -PortalName=MD_PORTAL_ALPACA_SNDBX -AdminPort=7220 -COMPRESS_LOG=false - - -while getopts "c:e:a:n:z" opt; do - case ${opt} in - c ) Config=$OPTARG ;; - e ) ActiveExchanges=$OPTARG ;; - a ) AdminPort=$OPTARG ;; - z ) COMPRESS_LOG=true ;; - n ) PortalName=$OPTARG ;; - \? ) - echo "Invalid option: -$OPTARG" >&2 - usage - ;; - : ) - echo "Option -$OPTARG requires an argument." >&2 - usage - ;; - esac -done - -Cmd="python3.12" -Cmd="${Cmd} cvttpy/apps/md/md_portal.py" -Cmd="${Cmd} --config=${Config}" -Cmd="${Cmd} --credentials_file=/.creds" -Cmd="${Cmd} --active_exchanges=${ActiveExchanges}" -Cmd="${Cmd} --portal_name=${PortalName}" -Cmd="${Cmd} --admin_port=${AdminPort}" -Cmd="${Cmd} --log_file=/logs/%T.${PortalName}.log" -if ${COMPRESS_LOG}; then - Cmd="${Cmd} --compress_log" -fi -echo ${Cmd} -eval ${Cmd} - - diff --git a/trading.__DEPRECATED__/quant/.dockerignore b/trading.__DEPRECATED__/quant/.dockerignore deleted file mode 100644 index a4f7c14..0000000 --- a/trading.__DEPRECATED__/quant/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.git -**/__pycache__ -.pipenv \ No newline at end of file diff --git a/trading.__DEPRECATED__/quant/Dockerfile b/trading.__DEPRECATED__/quant/Dockerfile deleted file mode 100644 index 2598cbe..0000000 --- a/trading.__DEPRECATED__/quant/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM python:3.12-slim - - -ARG FROM_DIR=docker_dev/trading/quant - -COPY ${FROM_DIR}/requirements.txt / -RUN pip install --upgrade pip --root-user-action=ignore -RUN pip install -r /requirements.txt --root-user-action=ignore - -COPY cvttpy /cvttpy -COPY ${FROM_DIR}/.creds /.creds - - -COPY ${FROM_DIR}/run_quant.sh /run_quant.sh -RUN chmod +x /run_quant.sh - -RUN mkdir /logs - -WORKDIR / -SHELL ["/bin/bash", "-c"] -ENV PYTHONPATH=/ -ENTRYPOINT [ "/run_quant.sh" ] - - diff --git a/trading.__DEPRECATED__/quant/requirements.txt b/trading.__DEPRECATED__/quant/requirements.txt deleted file mode 100644 index c53b7e9..0000000 --- a/trading.__DEPRECATED__/quant/requirements.txt +++ /dev/null @@ -1,11 +0,0 @@ -aiohttp>=3.7.4.post0 -nest-asyncio>=1.5.5 -hjson>=3.1.0 -sortedcontainers>=2.4.0 -pandas>=1.5.3 -# -ta>=0.10.2 -tables>=3.9.1 -psycopg>=3.2.1 -# -redis>=5.0.8 diff --git a/trading.__DEPRECATED__/quant/run_quant.sh b/trading.__DEPRECATED__/quant/run_quant.sh deleted file mode 100755 index 4f0fabe..0000000 --- a/trading.__DEPRECATED__/quant/run_quant.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash - -# runs on host to start container -usage() { - echo -n "Usage: $0" - echo -n " -b " - - echo -n " -S (dflt: TRDALGO_001)" - - echo -n " [-c ]" - echo -n " [-e ]" - echo -n " [-a "] - echo -n " [-z (compress log)"] - echo - exit 1 -} - -Config=http://cloud16.cvtt.vpn:6789/apps/cvtt_eqt_alpaca -ActiveExchanges=ALPACA_SNDBX-MDPORTAL -AdminPort=7224 -Strategy=DAILY_STOCK_001 -Book="" -COMPRESS_LOG=false - - -while getopts "b:c:e:a:S:z" opt; do - case ${opt} in - c ) Config=$OPTARG ;; - e ) ActiveExchanges=$OPTARG ;; - a ) AdminPort=$OPTARG ;; - z ) COMPRESS_LOG=true ;; - b ) Book=$OPTARG ;; - S ) Strategy=$OPTARG ;; - \? ) - echo "Invalid option: -$OPTARG" >&2 - usage - ;; - : ) - echo "Option -$OPTARG requires an argument." >&2 - usage - ;; - esac -done - -if [ "${Book}" == "" ]; then - echo "Book is missing" - usage -fi - -Cmd="python3.12" -Cmd="${Cmd} cvttpy/apps/quant_app.py" -Cmd="${Cmd} --config=${Config}" -Cmd="${Cmd} --credentials_file=/.creds" -Cmd="${Cmd} --book=${Book}" -Cmd="${Cmd} --strategy=${Strategy}" -# Cmd="${Cmd} --allow_dynamic_exch_inst" -Cmd="${Cmd} --active_exchanges=${ActiveExchanges}" -Cmd="${Cmd} --admin_port=${AdminPort}" -Cmd="${Cmd} --log_file=/logs/%T.QUANT.${Book}.log" -if ${COMPRESS_LOG}; then - Cmd="${Cmd} --compress_log" -fi -echo ${Cmd} -eval ${Cmd} - - diff --git a/trading.__DEPRECATED__/risk_mgr/.dockerignore b/trading.__DEPRECATED__/risk_mgr/.dockerignore deleted file mode 100644 index a4f7c14..0000000 --- a/trading.__DEPRECATED__/risk_mgr/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.git -**/__pycache__ -.pipenv \ No newline at end of file diff --git a/trading.__DEPRECATED__/risk_mgr/Dockerfile b/trading.__DEPRECATED__/risk_mgr/Dockerfile deleted file mode 100644 index 234897c..0000000 --- a/trading.__DEPRECATED__/risk_mgr/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM python:3.12-slim - -ARG FROM_DIR=docker_dev/trading/risk_mgr - -COPY ${FROM_DIR}/requirements.txt / -RUN pip install --upgrade pip --root-user-action=ignore -RUN pip install -r /requirements.txt --root-user-action=ignore - -COPY cvttpy /cvttpy -COPY ${FROM_DIR}/.creds /.creds - - -COPY ${FROM_DIR}/run_risk_mgr.sh /run_risk_mgr.sh -RUN chmod +x /run_risk_mgr.sh - -RUN mkdir /logs - - -WORKDIR / -SHELL ["/bin/bash", "-c"] -ENV PYTHONPATH=/ -ENTRYPOINT [ "/run_risk_mgr.sh" ] - diff --git a/trading.__DEPRECATED__/risk_mgr/requirements.txt b/trading.__DEPRECATED__/risk_mgr/requirements.txt deleted file mode 100644 index 34d80a4..0000000 --- a/trading.__DEPRECATED__/risk_mgr/requirements.txt +++ /dev/null @@ -1,15 +0,0 @@ -aiohttp>=3.7.4.post0 -nest-asyncio>=1.5.5 -hjson>=3.1.0 -sortedcontainers>=2.4.0 -pandas>=1.5.3 -# -redis>=5.0.8 -# -python-dateutil>=2.8.2 -types-python-dateutil>=2.8.19.6 -# -psycopg>=3.2.1 -psycopg-binary>=3.2.1 -psycopg2-binary>=2.9.6 - diff --git a/trading.__DEPRECATED__/risk_mgr/run_risk_mgr.sh b/trading.__DEPRECATED__/risk_mgr/run_risk_mgr.sh deleted file mode 100755 index 5f33b13..0000000 --- a/trading.__DEPRECATED__/risk_mgr/run_risk_mgr.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - -# runs in container - -# runs on host to start container -usage() { - echo -n "Usage: $0" - echo -n " -b " - echo -n " [-c ]" - echo -n " [-e ]" - echo -n " [-a "] - echo -n " [-z (compress log)"] - echo - exit 1 -} - - - -Config=http://cloud16.cvtt.vpn:6789/apps/cvtt_eqt_alpaca -ActiveExchanges=ALPACA_SNDBX-MDPORTAL -AdminPort=7223 -Book="" -COMPRESS_LOG=false - - -while getopts "b:c:e:a:z" opt; do - case ${opt} in - c ) Config=$OPTARG ;; - e ) ActiveExchanges=$OPTARG ;; - a ) AdminPort=$OPTARG ;; - z ) COMPRESS_LOG=true ;; - b ) Book=$OPTARG ;; - \? ) - echo "Invalid option: -$OPTARG" >&2 - usage - ;; - : ) - echo "Option -$OPTARG requires an argument." >&2 - usage - ;; - esac -done - -if [ "${Book}" == "" ]; then - echo "Book is missing" - usage -fi - -Cmd="python3.12" -Cmd="${Cmd} cvttpy/apps/risk_manager_app.py" -Cmd="${Cmd} --config=${Config}" -Cmd="${Cmd} --credentials_file=/.creds" -Cmd="${Cmd} --book=${Book}" -# Cmd="${Cmd} --allow_dynamic_exch_inst" -Cmd="${Cmd} --active_exchanges=${ActiveExchanges}" -Cmd="${Cmd} --admin_port=${AdminPort}" -Cmd="${Cmd} --log_file=/logs/%T.RISK_MGR.${Book}.log" -if ${COMPRESS_LOG}; then - Cmd="${Cmd} --compress_log" -fi -echo ${Cmd} -eval ${Cmd} - - diff --git a/trading.__DEPRECATED__/service_checker/Dockerfile b/trading.__DEPRECATED__/service_checker/Dockerfile deleted file mode 100644 index e6850df..0000000 --- a/trading.__DEPRECATED__/service_checker/Dockerfile +++ /dev/null @@ -1,26 +0,0 @@ -FROM python:3.12-slim - -ARG FROM_DIR=docker_dev/trading/service_checker - -RUN apt-get update && apt-get install -y telnet redis-tools - - -COPY ${FROM_DIR}/requirements.txt / -RUN pip install --upgrade pip --root-user-action=ignore -RUN pip install -r /requirements.txt --root-user-action=ignore - -COPY cvttpy /cvttpy -COPY ${FROM_DIR}/.creds /.creds - - -COPY ${FROM_DIR}/run_svc_checker.sh /run_svc_checker.sh -RUN chmod +x /run_svc_checker.sh - -# RUN mkdir /logs - -WORKDIR / -SHELL ["/bin/bash", "-c"] -ENV PYTHONPATH=/ -ENTRYPOINT [ "/run_svc_checker.sh" ] -# ENTRYPOINT [ "/usr/bin/bash" ] - diff --git a/trading.__DEPRECATED__/service_checker/requirements.txt b/trading.__DEPRECATED__/service_checker/requirements.txt deleted file mode 100644 index 852e647..0000000 --- a/trading.__DEPRECATED__/service_checker/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -aiohttp>=3.7.4.post0 -nest-asyncio>=1.5.5 -hjson>=3.1.0 -sortedcontainers>=2.4.0 -redis>=5.0.8 -python-dateutil>=2.8.2 -types-python-dateutil>=2.8.19.6 diff --git a/trading.__DEPRECATED__/service_checker/run_svc_checker.sh b/trading.__DEPRECATED__/service_checker/run_svc_checker.sh deleted file mode 100755 index 7729490..0000000 --- a/trading.__DEPRECATED__/service_checker/run_svc_checker.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -# runs in container - -# runs on host to start container -usage() { - echo -n "Usage: ${0}" - echo -n " [-c ]" - echo - exit 1 -} - -Config=http://cloud16.cvtt.vpn:6789/apps/cvtt_eqt_alpaca - - -while getopts ":c:" opt; do - case ${opt} in - c ) - Config=$OPTARG - ;; - \? ) - echo "Invalid option: -$OPTARG" >&2 - usage - ;; - : ) - echo "Option -$OPTARG requires an argument." >&2 - usage - ;; - esac -done - - -Cmd="python3.12" -Cmd="${Cmd} cvttpy/apps/utils/services_checker.py" -Cmd="${Cmd} --config=${Config}" -Cmd="${Cmd} --credentials_file=/.creds" -Cmd="${Cmd} --log_level=ERROR" - -echo ${Cmd} -eval ${Cmd} - diff --git a/trading.__DEPRECATED__/trader/.dockerignore b/trading.__DEPRECATED__/trader/.dockerignore deleted file mode 100644 index a4f7c14..0000000 --- a/trading.__DEPRECATED__/trader/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.git -**/__pycache__ -.pipenv \ No newline at end of file diff --git a/trading.__DEPRECATED__/trader/Dockerfile b/trading.__DEPRECATED__/trader/Dockerfile deleted file mode 100644 index 4ec7f14..0000000 --- a/trading.__DEPRECATED__/trader/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM python:3.12-slim - - -ARG FROM_DIR=docker_dev/trading/trader - -COPY ${FROM_DIR}/requirements.txt / -RUN pip install --upgrade pip --root-user-action=ignore -RUN pip install -r /requirements.txt --root-user-action=ignore - -COPY cvttpy /cvttpy -COPY ${FROM_DIR}/.creds /.creds - - -COPY ${FROM_DIR}/run_trader.sh /run_trader.sh -RUN chmod +x /run_trader.sh - -RUN mkdir /logs - -WORKDIR / -SHELL ["/bin/bash", "-c"] -ENV PYTHONPATH=/ -ENTRYPOINT [ "/run_trader.sh" ] - - diff --git a/trading.__DEPRECATED__/trader/requirements.txt b/trading.__DEPRECATED__/trader/requirements.txt deleted file mode 100644 index 9f986eb..0000000 --- a/trading.__DEPRECATED__/trader/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -aiohttp>=3.7.4.post0 -redis>=5.0.8 -nest-asyncio>=1.5.5 -hjson>=3.1.0 -sortedcontainers>=2.4.0 -pandas>=1.5.3 diff --git a/trading.__DEPRECATED__/trader/run_trader.sh b/trading.__DEPRECATED__/trader/run_trader.sh deleted file mode 100755 index 4827ae8..0000000 --- a/trading.__DEPRECATED__/trader/run_trader.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -# runs in container -# -------------------------------------------------------------------------- - -# runs on host to start container -usage() { - echo -n "Usage: $0" - echo -n " -b " - - echo -n " -A (dflt: TRDALGO_001)" - - echo -n " [-c ]" - echo -n " [-e ]" - echo -n " [-a "] - echo -n " [-z (compress log)"] - echo - exit 1 -} - - - -Config=http://cloud16.cvtt.vpn:6789/apps/cvtt_eqt_alpaca -ActiveExchanges=ALPACA_SNDBX-MDPORTAL -AdminPort=7226 -Algo=TRDALGO_001 -Book="" -COMPRESS_LOG=false - - -while getopts "b:c:e:a:A:z" opt; do - case ${opt} in - c ) Config=$OPTARG ;; - e ) ActiveExchanges=$OPTARG ;; - a ) AdminPort=$OPTARG ;; - z ) COMPRESS_LOG=true ;; - b ) Book=$OPTARG ;; - A ) Algo=$OPTARG ;; - \? ) - echo "Invalid option: -$OPTARG" >&2 - usage - ;; - : ) - echo "Option -$OPTARG requires an argument." >&2 - usage - ;; - esac -done - -if [ "${Book}" == "" ]; then - echo "Book is missing" - usage -fi - -Cmd="python3.12" -Cmd="${Cmd} cvttpy/apps/trader_app.py" -Cmd="${Cmd} --config=${Config}" -Cmd="${Cmd} --credentials_file=/.creds" -Cmd="${Cmd} --book=${Book}" -Cmd="${Cmd} --algo=${Algo}" -# Cmd="${Cmd} --allow_dynamic_exch_inst" -Cmd="${Cmd} --active_exchanges=${ActiveExchanges}" -Cmd="${Cmd} --admin_port=${AdminPort}" -Cmd="${Cmd} --log_file=/logs/%T.TRADER.${Book}.log" -if ${COMPRESS_LOG}; then - Cmd="${Cmd} --compress_log" -fi -echo ${Cmd} -eval ${Cmd} - - diff --git a/trading.__DEPRECATED__/trading_recorder/.dockerignore b/trading.__DEPRECATED__/trading_recorder/.dockerignore deleted file mode 100644 index a4f7c14..0000000 --- a/trading.__DEPRECATED__/trading_recorder/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.git -**/__pycache__ -.pipenv \ No newline at end of file diff --git a/trading.__DEPRECATED__/trading_recorder/Dockerfile b/trading.__DEPRECATED__/trading_recorder/Dockerfile deleted file mode 100644 index 8ca6efa..0000000 --- a/trading.__DEPRECATED__/trading_recorder/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM python:3.12-slim - -ARG FROM_DIR=docker_dev/trading/trading_recorder - -COPY ${FROM_DIR}/requirements.txt / -RUN pip install --upgrade pip --root-user-action=ignore -RUN pip install -r /requirements.txt --root-user-action=ignore - -COPY cvttpy /cvttpy -COPY ${FROM_DIR}/.creds /.creds - - -COPY ${FROM_DIR}/run_trading_recorder.sh /run_trading_recorder.sh -RUN chmod +x /run_trading_recorder.sh - -RUN mkdir /logs - - -WORKDIR / -SHELL ["/bin/bash", "-c"] -ENV PYTHONPATH=/ -ENTRYPOINT [ "/run_trading_recorder.sh" ] - diff --git a/trading.__DEPRECATED__/trading_recorder/requirements.txt b/trading.__DEPRECATED__/trading_recorder/requirements.txt deleted file mode 100644 index 34d80a4..0000000 --- a/trading.__DEPRECATED__/trading_recorder/requirements.txt +++ /dev/null @@ -1,15 +0,0 @@ -aiohttp>=3.7.4.post0 -nest-asyncio>=1.5.5 -hjson>=3.1.0 -sortedcontainers>=2.4.0 -pandas>=1.5.3 -# -redis>=5.0.8 -# -python-dateutil>=2.8.2 -types-python-dateutil>=2.8.19.6 -# -psycopg>=3.2.1 -psycopg-binary>=3.2.1 -psycopg2-binary>=2.9.6 - diff --git a/trading.__DEPRECATED__/trading_recorder/run_trading_recorder.sh b/trading.__DEPRECATED__/trading_recorder/run_trading_recorder.sh deleted file mode 100755 index ca70b60..0000000 --- a/trading.__DEPRECATED__/trading_recorder/run_trading_recorder.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - - - -# runs on host to start container -usage() { - echo -n "Usage: $0" - echo -n " -b " - echo -n " [-c ]" - echo -n " [-e ]" - echo -n " [-a "] - echo -n " [-z (compress log)"] - echo - exit 1 -} - -ActiveExchanges=ALPACA_SNDBX-MDPORTAL -AdminPort=7225 -Book="" -Config=http://cloud16.cvtt.vpn:6789/apps/cvtt_eqt_alpaca -COMPRESS_LOG=false - - -while getopts "b:c:e:a:z" opt; do - case ${opt} in - c ) Config=$OPTARG ;; - e ) ActiveExchanges=$OPTARG ;; - a ) AdminPort=$OPTARG ;; - z ) COMPRESS_LOG=true ;; - b ) Book=$OPTARG ;; - \? ) - echo "Invalid option: -$OPTARG" >&2 - usage - ;; - : ) - echo "Option -$OPTARG requires an argument." >&2 - usage - ;; - esac -done - -if [ "${Book}" == "" ]; then - echo "Book is missing" - usage -fi - -Cmd="python3.12" -Cmd="${Cmd} cvttpy/apps/trade_recorder.py" -Cmd="${Cmd} --config=${Config}" -Cmd="${Cmd} --credentials_file=/.creds" -Cmd="${Cmd} --book=${Book}" -# Cmd="${Cmd} --allow_dynamic_exch_inst" -Cmd="${Cmd} --active_exchanges=${ActiveExchanges}" -Cmd="${Cmd} --admin_port=${AdminPort}" -Cmd="${Cmd} --log_file=/logs/%T.TRADING_RECORDER.${Book}.log" -if ${COMPRESS_LOG}; then - Cmd="${Cmd} --compress_log" -fi -echo ${Cmd} -eval ${Cmd} diff --git a/trading_DEPRECATED.tgz b/trading_DEPRECATED.tgz new file mode 100644 index 0000000..84c6c52 Binary files /dev/null and b/trading_DEPRECATED.tgz differ