From ce60e8cc92f3f21ce4af261d10362c2645928951 Mon Sep 17 00:00:00 2001 From: feelan Date: Sat, 10 Sep 2022 15:08:38 +0300 Subject: [PATCH 1/7] Small fix --- csharp/TraderBot/.dockerignore | 3 + csharp/TraderBot/.env.example | 19 ++++++ csharp/TraderBot/.gitignore | 1 + csharp/TraderBot/Dockerfile | 17 ++++++ .../ConcurrentDictionaryExtensions.cs | 0 .../TraderBot/{ => app}/FinancialStorage.cs | 0 csharp/TraderBot/{ => app}/Instrument.cs | 0 .../{ => app}/OperationExtensions.cs | 0 csharp/TraderBot/{ => app}/Program.cs | 0 csharp/TraderBot/{ => app}/README.md | 0 csharp/TraderBot/{ => app}/README.ru.md | 0 csharp/TraderBot/{ => app}/TraderBot.csproj | 0 csharp/TraderBot/{ => app}/TradingService.cs | 0 csharp/TraderBot/{ => app}/TradingSettings.cs | 0 csharp/TraderBot/{ => app}/appsettings.json | 4 +- csharp/TraderBot/{ => app}/day-volatility.png | Bin csharp/TraderBot/{ => app}/repair-logs.sh | 0 csharp/TraderBot/app/sample.json | 3 + csharp/TraderBot/{ => app}/trading.png | Bin csharp/TraderBot/config.sh | 54 ++++++++++++++++++ csharp/TraderBot/docker-compose.yml | 5 ++ 21 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 csharp/TraderBot/.dockerignore create mode 100644 csharp/TraderBot/.env.example create mode 100644 csharp/TraderBot/.gitignore create mode 100644 csharp/TraderBot/Dockerfile rename csharp/TraderBot/{ => app}/ConcurrentDictionaryExtensions.cs (100%) rename csharp/TraderBot/{ => app}/FinancialStorage.cs (100%) rename csharp/TraderBot/{ => app}/Instrument.cs (100%) rename csharp/TraderBot/{ => app}/OperationExtensions.cs (100%) rename csharp/TraderBot/{ => app}/Program.cs (100%) rename csharp/TraderBot/{ => app}/README.md (100%) rename csharp/TraderBot/{ => app}/README.ru.md (100%) rename csharp/TraderBot/{ => app}/TraderBot.csproj (100%) rename csharp/TraderBot/{ => app}/TradingService.cs (100%) rename csharp/TraderBot/{ => app}/TradingSettings.cs (100%) rename csharp/TraderBot/{ => app}/appsettings.json (84%) rename csharp/TraderBot/{ => app}/day-volatility.png (100%) rename csharp/TraderBot/{ => app}/repair-logs.sh (100%) create mode 100644 csharp/TraderBot/app/sample.json rename csharp/TraderBot/{ => app}/trading.png (100%) create mode 100644 csharp/TraderBot/config.sh create mode 100644 csharp/TraderBot/docker-compose.yml diff --git a/csharp/TraderBot/.dockerignore b/csharp/TraderBot/.dockerignore new file mode 100644 index 00000000..cf27334d --- /dev/null +++ b/csharp/TraderBot/.dockerignore @@ -0,0 +1,3 @@ +bin/ +obj/ +appsettings.json \ No newline at end of file diff --git a/csharp/TraderBot/.env.example b/csharp/TraderBot/.env.example new file mode 100644 index 00000000..992f7d5e --- /dev/null +++ b/csharp/TraderBot/.env.example @@ -0,0 +1,19 @@ +LOG_LEVEL_DEFAULT="Information" +MICROSOFT_HOSTING_LIFETIME="Information" +ACESS_TOKEN="t.siwZq-73Z1gAy4K-a6Tu146xG341WHe1dT37wR8kVNB1" +APP_NAME="LinksPlatformScalper" +INSTRUMENT="Etf" +TICKER="TRUR" +CASH_CURRENCY="rub" +ACCOUNT_INDEX=-1 +MINIMUM_PROFIT_STEPS=-2 +MARKET_ORDER_BOOK_DEPTH=10 +MINIMUM_MARKET_ORDER_SIZE_TO_CHANGE_BUY_PRICE=250000 +MINIMUM_MARKET_ORDER_SIZE_TO_CHANGE_SELL_PRICE=0 +MINIMUM_MARKET_ORDER_SIZE_TO_BUY=250000 +MINIMUM_MARKET_ORDER_SIZE_TO_SELL=0 +MINIMUM_TIME_TO_BUY="09:00:00" +MAXIMUM_TIME_TO_BUY="14:45:00" +EARLY_SELL_OWNED_LOTS_DELTA=250000 +EARLY_SELL_OWNED_LOTS_MULTIPLIER=0 +LOAD_OPERATIONS_FROM="2022-08-21T00:00:01.3389860Z" \ No newline at end of file diff --git a/csharp/TraderBot/.gitignore b/csharp/TraderBot/.gitignore new file mode 100644 index 00000000..2eea525d --- /dev/null +++ b/csharp/TraderBot/.gitignore @@ -0,0 +1 @@ +.env \ No newline at end of file diff --git a/csharp/TraderBot/Dockerfile b/csharp/TraderBot/Dockerfile new file mode 100644 index 00000000..0f846abd --- /dev/null +++ b/csharp/TraderBot/Dockerfile @@ -0,0 +1,17 @@ +FROM mcr.microsoft.com/dotnet/sdk:6.0 as build-env +WORKDIR /app + +COPY config.sh ./ + +RUN apt update && \ + apt install jq -y && \ + bash /app/config.sh > appsettings.json + +COPY app ./ +RUN dotnet publish -c Release -o out + +FROM mcr.microsoft.com/dotnet/aspnet:6.0 +WORKDIR /app +COPY --from=build-env /app/out . +COPY --from=build-env /app/appsettings.json . +ENTRYPOINT ["dotnet", "TraderBot.dll"] \ No newline at end of file diff --git a/csharp/TraderBot/ConcurrentDictionaryExtensions.cs b/csharp/TraderBot/app/ConcurrentDictionaryExtensions.cs similarity index 100% rename from csharp/TraderBot/ConcurrentDictionaryExtensions.cs rename to csharp/TraderBot/app/ConcurrentDictionaryExtensions.cs diff --git a/csharp/TraderBot/FinancialStorage.cs b/csharp/TraderBot/app/FinancialStorage.cs similarity index 100% rename from csharp/TraderBot/FinancialStorage.cs rename to csharp/TraderBot/app/FinancialStorage.cs diff --git a/csharp/TraderBot/Instrument.cs b/csharp/TraderBot/app/Instrument.cs similarity index 100% rename from csharp/TraderBot/Instrument.cs rename to csharp/TraderBot/app/Instrument.cs diff --git a/csharp/TraderBot/OperationExtensions.cs b/csharp/TraderBot/app/OperationExtensions.cs similarity index 100% rename from csharp/TraderBot/OperationExtensions.cs rename to csharp/TraderBot/app/OperationExtensions.cs diff --git a/csharp/TraderBot/Program.cs b/csharp/TraderBot/app/Program.cs similarity index 100% rename from csharp/TraderBot/Program.cs rename to csharp/TraderBot/app/Program.cs diff --git a/csharp/TraderBot/README.md b/csharp/TraderBot/app/README.md similarity index 100% rename from csharp/TraderBot/README.md rename to csharp/TraderBot/app/README.md diff --git a/csharp/TraderBot/README.ru.md b/csharp/TraderBot/app/README.ru.md similarity index 100% rename from csharp/TraderBot/README.ru.md rename to csharp/TraderBot/app/README.ru.md diff --git a/csharp/TraderBot/TraderBot.csproj b/csharp/TraderBot/app/TraderBot.csproj similarity index 100% rename from csharp/TraderBot/TraderBot.csproj rename to csharp/TraderBot/app/TraderBot.csproj diff --git a/csharp/TraderBot/TradingService.cs b/csharp/TraderBot/app/TradingService.cs similarity index 100% rename from csharp/TraderBot/TradingService.cs rename to csharp/TraderBot/app/TradingService.cs diff --git a/csharp/TraderBot/TradingSettings.cs b/csharp/TraderBot/app/TradingSettings.cs similarity index 100% rename from csharp/TraderBot/TradingSettings.cs rename to csharp/TraderBot/app/TradingSettings.cs diff --git a/csharp/TraderBot/appsettings.json b/csharp/TraderBot/app/appsettings.json similarity index 84% rename from csharp/TraderBot/appsettings.json rename to csharp/TraderBot/app/appsettings.json index e2a532d5..1fd61d18 100644 --- a/csharp/TraderBot/appsettings.json +++ b/csharp/TraderBot/app/appsettings.json @@ -6,14 +6,14 @@ } }, "InvestApiSettings": { - "AccessToken": "", + "AccessToken": "t.siwZq-73Z1gAy4K-KL1aw7XvNQySsfKC5lQBQNCGeIVnwLPAFYgFOjmXq5TN39AQabBRrAqq4UPBvdptLzdv3w", "AppName": "LinksPlatformScalper" }, "TradingSettings": { "Instrument": "Etf", "Ticker": "TRUR", "CashCurrency": "rub", - "AccountIndex": -1, + "AccountIndex": 0, "MinimumProfitSteps": -2, "MarketOrderBookDepth": 10, "MinimumMarketOrderSizeToChangeBuyPrice": 250000, diff --git a/csharp/TraderBot/day-volatility.png b/csharp/TraderBot/app/day-volatility.png similarity index 100% rename from csharp/TraderBot/day-volatility.png rename to csharp/TraderBot/app/day-volatility.png diff --git a/csharp/TraderBot/repair-logs.sh b/csharp/TraderBot/app/repair-logs.sh similarity index 100% rename from csharp/TraderBot/repair-logs.sh rename to csharp/TraderBot/app/repair-logs.sh diff --git a/csharp/TraderBot/app/sample.json b/csharp/TraderBot/app/sample.json new file mode 100644 index 00000000..45fe6d10 --- /dev/null +++ b/csharp/TraderBot/app/sample.json @@ -0,0 +1,3 @@ +{ + "hello": "GoodMorning" +} diff --git a/csharp/TraderBot/trading.png b/csharp/TraderBot/app/trading.png similarity index 100% rename from csharp/TraderBot/trading.png rename to csharp/TraderBot/app/trading.png diff --git a/csharp/TraderBot/config.sh b/csharp/TraderBot/config.sh new file mode 100644 index 00000000..1682d429 --- /dev/null +++ b/csharp/TraderBot/config.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +set -o pipefail +set +e + +jq -n \ + --arg logLevelDefault "$LOG_LEVEL_DEFAULT" \ + --arg microsoftHostingLifetime "$MICROSOFT_HOSTING_LIFETIME" \ + --arg accessToken "$ACESS_TOKEN" \ + --arg appName "$APP_NAME" \ + --arg instrument "$INSTRUMENT" \ + --arg ticker "$TICKER" \ + --arg cashCurrency "$CASH_CURRENCY" \ + --arg accountIndex "$ACCOUNT_INDEX" \ + --arg minimumProfitSteps "$MINIMUM_PROFIT_STEPS" \ + --arg marketOrderBookDepth "$MARKET_ORDER_BOOK_DEPTH" \ + --arg minimumMarketOrderSizeToChangeBuyPrice "$MINIMUM_MARKET_ORDER_SIZE_TO_CHANGE_BUY_PRICE" \ + --arg minimumMarketOrderSizeToChangeSellPrice "$MINIMUM_MARKET_ORDER_SIZE_TO_CHANGE_SELL_PRICE" \ + --arg minimumMarketOrderSizeToBuy "$MINIMUM_MARKET_ORDER_SIZE_TO_BUY" \ + --arg minimumMarketOrderSizeToSell "$MINIMUM_MARKET_ORDER_SIZE_TO_SELL" \ + --arg minimumTimeToBuy "$MINIMUM_TIME_TO_BUY" \ + --arg maximumTimeToBuy "$MAXIMUM_TIME_TO_BUY" \ + --arg earlySellOwnedLotsDelta "$EARLY_SELL_OWNED_LOTS_DELTA" \ + --arg earlySellOwnedLotsMultiplier "$EARLY_SELL_OWNED_LOTS_MULTIPLIER" \ + --arg loadOperationsFrom "$LOAD_OPERATIONS_FROM" \ + '{ + "Logging": { + "LogLevel": { + "Default": $logLevelDefault, + "Microsoft.Hosting.Lifetime": $microsoftHostingLifetime + } + }, + "InvestApiSettings": { + "AccessToken": $accessToken, + "AppName": $appName + }, + "TradingSettings": { + "Instrument": $instrument, + "Ticker": $ticker, + "CashCurrency": $cashCurrency, + "AccountIndex": $accountIndex, + "MinimumProfitSteps": $minimumProfitSteps, + "MarketOrderBookDepth": $marketOrderBookDepth, + "MinimumMarketOrderSizeToChangeBuyPrice": $minimumMarketOrderSizeToChangeBuyPrice, + "MinimumMarketOrderSizeToChangeSellPrice": $minimumMarketOrderSizeToChangeSellPrice, + "MinimumMarketOrderSizeToBuy": $minimumMarketOrderSizeToBuy, + "MinimumMarketOrderSizeToSell": $minimumMarketOrderSizeToSell, + "MinimumTimeToBuy": $minimumTimeToBuy, + "MaximumTimeToBuy": $maximumTimeToBuy, + "EarlySellOwnedLotsDelta": $earlySellOwnedLotsDelta, + "EarlySellOwnedLotsMultiplier": $earlySellOwnedLotsMultiplier, + "LoadOperationsFrom": $loadOperationsFrom + } + }' \ No newline at end of file diff --git a/csharp/TraderBot/docker-compose.yml b/csharp/TraderBot/docker-compose.yml new file mode 100644 index 00000000..29470a48 --- /dev/null +++ b/csharp/TraderBot/docker-compose.yml @@ -0,0 +1,5 @@ +version: "3.9" +services: + trader-bot: + build: . + env_file: .env \ No newline at end of file From 44938bc1618b04e1f278809ac1f8da1ed187affd Mon Sep 17 00:00:00 2001 From: feelan Date: Sat, 10 Sep 2022 15:25:59 +0300 Subject: [PATCH 2/7] Move readme files --- csharp/TraderBot/{app => }/README.md | 0 csharp/TraderBot/{app => }/README.ru.md | 0 csharp/TraderBot/app/sample.json | 3 --- csharp/TraderBot/{app => }/day-volatility.png | Bin csharp/TraderBot/{app => }/trading.png | Bin 5 files changed, 3 deletions(-) rename csharp/TraderBot/{app => }/README.md (100%) rename csharp/TraderBot/{app => }/README.ru.md (100%) delete mode 100644 csharp/TraderBot/app/sample.json rename csharp/TraderBot/{app => }/day-volatility.png (100%) rename csharp/TraderBot/{app => }/trading.png (100%) diff --git a/csharp/TraderBot/app/README.md b/csharp/TraderBot/README.md similarity index 100% rename from csharp/TraderBot/app/README.md rename to csharp/TraderBot/README.md diff --git a/csharp/TraderBot/app/README.ru.md b/csharp/TraderBot/README.ru.md similarity index 100% rename from csharp/TraderBot/app/README.ru.md rename to csharp/TraderBot/README.ru.md diff --git a/csharp/TraderBot/app/sample.json b/csharp/TraderBot/app/sample.json deleted file mode 100644 index 45fe6d10..00000000 --- a/csharp/TraderBot/app/sample.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "hello": "GoodMorning" -} diff --git a/csharp/TraderBot/app/day-volatility.png b/csharp/TraderBot/day-volatility.png similarity index 100% rename from csharp/TraderBot/app/day-volatility.png rename to csharp/TraderBot/day-volatility.png diff --git a/csharp/TraderBot/app/trading.png b/csharp/TraderBot/trading.png similarity index 100% rename from csharp/TraderBot/app/trading.png rename to csharp/TraderBot/trading.png From 62813d4d4a4361d1c9ffcdaaffae46fa2ac8dd45 Mon Sep 17 00:00:00 2001 From: feelan03 <57330758+feelan03@users.noreply.github.com> Date: Sat, 10 Sep 2022 16:39:17 +0300 Subject: [PATCH 3/7] Update csharp/TraderBot/.env.example Co-authored-by: Konstantin Dyachenko --- csharp/TraderBot/.env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/TraderBot/.env.example b/csharp/TraderBot/.env.example index 992f7d5e..c8c92e29 100644 --- a/csharp/TraderBot/.env.example +++ b/csharp/TraderBot/.env.example @@ -1,6 +1,6 @@ LOG_LEVEL_DEFAULT="Information" MICROSOFT_HOSTING_LIFETIME="Information" -ACESS_TOKEN="t.siwZq-73Z1gAy4K-a6Tu146xG341WHe1dT37wR8kVNB1" +ACCESS_TOKEN="" APP_NAME="LinksPlatformScalper" INSTRUMENT="Etf" TICKER="TRUR" From d2500a60c5ff6891aa9a267e15885781b4400285 Mon Sep 17 00:00:00 2001 From: feelan03 <57330758+feelan03@users.noreply.github.com> Date: Sat, 10 Sep 2022 16:39:31 +0300 Subject: [PATCH 4/7] Update csharp/TraderBot/app/appsettings.json Co-authored-by: Konstantin Dyachenko --- csharp/TraderBot/app/appsettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/TraderBot/app/appsettings.json b/csharp/TraderBot/app/appsettings.json index 1fd61d18..4c000ea6 100644 --- a/csharp/TraderBot/app/appsettings.json +++ b/csharp/TraderBot/app/appsettings.json @@ -6,7 +6,7 @@ } }, "InvestApiSettings": { - "AccessToken": "t.siwZq-73Z1gAy4K-KL1aw7XvNQySsfKC5lQBQNCGeIVnwLPAFYgFOjmXq5TN39AQabBRrAqq4UPBvdptLzdv3w", + "AccessToken": "", "AppName": "LinksPlatformScalper" }, "TradingSettings": { From 973c51d84b012176e9378bede0c2a7438c813a9e Mon Sep 17 00:00:00 2001 From: feelan03 <57330758+feelan03@users.noreply.github.com> Date: Sat, 10 Sep 2022 16:39:57 +0300 Subject: [PATCH 5/7] Update csharp/TraderBot/app/appsettings.json Co-authored-by: Konstantin Dyachenko --- csharp/TraderBot/app/appsettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/TraderBot/app/appsettings.json b/csharp/TraderBot/app/appsettings.json index 4c000ea6..e2a532d5 100644 --- a/csharp/TraderBot/app/appsettings.json +++ b/csharp/TraderBot/app/appsettings.json @@ -13,7 +13,7 @@ "Instrument": "Etf", "Ticker": "TRUR", "CashCurrency": "rub", - "AccountIndex": 0, + "AccountIndex": -1, "MinimumProfitSteps": -2, "MarketOrderBookDepth": 10, "MinimumMarketOrderSizeToChangeBuyPrice": 250000, From 3efb874f7b289f73fbe809124c0e11f9c3b17e27 Mon Sep 17 00:00:00 2001 From: feelan03 <57330758+feelan03@users.noreply.github.com> Date: Sat, 10 Sep 2022 16:40:06 +0300 Subject: [PATCH 6/7] Update csharp/TraderBot/config.sh Co-authored-by: Konstantin Dyachenko --- csharp/TraderBot/config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/TraderBot/config.sh b/csharp/TraderBot/config.sh index 1682d429..8fdc4f1c 100644 --- a/csharp/TraderBot/config.sh +++ b/csharp/TraderBot/config.sh @@ -6,7 +6,7 @@ set +e jq -n \ --arg logLevelDefault "$LOG_LEVEL_DEFAULT" \ --arg microsoftHostingLifetime "$MICROSOFT_HOSTING_LIFETIME" \ - --arg accessToken "$ACESS_TOKEN" \ + --arg accessToken "$ACCESS_TOKEN" \ --arg appName "$APP_NAME" \ --arg instrument "$INSTRUMENT" \ --arg ticker "$TICKER" \ From 9f894bc2a791f05991668786f258c01452e32996 Mon Sep 17 00:00:00 2001 From: feelan Date: Sat, 10 Sep 2022 22:47:57 +0300 Subject: [PATCH 7/7] Fix docker image --- csharp/TraderBot/.dockerignore | 3 +-- .../{app => }/ConcurrentDictionaryExtensions.cs | 0 csharp/TraderBot/Dockerfile | 14 +++++--------- csharp/TraderBot/{app => }/FinancialStorage.cs | 0 csharp/TraderBot/{app => }/Instrument.cs | 0 csharp/TraderBot/{app => }/OperationExtensions.cs | 0 csharp/TraderBot/{app => }/Program.cs | 0 csharp/TraderBot/{app => }/TraderBot.csproj | 0 csharp/TraderBot/{app => }/TradingService.cs | 0 csharp/TraderBot/{app => }/TradingSettings.cs | 0 csharp/TraderBot/{app => }/appsettings.json | 0 csharp/TraderBot/docker-compose.yml | 3 ++- csharp/TraderBot/{config.sh => entrypoint.sh} | 4 +++- csharp/TraderBot/{app => }/repair-logs.sh | 0 14 files changed, 11 insertions(+), 13 deletions(-) rename csharp/TraderBot/{app => }/ConcurrentDictionaryExtensions.cs (100%) rename csharp/TraderBot/{app => }/FinancialStorage.cs (100%) rename csharp/TraderBot/{app => }/Instrument.cs (100%) rename csharp/TraderBot/{app => }/OperationExtensions.cs (100%) rename csharp/TraderBot/{app => }/Program.cs (100%) rename csharp/TraderBot/{app => }/TraderBot.csproj (100%) rename csharp/TraderBot/{app => }/TradingService.cs (100%) rename csharp/TraderBot/{app => }/TradingSettings.cs (100%) rename csharp/TraderBot/{app => }/appsettings.json (100%) rename csharp/TraderBot/{config.sh => entrypoint.sh} (98%) rename csharp/TraderBot/{app => }/repair-logs.sh (100%) diff --git a/csharp/TraderBot/.dockerignore b/csharp/TraderBot/.dockerignore index cf27334d..cbbd0b5c 100644 --- a/csharp/TraderBot/.dockerignore +++ b/csharp/TraderBot/.dockerignore @@ -1,3 +1,2 @@ bin/ -obj/ -appsettings.json \ No newline at end of file +obj/ \ No newline at end of file diff --git a/csharp/TraderBot/app/ConcurrentDictionaryExtensions.cs b/csharp/TraderBot/ConcurrentDictionaryExtensions.cs similarity index 100% rename from csharp/TraderBot/app/ConcurrentDictionaryExtensions.cs rename to csharp/TraderBot/ConcurrentDictionaryExtensions.cs diff --git a/csharp/TraderBot/Dockerfile b/csharp/TraderBot/Dockerfile index 0f846abd..172218a3 100644 --- a/csharp/TraderBot/Dockerfile +++ b/csharp/TraderBot/Dockerfile @@ -1,17 +1,13 @@ FROM mcr.microsoft.com/dotnet/sdk:6.0 as build-env WORKDIR /app -COPY config.sh ./ - -RUN apt update && \ - apt install jq -y && \ - bash /app/config.sh > appsettings.json - -COPY app ./ +COPY . ./ RUN dotnet publish -c Release -o out FROM mcr.microsoft.com/dotnet/aspnet:6.0 WORKDIR /app +RUN apt update && apt install jq -y +COPY entrypoint.sh . COPY --from=build-env /app/out . -COPY --from=build-env /app/appsettings.json . -ENTRYPOINT ["dotnet", "TraderBot.dll"] \ No newline at end of file + +ENTRYPOINT ["bash", "/app/entrypoint.sh"] \ No newline at end of file diff --git a/csharp/TraderBot/app/FinancialStorage.cs b/csharp/TraderBot/FinancialStorage.cs similarity index 100% rename from csharp/TraderBot/app/FinancialStorage.cs rename to csharp/TraderBot/FinancialStorage.cs diff --git a/csharp/TraderBot/app/Instrument.cs b/csharp/TraderBot/Instrument.cs similarity index 100% rename from csharp/TraderBot/app/Instrument.cs rename to csharp/TraderBot/Instrument.cs diff --git a/csharp/TraderBot/app/OperationExtensions.cs b/csharp/TraderBot/OperationExtensions.cs similarity index 100% rename from csharp/TraderBot/app/OperationExtensions.cs rename to csharp/TraderBot/OperationExtensions.cs diff --git a/csharp/TraderBot/app/Program.cs b/csharp/TraderBot/Program.cs similarity index 100% rename from csharp/TraderBot/app/Program.cs rename to csharp/TraderBot/Program.cs diff --git a/csharp/TraderBot/app/TraderBot.csproj b/csharp/TraderBot/TraderBot.csproj similarity index 100% rename from csharp/TraderBot/app/TraderBot.csproj rename to csharp/TraderBot/TraderBot.csproj diff --git a/csharp/TraderBot/app/TradingService.cs b/csharp/TraderBot/TradingService.cs similarity index 100% rename from csharp/TraderBot/app/TradingService.cs rename to csharp/TraderBot/TradingService.cs diff --git a/csharp/TraderBot/app/TradingSettings.cs b/csharp/TraderBot/TradingSettings.cs similarity index 100% rename from csharp/TraderBot/app/TradingSettings.cs rename to csharp/TraderBot/TradingSettings.cs diff --git a/csharp/TraderBot/app/appsettings.json b/csharp/TraderBot/appsettings.json similarity index 100% rename from csharp/TraderBot/app/appsettings.json rename to csharp/TraderBot/appsettings.json diff --git a/csharp/TraderBot/docker-compose.yml b/csharp/TraderBot/docker-compose.yml index 29470a48..76e63d8b 100644 --- a/csharp/TraderBot/docker-compose.yml +++ b/csharp/TraderBot/docker-compose.yml @@ -2,4 +2,5 @@ version: "3.9" services: trader-bot: build: . - env_file: .env \ No newline at end of file + env_file: .env + restart: on-failure diff --git a/csharp/TraderBot/config.sh b/csharp/TraderBot/entrypoint.sh similarity index 98% rename from csharp/TraderBot/config.sh rename to csharp/TraderBot/entrypoint.sh index 8fdc4f1c..3e1b4d7b 100644 --- a/csharp/TraderBot/config.sh +++ b/csharp/TraderBot/entrypoint.sh @@ -51,4 +51,6 @@ jq -n \ "EarlySellOwnedLotsMultiplier": $earlySellOwnedLotsMultiplier, "LoadOperationsFrom": $loadOperationsFrom } - }' \ No newline at end of file + }' > appsettings.json + +dotnet TraderBot.dll \ No newline at end of file diff --git a/csharp/TraderBot/app/repair-logs.sh b/csharp/TraderBot/repair-logs.sh similarity index 100% rename from csharp/TraderBot/app/repair-logs.sh rename to csharp/TraderBot/repair-logs.sh