Commit Graph

612 Commits

Author SHA1 Message Date
Matthias
9c6a49436b Export amount/price precisions per trade 2023-03-25 11:42:19 +01:00
Matthias
62c8dd98d5 Use combination of thread-local and asyncio-aware session context 2023-03-18 19:28:22 +01:00
Matthias
b7709126f9 remove .query completely 2023-03-16 18:07:22 +01:00
Matthias
e579ff9532 Simplify pairlock querying 2023-03-16 06:48:12 +01:00
Matthias
ae361e1d5d Update more .query usages 2023-03-16 06:44:53 +01:00
Matthias
8865af9104 Remove .query from pairlock 2023-03-15 21:21:00 +01:00
Matthias
aa54b77702 Rename _session to sessoin 2023-03-15 21:12:06 +01:00
Matthias
8073989c98 Remove more usages of .query 2023-03-15 21:10:47 +01:00
Matthias
d45599ca3b Fix some type errors 2023-03-15 21:09:25 +01:00
Matthias
b469addffb remove usage of .query from regular models 2023-03-15 21:00:30 +01:00
Matthias
95ff59a21c Improve documentation for get_trades_proxy 2023-03-15 07:23:54 +01:00
Matthias
25fd4a04d6 Update sqlalchemy QueryPropertyDescriptor to match latest version 2023-03-06 06:34:37 +01:00
Matthias
f0cbb4f949 Expose relative realized profit 2023-03-04 18:20:31 +01:00
Matthias
c03c3a5706 improve order REPR display 2023-03-03 18:12:41 +01:00
Matthias
103bd9e2f2 keep Trade.session private 2023-03-02 07:26:50 +01:00
Matthias
b980f45b2b Fix test mypy errors 2023-03-02 06:23:01 +01:00
Matthias
f0f72fdd33 Don't define "mapped" on LocalTrade class 2023-03-01 20:32:32 +01:00
Matthias
388dfec50b Remove last type error 2023-03-01 20:32:32 +01:00
Matthias
874413ccc5 Fix some style violations 2023-03-01 20:32:32 +01:00
Matthias
4a35d32b6a Improve trade stop types 2023-03-01 20:32:32 +01:00
Matthias
a1166b1077 allow null fee on calc_base_close 2023-03-01 20:32:32 +01:00
Matthias
e5c9cde36f Update trades_proxy typing 2023-03-01 20:32:32 +01:00
Matthias
7c09c01788 Add some more typehints 2023-03-01 20:32:32 +01:00
Matthias
0f914cf2bd Use Mapped for LocalTrade
this won't initialize sqlalchemy, as the base class is not inheriting from sqlalchemy.
2023-03-01 20:32:32 +01:00
Matthias
d175ab495b Move SessionType to base module 2023-03-01 20:32:32 +01:00
Matthias
764001a4c2 Don't reuse variable 2023-03-01 20:32:32 +01:00
Matthias
b65cff0adc Update "Query" type 2023-03-01 20:32:32 +01:00
Matthias
db4f4498dc Experimentally type query property ... 2023-03-01 20:32:32 +01:00
Matthias
0691bbaad9 Update some db types 2023-03-01 20:32:32 +01:00
Matthias
101d9ab87f Improvements - tests runnable again 2023-03-01 20:32:32 +01:00
Matthias
65a5cf64df Re-type session 2023-03-01 20:32:32 +01:00
Matthias
608a7c2d38 Add safe_close_rate 2023-03-01 20:32:31 +01:00
Matthias
e59eaf33e0 Update _session to session 2023-03-01 20:32:31 +01:00
Matthias
47b66f3220 More fun with types 2023-03-01 20:32:31 +01:00
Matthias
491f49388c "Mapped" for trade_model 2023-03-01 20:32:31 +01:00
Matthias
bb116456a9 Update Types for Order object 2023-03-01 20:32:31 +01:00
Matthias
13b1a3e737 Properly pairlock columns using mapped 2023-03-01 20:32:31 +01:00
Matthias
98791752a9 Update TradeModels to mapped_column 2023-03-01 20:32:31 +01:00
Matthias
0bd9b00132 Pairlock to mappedColumn 2023-03-01 20:32:31 +01:00
Matthias
39a658eac2 Update DeclarativeBase 2023-03-01 20:32:31 +01:00
Matthias
3c019e0e16 tentative augmented typing of Trade object 2023-03-01 20:32:31 +01:00
Matthias
9d455f58b1 Improve some trade model Types 2023-03-01 20:32:31 +01:00
Matthias
829e10ff87 Improve Type for models.py 2023-03-01 20:32:31 +01:00
Matthias
b62830031f Dummy-type query objects 2023-03-01 20:32:31 +01:00
Matthias
a553a9923a Update types for pairlock 2023-03-01 20:32:31 +01:00
Matthias
f89b63b0c5 Fix dry-run stoploss orders filling "in place" after restart. 2023-02-18 19:25:11 +01:00
Matthias
81619fb4a0 Properly use sqlalchemy column types 2023-02-06 19:51:51 +01:00
Matthias
448505fbfb Fix minor issue where amount could be empty in rest calls 2023-01-31 20:38:18 +01:00
Matthias
020dc3c6e1 filled-date shouldn't update again 2023-01-27 20:21:29 +01:00
Matthias
8108a48f39 Follow PEP 484 - no implicit optionals 2023-01-21 20:01:56 +01:00
Matthias
305b067e48 Support having no Amount/Price available from the exchange initially 2023-01-08 13:55:09 +01:00
Matthias
fd694f14c2 Add new order columns, ft_amount and ft_price 2023-01-08 13:53:08 +01:00
Matthias
550ab2b8e8 Improve select_order to only consider filled where needed. 2023-01-08 11:24:04 +01:00
Matthias
cd4faa9c59 keep max_stake_amount through backtests 2022-12-27 18:08:20 +01:00
Matthias
62c4675e29 Remove some deprecated fields from the API 2022-12-27 14:28:07 +01:00
Matthias
cb66663fd2 show max_stake_amount in API 2022-12-27 14:28:07 +01:00
Matthias
55001bf321 Keep max_stake_amount (only relevant for DCA orders). 2022-12-27 14:28:07 +01:00
Matthias
bad6fe77d3 Remove deprecated trade property 2022-12-18 17:21:50 +01:00
Matthias
d73fd42769 Fix flake8 error introduced with 6.0 update 2022-11-28 06:38:35 +01:00
Matthias
436b314c80 add safe_remaining
fixes #7757
2022-11-17 19:07:47 +00:00
Matthias
afcb86f422 Improve migration types 2022-11-17 10:25:51 +00:00
Matthias
ee0e59157c Update join relationship of orders table to selectin
closes #6791 by slightly improving performance in this area.
2022-11-12 16:34:00 +01:00
Matthias
f43f967040 Improve handling of unfilled stoploss orders in edge-cases 2022-11-08 20:34:18 +01:00
Matthias
d1591883a6 add missing datetime conversion in fromJson 2022-10-21 07:01:47 +02:00
Matthias
bd424a877b Add Trade from_json method 2022-10-20 20:33:08 +02:00
Matthias
0e8cf366f5 Keep trade state in LocalTrade 2022-10-17 06:57:26 +02:00
Matthias
e82baf5f60 Use helper-method to modify trades_open 2022-10-16 16:45:16 +02:00
Matthias
063511826c Update stoploss on exchange logic
closes #7424
2022-09-17 17:11:00 +02:00
Matthias
9f266cbcb2 Allow safe_price for market stop orders 2022-09-17 17:11:00 +02:00
Matthias
16573b19e3 Fix migration syntax error 2022-09-03 19:51:44 +02:00
Matthias
ed4cc18cdd Migration to check order funding fee 2022-09-03 15:19:40 +02:00
Matthias
0f483ee31f Use "since last order" approach for live as well. 2022-09-03 15:01:42 +02:00
Matthias
df50b1928d Fix funding fee calculation for backtesting 2022-09-03 15:01:42 +02:00
Matthias
11fbfd3402 Remove unnecessary assignment 2022-09-01 19:39:20 +02:00
Matthias
6636f17e0f Simplify usage of amount_to_contract precision 2022-08-25 07:08:22 +02:00
Matthias
32faad9333 Fix backtest calculation problem with DCA
closes #7287
2022-08-24 20:36:08 +02:00
Matthias
fe7108ae75 Convert amount to contracts before comparing for close
closes #7279
2022-08-23 06:37:38 +02:00
Matthias
78b161e14c add contract_size to database 2022-08-23 06:37:38 +02:00
Matthias
87a3115073 Add get_open_trade_count() to simplify getting open trade count. 2022-08-21 17:08:27 +02:00
Matthias
42eb508515 Attempt fix of #7184 2022-08-19 07:09:46 +02:00
Matthias
76a3e97e05 Add migrations end message
closes #7251
2022-08-19 06:39:51 +02:00
Matthias
8d182768f9 stoploss should also use trimmed prices 2022-08-17 09:57:11 +02:00
Matthias
24690c1918 Don't convert open_rate to precision
this may cause more problems than it solves.
2022-08-16 18:32:00 +02:00
Matthias
3b44dc52e1 Minor corrections 2022-08-16 18:10:48 +02:00
Matthias
a73e4f8e41 Truncate amount before comparing for closure 2022-08-16 09:49:53 +02:00
Matthias
1dd56e35d5 Ensure comparisions align when closing a trade 2022-08-16 08:21:02 +02:00
Matthias
c3f159bd57 Add precision fields to database 2022-08-15 19:58:40 +02:00
Matthias
6c32331740 Move precision calculations to standalone functions 2022-08-15 08:43:58 +02:00
Matthias
e3a5b97b45 Update recalc_from_trades to use FtPrecise 2022-08-13 08:43:56 +02:00
Matthias
0e61c2d057 Replace Decimal with FtPrecise in trade_model 2022-08-13 08:43:56 +02:00
Matthias
bfa859e618 Remove unnecessary method (simplify) 2022-08-06 17:46:58 +02:00
Matthias
5250189f77 Add Rollback function to Trade
simplifies Session work
2022-08-06 17:03:49 +02:00
Matthias
d75e0a9820 Fix Flake8 errors after flake update 2022-08-01 06:43:59 +02:00
Kavinkumar
a4bada3ebe
Partial exit using average price (#6545)
Introduce Partial exits
2022-07-31 14:19:04 +02:00
Matthias
d046f0cc5e Improve method wording for liquidation price setter 2022-07-30 16:11:31 +02:00
Matthias
845cecd38f Add stoploss or liquidation property 2022-07-30 16:10:16 +02:00
Matthias
15752ce3c2 Rename set_stoploss method to be fully private 2022-07-30 16:10:16 +02:00
Matthias
9852733ef7 Improve tests to align with modified logic 2022-07-30 16:10:16 +02:00
Matthias
995be90f91 Liquidation should be a separate exit type 2022-07-30 16:10:16 +02:00
Matthias
b7167ec880 Fix wrong fee calclulation for gateio futures 2022-07-09 08:51:59 +02:00
Matthias
6f0721ae2b Update dry-order-fix to use sqlalchemy internals 2022-07-04 17:17:39 +02:00
Matthias
6da3fa08e4 Update migrations to also support Postgres
closes #7038
2022-07-04 11:14:59 +02:00
Matthias
53e5483daa Store StopPrice for dry-run orders
closes #6996
2022-06-22 06:31:51 +02:00
Matthias
0d967f93ba Improve performance of some RPC calls
These don't need orders to be loaded. As a side-effect, this will
also reduce the strain on the database.
2022-06-19 16:13:04 +02:00
Matthias
0168343b76 Add trading-volume to api schema 2022-06-18 16:53:25 +02:00
Matthias
40c9abc7e1 Add trading volume to /profit output 2022-06-18 11:40:32 +02:00
Matthias
6bdf9c2a94 Simplify trade profit calculations further 2022-06-17 11:17:05 +00:00
Matthias
91f9818ae3 Simplify trade calculations 2022-06-17 09:53:29 +00:00
Matthias
d7770c507b Remove implicit use of certain rates in profit calculations 2022-06-17 07:00:42 +00:00
Matthias
01a68e1060 Remove unnecessary check and condition 2022-06-13 20:48:49 +02:00
Matthias
d5fd1f9c38 Improve order filled handling 2022-06-13 13:24:48 +00:00
Matthias
79107fd062 Add minimal order object serialization 2022-06-05 22:12:27 +02:00
Matthias
8369d5bedd Include open orders in json responses 2022-06-05 22:12:27 +02:00
Matthias
c0ff554d5b Cleanup old, left open dry-run orders 2022-06-05 22:12:27 +02:00
Matthias
f709222943 Properly close out orders in backtesting 2022-06-05 22:12:27 +02:00
Matthias
b2968df5dc Fix some type problems 2022-05-25 10:13:37 +00:00
Matthias
46ea135b6b Update dry-run considerations 2022-05-19 20:10:11 +02:00
Matthias
56a73575a1 Add explicit test for order_to_ccxt 2022-05-19 19:29:39 +02:00
Matthias
a3d9384bc0 Remove clean-dry-run code 2022-05-19 06:56:34 +02:00
Matthias
0a95ef6ab2 Don't reset open orders in dry-run on restart 2022-05-19 06:42:38 +02:00
Matthias
18fd3bb333 Update stoploss handling for entry-order adjustment 2022-05-15 15:45:39 +02:00
eSeR1805
c27e0a0a1b
Allow SL refresh only if no filled entry orders. 2022-05-14 16:56:56 +03:00
eSeR1805
1c20fb7638
Refresh open_rate and stoploss on order replacement. 2022-05-14 16:37:04 +03:00
மனோஜ்குமார் பழனிச்சாமி
8a3c2c6cad
Corrected docstring
Discussed in Discord
2022-05-13 19:32:52 +05:30
Matthias
31cce741ac Add sequence migration 2022-05-10 07:13:51 +02:00
Matthias
0f499469fc
Merge pull request #6796 from freqtrade/model_reorg
Model reorg
2022-05-09 20:15:45 +02:00
Matthias
30d6eeffd0 Fix migration bug 2022-05-08 17:49:13 +02:00
Matthias
b58e811b14 Move trade/order Models to their own class 2022-05-08 17:45:20 +02:00
Matthias
af1a5e0449 Extract base and Pairlock from models file 2022-05-08 17:38:06 +02:00
Matthias
3221726d85 Update migration to use boolean value
closes #6794
2022-05-08 17:29:42 +02:00
Matthias
c9498d0117
Merge pull request #6692 from eSeR1805/feat_readjust_entry
Feature: Readjust Entry Order
2022-05-07 20:11:20 +02:00
Matthias
2da284b921 Properly type side for create_order 2022-05-07 10:02:54 +02:00
Matthias
2d9be6dace move open_rate updating to close_bt_order 2022-05-05 19:50:16 +02:00
eSeR1805
29f1edbde7
Cleanup. Remove stray new line. 2022-05-05 12:24:32 +03:00
eSeR1805
25c74e26d1
Models:Trade: Revert trade open_rate update. 2022-05-05 12:18:19 +03:00
eSeR1805
ae01afdd0f
Models:Trade: Fix open_rate updates. 2022-05-04 22:05:53 +03:00
eSeR1805
dbecc097df
Models:Trade: Update trade open_rate based on lastest order. 2022-05-04 21:34:45 +03:00
Matthias
995c48b642 Merge branch 'develop' into pairlocks_direction 2022-05-01 14:59:04 +02:00
Matthias
2ef1181e16 Simplify trade __repr__ 2022-04-28 07:33:30 +02:00
Matthias
737bdfe844 Use "side" parameter when calling Pairlocks 2022-04-24 14:33:24 +02:00
Matthias
b0a8bf3025 Show lock side 2022-04-24 14:33:24 +02:00
Matthias
4942d73693 update pairlock tests 2022-04-24 14:33:24 +02:00
Matthias
845f960a4e realign pairlock naming to side 2022-04-24 14:33:24 +02:00
Matthias
fc201bb4ff implement pairlock side further 2022-04-24 14:33:24 +02:00
Matthias
7c79d937e0 Properly type "side" parameter 2022-04-24 14:33:24 +02:00
Matthias
6ff3b178b0 Add direction column to pairlocks 2022-04-24 14:33:24 +02:00
Matthias
baefda80d1 Enable flake8 E226 rule 2022-04-11 18:02:06 +02:00
Matthias
77c840c2a4 Fix syntax-error in exit_reason migration 2022-04-10 15:10:13 +02:00
Matthias
850760bc00 Remove migration from very old database
(database without Orders table)
2022-04-10 08:43:30 +02:00
Matthias
8e98a2ff9f api - provide assset_currency via API 2022-04-09 16:42:18 +02:00