Skip to content

Commit

Permalink
Merge branch 'release/2.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
straumat committed Aug 25, 2020
2 parents 2e2b20f + 2a9033a commit fb7ad89
Show file tree
Hide file tree
Showing 60 changed files with 1,792 additions and 229 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: "CodeQL"

on:
schedule:
- cron: '0 0 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: java

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11.0.x

- name: Build, run tests, package and deploy to Maven central
env: # Environment variables.
# Kucoin credentials.
KUCOIN_NAME: ${{ secrets.KUCOIN_NAME }}
KUCOIN_USERNAME: ${{ secrets.KUCOIN_USERNAME }}
KUCOIN_PASSPHRASE: ${{ secrets.KUCOIN_PASSPHRASE }}
KUCOIN_KEY: ${{ secrets.KUCOIN_KEY }}
KUCOIN_SECRET: ${{ secrets.KUCOIN_SECRET }}
run: |
mvn package
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Cassandre
![Continuous integration](https://github.com/cassandre-tech/cassandre-trading-bot/workflows/Continuous%20integration/badge.svg) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/f26dc41008a64bb18dcd404b46b69fc8)](https://www.codacy.com/gh/cassandre-tech/cassandre-trading-bot?utm_source=github.com&utm_medium=referral&utm_content=cassandre-tech/cassandre-trading-bot&utm_campaign=Badge_Grade) [![Maven Central](https://img.shields.io/maven-central/v/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-starter-archetype.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22tech.cassandre.trading.bot%22%20AND%20a:%22cassandre-trading-bot-spring-boot-starter-archetype%22)

[Complete documentation is available here](https://trading-bot.cassandre.tech/)
A trading bot is a computer program that can automatically place orders to a market or exchange without the need for human intervention. Automated trading strategies are the future of investing, they are working for you 24/7 and never lose their focus.

Our goal with this project was to learn trading & data analysis by building an automated trading system for the cryptocurrencies markets. While learning, we built the bot and we decided to share our code, the problems encountered, the lessons learned and technologies used.

[A complete documentation is available here](https://trading-bot.cassandre.tech/)
3 changes: 2 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

| Version | Supported |
| ------- | ------------------ |
| 2.0.x | :white_check_mark: |
| 1.0.x | :white_check_mark: |

## Reporting a Vulnerability

Send an email to [email protected] and we will reply within 24 hours.
Email [[email protected]](mailto:[email protected]) and we will reply within 24 hours.
21 changes: 19 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- Project information -->
<groupId>tech.cassandre.trading.bot</groupId>
<artifactId>cassandre-trading-bot-project</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
<packaging>pom</packaging>
<name>Cassandre trading bot</name>
<url>https://github.com/cassandre-tech/cassandre-trading-bot</url>
Expand Down Expand Up @@ -36,7 +36,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.2.RELEASE</version>
<version>2.3.3.RELEASE</version>
<relativePath/>
</parent>
<!-- =========================================================================================================== -->
Expand All @@ -55,8 +55,13 @@
<!-- =========================================================================================================== -->
<!-- Modules -->
<modules>
<!-- Trading bot spring boot starter -->
<module>trading-bot-spring-boot-autoconfigure</module>
<module>trading-bot-spring-boot-starter</module>
<!-- Trading bot spring boot starter test -->
<module>trading-bot-spring-boot-starter-test-autoconfigure</module>
<module>trading-bot-spring-boot-starter-test</module>
<!-- Archetypes -->
<module>trading-bot-spring-boot-starter-archetype</module>
<module>trading-bot-spring-boot-starter-basic-ta4j-archetype</module>
</modules>
Expand Down Expand Up @@ -88,6 +93,18 @@
</commitMessages>
</configuration>
</plugin>
<!-- Deploy to sonartype -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<!-- GPG signing -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
6 changes: 5 additions & 1 deletion trading-bot-spring-boot-autoconfigure/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Cassandre
![Continuous integration](https://github.com/cassandre-tech/cassandre-trading-bot/workflows/Continuous%20integration/badge.svg) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/f26dc41008a64bb18dcd404b46b69fc8)](https://www.codacy.com/gh/cassandre-tech/cassandre-trading-bot?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=cassandre-tech/cassandre-trading-bot&amp;utm_campaign=Badge_Grade) [![Maven Central](https://img.shields.io/maven-central/v/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-starter-archetype.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22tech.cassandre.trading.bot%22%20AND%20a:%22cassandre-trading-bot-spring-boot-starter-archetype%22)

[Complete documentation is available here](https://trading-bot.cassandre.tech/)
A trading bot is a computer program that can automatically place orders to a market or exchange without the need for human intervention. Automated trading strategies are the future of investing, they are working for you 24/7 and never lose their focus.

Our goal with this project was to learn trading & data analysis by building an automated trading system for the cryptocurrencies markets. While learning, we built the bot and we decided to share our code, the problems encountered, the lessons learned and technologies used.

[A complete documentation is available here](https://trading-bot.cassandre.tech/)
4 changes: 2 additions & 2 deletions trading-bot-spring-boot-autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-bom</artifactId>
<version>Dysprosium-SR10</version>
<version>Dysprosium-SR11</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -262,7 +262,7 @@
<parent>
<groupId>tech.cassandre.trading.bot</groupId>
<artifactId>cassandre-trading-bot-project</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</parent>
<!-- =========================================================================================================== -->

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package tech.cassandre.trading.bot.batch;

import tech.cassandre.trading.bot.dto.position.PositionDTO;
import tech.cassandre.trading.bot.dto.position.PositionStatusDTO;
import tech.cassandre.trading.bot.service.PositionService;
import tech.cassandre.trading.bot.util.base.BaseFlux;

Expand All @@ -18,7 +19,7 @@ public class PositionFlux extends BaseFlux<PositionDTO> {
private final PositionService positionService;

/** Previous values. */
private final Map<Long, PositionDTO> previousValues = new LinkedHashMap<>();
private final Map<Long, PositionStatusDTO> previousValues = new LinkedHashMap<>();

/**
* Constructor.
Expand All @@ -38,10 +39,10 @@ protected final Set<PositionDTO> getNewValues() {
// Finding which positions has been updated.
positionService.getPositions().forEach(position -> {
getLogger().debug("PositionFlux - Treating position : {}", position.getId());
PositionDTO existingPosition = previousValues.get(position.getId());
if (existingPosition == null || !existingPosition.equals(position)) {
PositionStatusDTO previousPosition = previousValues.get(position.getId());
if (previousPosition == null || !previousPosition.equals(position.getStatus())) {
getLogger().debug("PositionFlux - Flux {} has changed : {}", position.getId(), position);
previousValues.put(position.getId(), position);
previousValues.put(position.getId(), position.getStatus());
newValues.add(position);
}
});
Expand Down
Loading

0 comments on commit fb7ad89

Please sign in to comment.