Skip to content

Commit

Permalink
Merge branch 'release/5.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
straumat committed Jul 13, 2021
2 parents d563e41 + 0af5e7d commit 16ccf8e
Show file tree
Hide file tree
Showing 136 changed files with 900 additions and 830 deletions.
1 change: 0 additions & 1 deletion .github/FUNDING.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ assignees: ''

---

**Release number**
Cassandre release you are using.

**Describe the bug**
A clear and concise description of what the bug is.

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/branch-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ jobs:
id: sources
uses: actions/checkout@v1

# ================================================================================================================
- name: Build, run tests, package and deploy to Maven central
id: package
run: |
mvn install -Dgpg.skip
# ================================================================================================================
- name: Retrieve the version
id: version
run: |
echo "::set-output name=version::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
# ================================================================================================================
- name: Build, run tests, package and deploy to Maven central
id: package
run: |
mvn install -Dgpg.skip
# ================================================================================================================
- name: Test Cassandre trading bot maven archetype - basic strategy
id: cassandre-trading-bot-spring-boot-starter-basic-archetype
Expand All @@ -49,7 +49,7 @@ jobs:
-DartifactId=archetype-test-basic \
-Dversion=1.0-SNAPSHOT \
-Dpackage=com.example
mvn -f archetype-test-basic/pom.xml compile
mvn -f archetype-test-basic/pom.xml test
# ================================================================================================================
- name: Test Cassandre trading bot maven archetype - basic ta4j strategy
Expand All @@ -63,4 +63,4 @@ jobs:
-DartifactId=archetype-test-ta4j-basic \
-Dversion=1.0-SNAPSHOT \
-Dpackage=com.example
mvn -f archetype-test-ta4j-basic/pom.xml compile
mvn -f archetype-test-ta4j-basic/pom.xml test
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
-DartifactId=archetype-test-basic \
-Dversion=1.0-SNAPSHOT \
-Dpackage=com.example
mvn -f archetype-test-basic/pom.xml compile
mvn -f archetype-test-basic/pom.xml test
# ================================================================================================================
- name: Test Cassandre trading bot maven archetype - basic ta4j strategy
Expand All @@ -80,4 +80,4 @@ jobs:
-DartifactId=archetype-test-ta4j-basic \
-Dversion=1.0-SNAPSHOT \
-Dpackage=com.example
mvn -f archetype-test-ta4j-basic/pom.xml compile
mvn -f archetype-test-ta4j-basic/pom.xml test
30 changes: 1 addition & 29 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,32 +49,4 @@ jobs:
BINANCE_KEY: ${{ secrets.BINANCE_KEY }}
BINANCE_SECRET: ${{ secrets.BINANCE_SECRET }}
run: |
mvn -Pintegration package
# ================================================================================================================
- name: Test Cassandre trading bot maven archetype - basic strategy
id: cassandre-trading-bot-spring-boot-starter-basic-archetype
run: |
mvn -B archetype:generate \
-DarchetypeGroupId=tech.cassandre.trading.bot \
-DarchetypeArtifactId=cassandre-trading-bot-spring-boot-starter-basic-archetype \
-DarchetypeVersion=${{ steps.version.outputs.version }} \
-DgroupId=com.example \
-DartifactId=archetype-test-basic \
-Dversion=1.0-SNAPSHOT \
-Dpackage=com.example
mvn -f archetype-test-basic/pom.xml test
# ================================================================================================================
- name: Test Cassandre trading bot maven archetype - basic ta4j strategy
id: cassandre-trading-bot-spring-boot-starter-basic-ta4j-archetype
run: |
mvn -B archetype:generate \
-DarchetypeGroupId=tech.cassandre.trading.bot \
-DarchetypeArtifactId=cassandre-trading-bot-spring-boot-starter-basic-ta4j-archetype \
-DarchetypeVersion=${{ steps.version.outputs.version }} \
-DgroupId=com.example \
-DartifactId=archetype-test-ta4j-basic \
-Dversion=1.0-SNAPSHOT \
-Dpackage=com.example
mvn -f archetype-test-ta4j-basic/pom.xml test
mvn -Pintegration package
62 changes: 0 additions & 62 deletions .github/workflows/pull-request.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/release-creation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ jobs:
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}

# ================================================================================================================
- name: Retrieve the sources
uses: actions/checkout@v1

# ================================================================================================================
- name: JDK 11 Setup
uses: actions/setup-java@v1
Expand All @@ -34,7 +30,11 @@ jobs:
server-password: MAVEN_PASSWORD

# ================================================================================================================
- name: Build, run tests, package
- name: Retrieve the sources
uses: actions/checkout@v1

# ================================================================================================================
- name: Build, run tests, package and deploy
id: package
env: # Environment variables.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
13 changes: 4 additions & 9 deletions docs/src/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ module.exports = {
ariaLabel: 'Deploy & run',
items: [
{text: 'Using Docker', link: '/deploy-and-run/docker'},
{text: 'Using Qovery', link: '/deploy-and-run/qovery'}
{text: 'Using Qovery', link: '/deploy-and-run/qovery'},
]
},
{
Expand All @@ -130,16 +130,11 @@ module.exports = {
},
{
text: 'How-tos', items: [
{
text: 'Install development tools',
link: '/ressources/how-tos/how-to-install-development-tools'
},
{text: 'Install development tools', link: '/ressources/how-tos/how-to-install-development-tools'},
{text: 'Install terraform', link: '/ressources/how-tos/how-to-install-terraform'},
{text: 'Build from sources', link: '/ressources/how-tos/how-to-build-from-sources'},
{text: 'Create a release', link: '/ressources/how-tos/how-to-create-a-release'},
{
text: 'Create a Kucoin account',
link: '/ressources/how-tos/how-to-create-a-kucoin-account'
},
{text: 'Create a Kucoin account', link: '/ressources/how-tos/how-to-create-a-kucoin-account'},
]
},
],
Expand Down
11 changes: 5 additions & 6 deletions docs/src/deploy-and-run/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ The CI script does the following:
--security-opt apparmor=unconfined \
--network="cassandre" \
-e TZ=Europe/Paris \
-e CASSANDRE_TRADING_BOT_EXCHANGE_NAME='${{ secrets.CASSANDRE_TRADING_BOT_EXCHANGE_NAME }}' \
-e CASSANDRE_TRADING_BOT_EXCHANGE_DRIVER_CLASS_NAME='${{ secrets.CASSANDRE_TRADING_BOT_EXCHANGE_DRIVER_CLASS_NAME }}' \
-e CASSANDRE_TRADING_BOT_EXCHANGE_USERNAME='${{ secrets.CASSANDRE_TRADING_BOT_EXCHANGE_USERNAME }}' \
-e CASSANDRE_TRADING_BOT_EXCHANGE_PASSPHRASE='${{ secrets.CASSANDRE_TRADING_BOT_EXCHANGE_PASSPHRASE }}' \
-e CASSANDRE_TRADING_BOT_EXCHANGE_KEY='${{ secrets.CASSANDRE_TRADING_BOT_EXCHANGE_KEY }}' \
Expand All @@ -182,11 +182,10 @@ The CI script does the following:
-e CASSANDRE_TRADING_BOT_EXCHANGE_RATES_ACCOUNT='${{ secrets.CASSANDRE_TRADING_BOT_EXCHANGE_RATES_ACCOUNT }}' \
-e CASSANDRE_TRADING_BOT_EXCHANGE_RATES_TICKER='${{ secrets.CASSANDRE_TRADING_BOT_EXCHANGE_RATES_TICKER }}' \
-e CASSANDRE_TRADING_BOT_EXCHANGE_RATES_ORDER='${{ secrets.CASSANDRE_TRADING_BOT_EXCHANGE_RATES_ORDER }}' \
-e CASSANDRE_TRADING_BOT_DATABASE_DATASOURCE_DRIVER-CLASS-NAME=${{ secrets.CASSANDRE_TRADING_BOT_DATABASE_DATASOURCE_DRIVER_CLASS_NAME }} \
-e CASSANDRE_TRADING_BOT_DATABASE_DATASOURCE_URL=${{ secrets.CASSANDRE_TRADING_BOT_DATABASE_DATASOURCE_URL }} \
-e CASSANDRE_TRADING_BOT_DATABASE_DATASOURCE_USERNAME=${{ secrets.CASSANDRE_TRADING_BOT_DATABASE_DATASOURCE_USERNAME }} \
-e CASSANDRE_TRADING_BOT_DATABASE_DATASOURCE_PASSWORD=${{ secrets.CASSANDRE_TRADING_BOT_DATABASE_DATASOURCE_PASSWORD }} \
-e CASSANDRE_TRADING_BOT_DATABASE_TABLE-PREFIX=${{ secrets.CASSANDRE_TRADING_BOT_DATABASE_TABLE_PREFIX }} \
-e SPRING_DATASOURCE_DRIVER_CLASS_NAME=${{ secrets.CASSANDRE_TRADING_BOT_DATABASE_DATASOURCE_DRIVER_CLASS_NAME }} \
-e SPRING_DATASOURCE_URL=${{ secrets.CASSANDRE_TRADING_BOT_DATABASE_DATASOURCE_URL }} \
-e SPRING_DATASOURCE_USERNAME=${{ secrets.CASSANDRE_TRADING_BOT_DATABASE_DATASOURCE_USERNAME }} \
-e SPRING_DATASOURCE_PASSWORD=${{ secrets.CASSANDRE_TRADING_BOT_DATABASE_DATASOURCE_PASSWORD }} \
-l trading-bot \
straumat/trading-bot:latest
```
Expand Down
26 changes: 13 additions & 13 deletions docs/src/deploy-and-run/qovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Edit `src/main/resources/application.properties` to configure the database:, we

```properties
# Exchange configuration.
cassandre.trading.bot.exchange.name=kucoin
cassandre.trading.bot.exchange.driver-class-name=kucoin
cassandre.trading.bot.exchange.username[email protected]
cassandre.trading.bot.exchange.passphrase=cassandre
cassandre.trading.bot.exchange.key=5df8eea30092f40009cb3c6a
Expand All @@ -56,10 +56,10 @@ cassandre.trading.bot.exchange.rates.ticker=PT1S
cassandre.trading.bot.exchange.rates.trade=PT1S
#
# Database configuration.
cassandre.trading.bot.database.datasource.driver-class-name=org.postgresql.Driver
cassandre.trading.bot.database.datasource.url=jdbc:postgresql://${QOVERY_DATABASE_QOVERY_TEST_HOST}:5432/${QOVERY_DATABASE_QOVERY_TEST_DATABASE_NAME}
cassandre.trading.bot.database.datasource.username=${QOVERY_DATABASE_QOVERY_TEST_USERNAME}
cassandre.trading.bot.database.datasource.password=${QOVERY_DATABASE_QOVERY_TEST_PASSWORD}
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://${QOVERY_DATABASE_QOVERY_TEST_HOST}:5432/${QOVERY_DATABASE_QOVERY_TEST_DATABASE_NAME}
spring.datasource.username=${QOVERY_DATABASE_QOVERY_TEST_USERNAME}
spring.datasource.password=${QOVERY_DATABASE_QOVERY_TEST_PASSWORD}
```
### Add the PostgreSQL driver
To connect to a PostgreSQL server, you need to add the JDBC driver to your project. Edit your pom.xml and add:
Expand Down Expand Up @@ -120,35 +120,35 @@ git push -u origin main
## Configure Qovery
Connect to [Qovery](https://www.qovery.com/) and signup, then go to the project menu and click on `create a new project`.

![qovery - Create a project](./qovery-create-project.png)
![qovery - Create a project](./images/qovery-create-project.png)

Enter your project name (`qovery-test`):

![qovery - Configure the project](./qovery-configure-project.png)
![qovery - Configure the project](./images/qovery-configure-project.png)

Now, create an application with the name (`qovery-test-app`) and choose `I have an application` on the next screen:

![qovery - Create an application](./qovery-create-application.png)
![qovery - Create an application](./images/qovery-create-application.png)

Then, select the github project you want to deploy to Qovery:

![qovery - Select Github project](./qovery-select-github-project.png)
![qovery - Select Github project](./images/qovery-select-github-project.png)

Choose the type of application you have (java):

![qovery - Select application type](./qovery-application-type-choice.png)
![qovery - Select application type](./images/qovery-application-type-choice.png)

Choose the type of database (PostgreSQL):

![qovery - Select database type](./qovery-database-choice.png)
![qovery - Select database type](./images/qovery-database-choice.png)

Choose the name of the database (`qovery-test-database`):

![qovery - Configure database](./qovery-database-configuration.png)
![qovery - Configure database](./images/qovery-database-configuration.png)

Now, check everything is ok the summary page and press create !

![qovery - Deployment summary](./qovery-deployment-summary.png)
![qovery - Deployment summary](./images/qovery-deployment-summary.png)

Qovery will now connect to your repo, creates a configuration file, creates your server and your database, retrieve your sources, build the docker image and run it ! That's it.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ features:
- title: Get into trading with Minimum fuss
details: Available as a Spring boot starter, Cassandre takes care of exchange connections, accounts, orders, trades, and positions, so you can focus on building your strategy.
- title: Create your strategy in minutes
details: Just code when you want to take short/long positions, set the rules, and we take care of everything (buying, selling, rules management, orders, trades, and tickers).
details: Just code when you want to create short/long positions, set the rules, and we take care of everything (buying, selling, rules management, orders, trades, and tickers).
- title: Dry mode & backtesting made easy
details: We provide a dry mode to simulate exchange replies to your orders to easily test your strategy. We also provide a spring boot starter to backtest your bot on historical data.
footer:
Expand Down
2 changes: 1 addition & 1 deletion docs/src/learn/architecture.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Architecture
![Cassandre architecture](./cassandre-trading-bot-architecture.png)
![Cassandre architecture](./images/cassandre-trading-bot-architecture.png)
Binary file not shown.
Binary file removed docs/src/learn/cassandre-trading-bot-database.png
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/src/learn/database-structure.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Database structure
![Database structure](./cassandre-trading-bot-database.png)
![Database structure](./images/cassandre-trading-bot-database.png)
5 changes: 3 additions & 2 deletions docs/src/learn/dry-mode-and-backtesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@ curl -s "https://api.kucoin.com/api/v1/market/candles?type=1day&symbol=BTC-USDT&

It will create a file named `tickers-btc-usdt.tsv` that contains the historical rate of BTC-USDT from `startDate` (3 months ago) to `endDate` (now). Of course, you can choose your own dates and currency pair.

Place this file in the `src/test/resources` folder of your project and add this line to your JUnit test class:
Place this file in the `src/test/resources` folder of your project and add those lines to your JUnit test class:

```java
@ComponentScan("tech.cassandre.trading.bot")
@Import(TickerFluxMock.class)
```

Now, during the tests, instead of receiving tickers from the exchange, you will receive tickers imported from the `tsv/csv` files you put in `src/test/resources`.

You can see an example of dry mode and backtesting in the [Technical analysis chapter](src/learn/technical-analysis-backup/overview.md).
You can see an example of dry mode and backtesting in the [Technical analysis chapter](./technical-analysis).

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 16ccf8e

Please sign in to comment.