Fix documentation brackets, add delete trade hints
This commit is contained in:
parent
86cf6201c8
commit
588043af86
@ -100,8 +100,8 @@ UPDATE trades
|
|||||||
SET is_open=0,
|
SET is_open=0,
|
||||||
close_date=<close_date>,
|
close_date=<close_date>,
|
||||||
close_rate=<close_rate>,
|
close_rate=<close_rate>,
|
||||||
close_profit=close_rate/open_rate-1,
|
close_profit = close_rate / open_rate - 1,
|
||||||
close_profit_abs = (amount * <close_rate> * (1 - fee_close) - (amount * open_rate * 1 - fee_open)),
|
close_profit_abs = (amount * <close_rate> * (1 - fee_close) - (amount * (open_rate * 1 - fee_open))),
|
||||||
sell_reason=<sell_reason>
|
sell_reason=<sell_reason>
|
||||||
WHERE id=<trade_ID_to_update>;
|
WHERE id=<trade_ID_to_update>;
|
||||||
```
|
```
|
||||||
@ -111,24 +111,39 @@ WHERE id=<trade_ID_to_update>;
|
|||||||
```sql
|
```sql
|
||||||
UPDATE trades
|
UPDATE trades
|
||||||
SET is_open=0,
|
SET is_open=0,
|
||||||
close_date='2017-12-20 03:08:45.103418',
|
close_date='2020-06-20 03:08:45.103418',
|
||||||
close_rate=0.19638016,
|
close_rate=0.19638016,
|
||||||
close_profit=0.0496,
|
close_profit=0.0496,
|
||||||
close_profit_abs = (amount * 0.19638016 * (1 - fee_close) - (amount * open_rate * 1 - fee_open))
|
close_profit_abs = (amount * 0.19638016 * (1 - fee_close) - (amount * open_rate * (1 - fee_open)))
|
||||||
sell_reason='force_sell'
|
sell_reason='force_sell'
|
||||||
WHERE id=31;
|
WHERE id=31;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Insert manually a new trade
|
## Manually insert a new trade
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
INSERT INTO trades (exchange, pair, is_open, fee_open, fee_close, open_rate, stake_amount, amount, open_date)
|
INSERT INTO trades (exchange, pair, is_open, fee_open, fee_close, open_rate, stake_amount, amount, open_date)
|
||||||
VALUES ('bittrex', 'ETH/BTC', 1, 0.0025, 0.0025, <open_rate>, <stake_amount>, <amount>, '<datetime>')
|
VALUES ('binance', 'ETH/BTC', 1, 0.0025, 0.0025, <open_rate>, <stake_amount>, <amount>, '<datetime>')
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Example:
|
### Insert trade example
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
INSERT INTO trades (exchange, pair, is_open, fee_open, fee_close, open_rate, stake_amount, amount, open_date)
|
INSERT INTO trades (exchange, pair, is_open, fee_open, fee_close, open_rate, stake_amount, amount, open_date)
|
||||||
VALUES ('bittrex', 'ETH/BTC', 1, 0.0025, 0.0025, 0.00258580, 0.002, 0.7715262081, '2017-11-28 12:44:24.000000')
|
VALUES ('binance', 'ETH/BTC', 1, 0.0025, 0.0025, 0.00258580, 0.002, 0.7715262081, '2020-06-28 12:44:24.000000')
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Remove trade from the database
|
||||||
|
|
||||||
|
Maybe you'd like to remove a trade from the database, because something went wrong.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
DELETE FROM trades WHERE id = <tradeid>;
|
||||||
|
```
|
||||||
|
|
||||||
|
```sql
|
||||||
|
DELETE FROM trades WHERE id = 31;
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! Warning
|
||||||
|
This will remove this trade from the database. Please make sure you got the correct id and **NEVER** run this query without the where clause.
|
||||||
|
Loading…
Reference in New Issue
Block a user