You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ tagline: Create your java crypto trading bot in minutes
5
5
actionText: Quick Start
6
6
actionLink: /learn/quickstart
7
7
features:
8
-
- title: Get into trading with Minimum fuss
8
+
- title: Get into trading with minimum fuss
9
9
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.
10
10
- title: Create your strategy in minutes
11
11
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).
Copy file name to clipboardExpand all lines: docs/src/learn/dry-mode-and-backtesting.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ You can use the dry mode to test your trading bot with real data, but you can al
31
31
## Backtesting
32
32
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.
33
33
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.
35
35
36
36
Edit your `pom.xml` file and add this dependency :
Copy file name to clipboardExpand all lines: docs/src/learn/position-management.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ At this moment, Cassandre will create a buy order of 0.5 ETH (1 ETH costs 1500 U
30
30
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.
31
31
:::
32
32
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).
34
34
35
35
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).
36
36
@@ -52,9 +52,9 @@ Note: if you want to check if you have enough funds available (at 1 ETH in our c
52
52
:::
53
53
54
54
## 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())
59
59
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())
// Here we will receive all tickers we required from the exchange.
165
164
tickers.values().forEach(ticker ->System.out.println("Received information about a ticker : "+ ticker));
166
165
}
167
166
@@ -197,10 +196,10 @@ A Cassandre strategy is a class annotated with [@CassandreStrategy](https://www.
197
196
198
197
This is how it works :
199
198
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.
202
201
* 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.
204
203
* 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.
205
204
* 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.
206
205
* 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 :
226
225
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.
227
226
:::
228
227
229
-
Cassandre trading bot also provides positions to manage your trade automatically:
228
+
Cassandre trading bot also provides positions to manage your trade automatically:
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%.
244
243
245
244
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.
Copy file name to clipboardExpand all lines: docs/src/why-cassandre/features-and-roadmap.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Features & roadmap
2
2
3
3
*[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).
6
6
* User, accounts, and balances management with real-time market data.
7
7
* Buy / Sell market & limit orders.
8
8
*[Automatic position management](../learn/position-management.md) (with stop gain & stop loss rules).
0 commit comments