Skip to content

Commit 406cb31

Browse files
committed
Merge branch 'release/5.0.3'
2 parents e2e8c6f + f8446be commit 406cb31

File tree

180 files changed

+1611
-666
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+1611
-666
lines changed

docs/src/.vuepress/config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ module.exports = {
104104
text: 'Deploy & run',
105105
ariaLabel: 'Deploy & run',
106106
items: [
107-
{text: 'Using Docker', link: '/deploy-and-run/docker'},
108-
{text: 'Using Qovery', link: '/deploy-and-run/qovery'},
107+
{text: 'Using Docker', link: '/deploy-and-run/docker'}
109108
]
110109
},
111110
{
@@ -131,7 +130,6 @@ module.exports = {
131130
{
132131
text: 'How-tos', items: [
133132
{text: 'Install development tools', link: '/ressources/how-tos/how-to-install-development-tools'},
134-
{text: 'Install terraform', link: '/ressources/how-tos/how-to-install-terraform'},
135133
{text: 'Build from sources', link: '/ressources/how-tos/how-to-build-from-sources'},
136134
{text: 'Create a release', link: '/ressources/how-tos/how-to-create-a-release'},
137135
{text: 'Create a Kucoin account', link: '/ressources/how-tos/how-to-create-a-kucoin-account'},

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ tagline: Create your java crypto trading bot in minutes
55
actionText: Quick Start
66
actionLink: /learn/quickstart
77
features:
8-
- title: Get into trading with Minimum fuss
8+
- title: Get into trading with minimum fuss
99
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.
1010
- title: Create your strategy in minutes
1111
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).

docs/src/learn/dry-mode-and-backtesting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ You can use the dry mode to test your trading bot with real data, but you can al
3131
## Backtesting
3232
In simple words, backtesting a strategy is the process of testing a trading strategy on prior time periods. Cassandre trading bot allows you to simulate your bots' reaction to historical data during tests.
3333

34-
The first step is to add [cassandre-trading-bot-spring-boot-starter-test](https://mvnrepository.com/artifact/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-starter-test) to your project dependency.
34+
The first step is to add [cassandre-trading-bot-spring-boot-starter-test](https://search.maven.org/search?q=a:cassandre-trading-bot-spring-boot-starter-test) to your project dependency.
3535

3636
Edit your `pom.xml` file and add this dependency :
3737

732 Bytes
Loading

docs/src/learn/position-management.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ At this moment, Cassandre will create a buy order of 0.5 ETH (1 ETH costs 1500 U
3030
Note: if you want to check if you have enough funds available (at least 750 USDT in our case) before creating the position, you can use the [canBuy()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/strategy/GenericCassandreStrategy.html#canBuy%28tech.cassandre.trading.bot.dto.user.AccountDTO,tech.cassandre.trading.bot.dto.util.CurrencyPairDTO,java.math.BigDecimal%29) method.
3131
:::
3232

33-
From now on, for every ticker received, Cassandre will automatically calculate, with the new price, if closing the position at that price would trigger one of our two rules (100% stop gain and 50% stop loss).
33+
From now on, for every ticker received, Cassandre will automatically calculate, with the new price (from the ticker), if closing the position at that price would trigger one of our two rules (100% stop gain and 50% stop loss).
3434

3535
For example, if we receive a new price of 3000 USDT for 1 ETH, Cassandre will calculate that if we sell our position right now (meaning "closing the position"), we will get 1 500 USDT, a 100% gain. As our rule is triggered, Cassandre will automatically create a selling order of our 0.5 ETH. The position status will move to [CLOSING](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/dto/position/PositionStatusDTO.html#CLOSING), and when all the corresponding trades have arrived, the status will move to [CLOSED](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/dto/position/PositionStatusDTO.html#CLOSED).
3636

@@ -52,9 +52,9 @@ Note: if you want to check if you have enough funds available (at 1 ETH in our c
5252
:::
5353

5454
## Gains
55-
On a position you can get the:
56-
* The lowest calculated gain with [getLowestPrice()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/dto/position/PositionDTO.html#getLowestCalculatedGain())
57-
* The highest calculated gain with [getHighestGainPrice()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/dto/position/PositionDTO.html#getHighestGainPrice())
58-
* The latest calculated gain with [getLatestGainPrice](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/dto/position/PositionDTO.html#getLatestGainPrice())
55+
On Positions, you can get the:
56+
* The lowest calculated gain with [getLowestCalculatedGain()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/dto/position/PositionDTO.html#getLowestCalculatedGain())
57+
* The highest calculated gain with [getHighestCalculatedGain()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/dto/position/PositionDTO.html#getHighestCalculatedGain())
58+
* The latest calculated gain with [getLatestCalculatedGain()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/dto/position/PositionDTO.html#getLatestCalculatedGain())
5959

60-
Once the position is closed, you can get the final gain & fees with [getGain()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/dto/position/PositionDTO.html#getGain())
60+
On a closed position, you can get the gain & fees with [getGain()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/dto/position/PositionDTO.html#getGain())

docs/src/learn/quickstart.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mvn archetype:generate \
1717

1818
It will ask for the following parameters:
1919

20-
| Parameters | Description | Examples |
20+
| Parameters | Description | Example values |
2121
| :--- | :--- | :--- |
2222
| groupId | The id of the project's group | com.mycompany.app |
2323
| artifactId | The id of the artifact (project) | my-app |
@@ -71,7 +71,7 @@ cassandre.trading.bot.exchange.secret=af080d55-afe3-47c9-8ec1-4b479fbcc5e7
7171
cassandre.trading.bot.exchange.modes.sandbox=true
7272
cassandre.trading.bot.exchange.modes.dry=false
7373
#
74-
# Exchange API calls rates (ms or standard ISO 8601 duration like 'PT5S').
74+
# Exchange API calls rates (In ms or standard ISO 8601 duration like 'PT5S').
7575
cassandre.trading.bot.exchange.rates.account=2000
7676
cassandre.trading.bot.exchange.rates.ticker=2000
7777
cassandre.trading.bot.exchange.rates.trade=2000
@@ -142,9 +142,8 @@ public final class SimpleStrategy extends BasicCassandreStrategy {
142142

143143
@Override
144144
public Optional<AccountDTO> getTradeAccount(Set<AccountDTO> accounts) {
145-
// From all the accounts retrieved by the server, we return the one we used for trading.
145+
// From all the accounts we have on the exchange, we must return the one we use for trading.
146146
if (accounts.size() == 1) {
147-
// Used for Gemini integration tests.
148147
return accounts.stream().findAny();
149148
} else {
150149
return accounts.stream()
@@ -161,7 +160,7 @@ public final class SimpleStrategy extends BasicCassandreStrategy {
161160

162161
@Override
163162
public final void onTickersUpdates(final Map<CurrencyPairDTO, TickerDTO> tickers) {
164-
// Here we will receive tickers received.
163+
// Here we will receive all tickers we required from the exchange.
165164
tickers.values().forEach(ticker -> System.out.println("Received information about a ticker : " + ticker));
166165
}
167166

@@ -197,10 +196,10 @@ A Cassandre strategy is a class annotated with [@CassandreStrategy](https://www.
197196

198197
This is how it works :
199198

200-
* In [getRequestedCurrencyPairs()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/strategy/CassandreStrategyInterface.html#getRequestedCurrencyPairs%28%29), you have to return the list of currency pairs updates you want to receive from the exchange.
201-
* On the exchange, you usually have several accounts, and Cassandre needs to know which one of your accounts is the trading one. To do so, you have to implement the [getTradeAccount()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/strategy/CassandreStrategyInterface.html#getTradeAccount%28java.util.Set%29) method, which gives you as a parameter the list of accounts you own, and from that list, you have to return only one.
199+
* In [getRequestedCurrencyPairs()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/strategy/CassandreStrategyInterface.html#getRequestedCurrencyPairs%28%29), you give to Cassandre the list of currency pairs updates you want to receive from the exchange.
200+
* On the exchange, you usually have several accounts, and Cassandre needs to know which one of your accounts is the trading one. To do so, you have to implement the [getTradeAccount()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/strategy/CassandreStrategyInterface.html#getTradeAccount%28java.util.Set%29) method, which gives you as a parameter the list of accounts you own, and from that list, you have to return the one you use for trading.
202201
* If there is a change in your account data, [onAccountsUpdates()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/strategy/GenericCassandreStrategy.html#onAccountsUpdates(java.util.Map)) will be called.
203-
* When a new ticker is available, [onTickersUpdates()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/strategy/GenericCassandreStrategy.html#onTickersUpdates(java.util.Map)) will be called.
202+
* When new tickers are available, [onTickersUpdates()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/strategy/GenericCassandreStrategy.html#onTickersUpdates(java.util.Map)) will be called.
204203
* If there is a change in your orders, [onOrdersUpdates()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/strategy/GenericCassandreStrategy.html#onOrdersUpdates(java.util.Map)) will be called.
205204
* If there is a change in your trades, [onTradesUpdates()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/strategy/GenericCassandreStrategy.html#onTradesUpdates(java.util.Map)) will be called.
206205
* If there is a change in your positions, [onPositionsUpdates()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/strategy/GenericCassandreStrategy.html#onPositionsUpdates(java.util.Map)) will be called.
@@ -226,7 +225,7 @@ This is the list of available methods :
226225
Inside your strategy, you can call [canBuy()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/strategy/GenericCassandreStrategy.html#canBuy%28tech.cassandre.trading.bot.dto.user.AccountDTO,tech.cassandre.trading.bot.dto.util.CurrencyPairDTO,java.math.BigDecimal%29) and [canSell()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/strategy/GenericCassandreStrategy.html#canSell%28tech.cassandre.trading.bot.dto.util.CurrencyDTO,java.math.BigDecimal%29) methods to see if your account has enough money to buy or sell assets.
227226
:::
228227

229-
Cassandre trading bot also provides positions to manage your trade automatically :
228+
Cassandre trading bot also provides positions to manage your trade automatically:
230229

231230
```java
232231
// Create rule.
@@ -240,7 +239,7 @@ createLongPosition(new CurrencyPairDTO(BTC, USDT),
240239
rules);
241240
```
242241

243-
First, we created a rule saying this position should be closed if the gain is more than 10% or if the loss is more than 5%.
242+
First, we created a [rule](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/dto/position/PositionRulesDTO.html) saying this position should be closed if the gain is more than 10% or if the loss is more than 5%.
244243

245244
Then we called the [createLongPosition()](https://www.javadoc.io/doc/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-autoconfigure/latest/tech/cassandre/trading/bot/strategy/GenericCassandreStrategy.html#createLongPosition(tech.cassandre.trading.bot.dto.util.CurrencyPairDTO,java.math.BigDecimal,tech.cassandre.trading.bot.dto.position.PositionRulesDTO)) method. This will automatically create a buy order. From now, for every ticker received, Cassandre will check the gain or loss made on this position; if it triggers one of the rules, Cassandre will automatically create a sell order to close the position.
246245

docs/src/learn/technical-analysis.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ On the exchange, you usually have several accounts, and Cassandre needs to know
139139
```java
140140
@Override
141141
public Optional<AccountDTO> getTradeAccount(Set<AccountDTO> accounts) {
142-
// From all the accounts retrieved by the server, we return the one we used for trading.
142+
// From all the accounts we have on the exchange, we must return the one we use for trading.
143143
if (accounts.size() == 1) {
144144
return accounts.stream().findAny();
145145
} else {

docs/src/ressources/how-tos/how-to-create-a-release.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
## Prepare the release
44
* Fix [Codacy](https://app.codacy.com/gh/cassandre-tech/cassandre-trading-bot/issues) & Intellij warnings.
55
* Update [security.md](https://github.com/cassandre-tech/cassandre-trading-bot/blob/development/SECURITY.md).
6-
* Update libraries used by archetypes:
7-
* [trading-bot-archetypes/basic-archetype/src/main/resources/archetype-resources/pom.xml](https://github.com/cassandre-tech/cassandre-trading-bot/blob/development/trading-bot-archetypes/basic-archetype/src/main/resources/archetype-resources/pom.xml).
8-
* [trading-bot-archetypes/basic-ta4j-archetype/src/main/resources/archetype-resources/pom.xml](https://github.com/cassandre-tech/cassandre-trading-bot/blob/development/trading-bot-archetypes/basic-ta4j-archetype/src/main/resources/archetype-resources/pom.xml).
96

107
## Create the release with Maven
118
You must be using `ssh` and not `https`. To switch to `ssh`, type :

docs/src/why-cassandre/features-and-roadmap.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Features & roadmap
22

33
* [Create and execute your strategies in minutes](../learn/quickstart.md).
4-
* Available as a [Spring boot starter](https://mvnrepository.com/artifact/tech.cassandre.trading.bot/cassandre-trading-bot-spring-boot-starter).
5-
* Connect to several cryptocurrency exchanges thanks to [XChange](https://github.com/knowm/XChange).
4+
* Available as a [Spring boot starter](https://search.maven.org/search?q=g:%22tech.cassandre.trading.bot%22%20AND%20a:%22cassandre-trading-bot-spring-boot-starter%22).
5+
* Connect to several cryptocurrency exchanges thanks to [XChange](../why-cassandre/supported-cryptocurrency-exchanges.md).
66
* User, accounts, and balances management with real-time market data.
77
* Buy / Sell market & limit orders.
88
* [Automatic position management](../learn/position-management.md) (with stop gain & stop loss rules).

0 commit comments

Comments
 (0)