-
-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
103 changed files
with
2,024 additions
and
1,128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
-Xmx2048m -Xms1024m -Djava.awt.headless=true | ||
-Xmx1024m -Xms1024m -Djava.awt.headless=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
||
|
@@ -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; | ||
|
||
|
@@ -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. | ||
* | ||
|
@@ -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 | ||
|
1 change: 1 addition & 0 deletions
1
spring-boot-starter-test/autoconfigure/src/test/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.