Skip to content

Commit

Permalink
Merge branch 'release/3.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
straumat committed Oct 30, 2020
2 parents 665418e + 7adce15 commit af58bd7
Show file tree
Hide file tree
Showing 103 changed files with 2,024 additions and 1,128 deletions.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

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

**To Reproduce**
Steps to reproduce the behavior.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when...

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
2 changes: 1 addition & 1 deletion .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Xmx2048m -Xms1024m -Djava.awt.headless=true
-Xmx1024m -Xms1024m -Djava.awt.headless=true
67 changes: 67 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the Contributor Covenant.
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## How to contribute to Cassandre trading bot

### You fund a bug

* Do not open up a GitHub issue if the bug is a security vulnerability, and instead to refer to our [security policy](https://github.com/cassandre-tech/cassandre-trading-bot/blob/development/SECURITY.md).
* Ensure the bug was not already reported by searching on GitHub under [Issues](https://github.com/cassandre-tech/cassandre-trading-bot/issues).
* If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/cassandre-tech/cassandre-trading-bot/issues/new/choose). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring.

### You wrote a patch that fixes a bug

* Open a new GitHub pull request with the patch.
* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.

### You intend to add a new feature or change an existing one

* [Open a new issue](https://github.com/cassandre-tech/cassandre-trading-bot/issues/new/choose).

Thanks!

Cassandre team
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 |
| ------- | ------------------ |
| 3.x.x | :white_check_mark: |
| 2.x.x | :white_check_mark: |
| 1.0.x | :x: |
| 1.x.x | :x: |

## Reporting a Vulnerability

Expand Down
2 changes: 1 addition & 1 deletion 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.3.0</version>
<version>3.0.0</version>
<packaging>pom</packaging>
<name>Cassandre trading bot</name>
<url>https://github.com/cassandre-tech/cassandre-trading-bot</url>
Expand Down
2 changes: 1 addition & 1 deletion spring-boot-starter-test/autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
<parent>
<groupId>tech.cassandre.trading.bot</groupId>
<artifactId>cassandre-trading-bot-project</artifactId>
<version>2.3.0</version>
<version>3.0.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<!-- =========================================================================================================== -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private List<TickerDTO> getTickersFromFile(final Resource file) {
try (Scanner scanner = new Scanner(file.getFile())) {
while (scanner.hasNextLine()) {
try (Scanner rowScanner = new Scanner(scanner.nextLine())) {
if (file.getFilename().endsWith("tsv")) {
if (file.getFilename() != null && file.getFilename().endsWith("tsv")) {
rowScanner.useDelimiter("\t");
} else {
rowScanner.useDelimiter(",");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/**
* Cassandre trading bot.
*/
@SuppressWarnings("unused")
@SpringBootApplication
public class CassandreTradingBot {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
/**
* Testable strategy.
*/
@SuppressWarnings("unused")
@CassandreStrategy(name = "Testable strategy")
public final class TestableStrategy extends BasicCassandreStrategy {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@
import org.awaitility.Awaitility;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import tech.cassandre.trading.bot.dto.market.TickerDTO;
import tech.cassandre.trading.bot.dto.util.CurrencyPairDTO;

import java.math.BigDecimal;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Date;
import java.util.Optional;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;

Expand All @@ -20,65 +16,9 @@
/**
* Base for tests.
*/
@SuppressWarnings("unused")
public class BaseTest {

/** Ten seconds wait. */
protected static final long TEN_SECONDS = 10000L;

/** Invalid strategy enabled parameter. */
public static final String PARAMETER_INVALID_STRATEGY_ENABLED = "invalidStrategy.enabled";

/** Testable strategy enabled parameter. */
public static final String PARAMETER_TESTABLE_STRATEGY_ENABLED = "testableStrategy.enabled";

/** Testable ta4j strategy enabled parameter. */
public static final String PARAMETER_TESTABLE_TA4J_STRATEGY_ENABLED = "testableTa4jStrategy.enabled";

/** Testable strategy enabled parameter. */
public static final String PARAMETER_TESTABLE_STRATEGY_DEFAULT_VALUE = "true";

/** Invalid strategy enabled parameter. */
public static final String PARAMETER_INVALID_STRATEGY_DEFAULT_VALUE = "false";

/** Exchange name parameter. */
public static final String PARAMETER_NAME_DEFAULT_VALUE = "kucoin";

/** Sandbox parameter. */
public static final String PARAMETER_SANDBOX_DEFAULT_VALUE = "true";

/** Dry parameter. */
public static final String PARAMETER_DRY_DEFAULT_VALUE = "false";

/** Username parameter. */
public static final String PARAMETER_USERNAME_DEFAULT_VALUE = "[email protected]";

/** Passphrase parameter. */
public static final String PARAMETER_PASSPHRASE_DEFAULT_VALUE = "cassandre";

/** Key parameter. */
public static final String PARAMETER_KEY_DEFAULT_VALUE = "5df8eea30092f40009cb3c6a";

/** Secret parameter. */
public static final String PARAMETER_SECRET_DEFAULT_VALUE = "5f6e91e0-796b-4947-b75e-eaa5c06b6bed";

/** Rate for account parameter. */
public static final String PARAMETER_RATE_ACCOUNT_DEFAULT_VALUE = "100";

/** Rate for account parameter (long value). */
public static final String PARAMETER_RATE_ACCOUNT_LONG_VALUE = "PT5S";

/** Rate for ticker parameter. */
public static final String PARAMETER_RATE_TICKER_DEFAULT_VALUE = "101";

/** Rate for ticker parameter (long value). */
public static final String PARAMETER_RATE_TICKER_LONG_VALUE = "PT5S";

/** Rate for trade parameter. */
public static final String PARAMETER_RATE_TRADE_DEFAULT_VALUE = "102";

/** Rate for trade parameter (long value). */
public static final String PARAMETER_RATE_TRADE_LONG_VALUE = "PT5S";

/** How much we should wait for tests until it ends. */
protected static final long MAXIMUM_RESPONSE_TIME_IN_SECONDS = 60;

Expand All @@ -103,37 +43,6 @@ protected final Logger getLogger() {
return logger;
}

/**
* Util method to return a fake ticker.
*
* @param cp currency pair
* @param bid bid price
* @return ticket
*/
protected static Optional<TickerDTO> getFakeTicker(final CurrencyPairDTO cp, final BigDecimal bid) {
return Optional.of(TickerDTO.builder()
.currencyPair(cp)
.timestamp(getRandomDate())
.bid(bid)
.create());
}

/**
* Util method to return a fake ticker with date.
*
* @param timestamp timestamp
* @param cp currency pair
* @param bid bid price
* @return ticket
*/
protected static Optional<TickerDTO> getFakeTicker(final Date timestamp, final CurrencyPairDTO cp, final BigDecimal bid) {
return Optional.of(TickerDTO.builder()
.currencyPair(cp)
.timestamp(timestamp)
.bid(bid)
.create());
}

/**
* Get random date.
*
Expand All @@ -152,17 +61,6 @@ public static Date getRandomDate() {
return new Date(randomMillisSinceEpoch);
}

/**
* Get exception message from parameter exception.
*
* @param e exception
* @return message
*/
protected String getParametersExceptionMessage(Exception e) {
return e.getCause().getCause().getCause().getMessage();
}


/**
* Generate a date in 2020 with a day.
* @param day day
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# suppress inspection "UnusedProperty" for whole file
#
# Exchange configuration.
cassandre.trading.bot.exchange.name=kucoin
Expand Down
2 changes: 1 addition & 1 deletion spring-boot-starter-test/starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
<parent>
<groupId>tech.cassandre.trading.bot</groupId>
<artifactId>cassandre-trading-bot-project</artifactId>
<version>2.3.0</version>
<version>3.0.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<!-- =========================================================================================================== -->
Expand Down
4 changes: 2 additions & 2 deletions spring-boot-starter/autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-bom</artifactId>
<version>Dysprosium-SR12</version>
<version>Dysprosium-SR13</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -278,7 +278,7 @@
<parent>
<groupId>tech.cassandre.trading.bot</groupId>
<artifactId>cassandre-trading-bot-project</artifactId>
<version>2.3.0</version>
<version>3.0.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<!-- =========================================================================================================== -->
Expand Down
Loading

0 comments on commit af58bd7

Please sign in to comment.