132 Commits

Author SHA1 Message Date
Saleh Mir
9d95c82982 implement order.is_stop_loss and order.is_take_profit properties 2022-02-21 10:20:49 +01:00
Saleh Mir
fe74aadc15 Revert "Sourcery (#316)"
This reverts commit cff9e69446.
2022-02-14 13:56:57 +01:00
Markus K
cff9e69446 Sourcery (#316)
* Sourcery

* Fix failure

* Refactor
2022-02-11 17:34:40 +01:00
Saleh Mir
6299fdca96 make should_short and go_short optional 2022-02-06 08:54:17 +01:00
Saleh Mir
75c0416dc9 Strategy execution for update_position is paused for 3 seconds if an order execution event was received before update_position was called 2022-02-01 09:40:21 +01:00
Saleh Mir
02830c5b1d improve termination message for strategies 2022-01-26 17:49:42 +01:00
Saleh Mir
d9f383cb74 add unit tests for isolated backtest() 2022-01-21 16:14:11 +01:00
Saleh Mir
6f45550a26 rename positions => all_positions 2022-01-16 09:29:36 +01:00
Saleh Mir
9fede6adae rename fake_range_candle => range_candles and fake_range_candle_from_range_prices => candles_from_close_prices 2022-01-14 11:59:42 +01:00
Saleh Mir
2875954713 fix and error when handling rejected orders 2022-01-13 11:07:02 +01:00
Saleh Mir
f782a40de3 improve handling of take_profit and stop_loss on open-position event 2022-01-12 14:31:33 +01:00
Saleh Mir
fc25d48ccc add support for cancelling entry orders in update_position() 2022-01-07 09:46:21 +01:00
Saleh Mir
b8a1f131f3 rename _open_position_orders => _entry_orders and _close_position_orders => _exit_orders 2022-01-06 15:33:08 +01:00
Saleh Mir
704acb01b2 fix an issue in updating _open_position_orders 2022-01-06 15:31:35 +01:00
Saleh Mir
8629922e0b add positions and portfolio_value properties to the Strategy class 2021-12-30 17:45:49 +01:00
Saleh Mir
de5cb75e09 fix "'NoneType' object has no attribute 'orders'" error 2021-11-25 17:33:10 +03:30
Saleh Mir
ffbfe03e60 Merge branch 'master' into dashboard 2021-11-11 16:22:29 +03:30
Saleh Mir
beea05cd15 implement setting dna using the dna() method in the strategy file instead 2021-11-09 13:14:56 +03:30
Saleh Mir
57e60a9042 notify on self.log 2021-11-08 20:10:19 +03:30
Markus
ba244d3b01 Merge duplicate blocks in conditional(merge-duplicate-blocks)
Remove redundant conditional(remove-redundant-if)
Replace multiple comparisons of same variable with `in` operator(merge-comparisons)
2021-11-07 12:59:48 +01:00
Markus
2c14305de7 Merge duplicate blocks in conditional(merge-duplicate-blocks)
Remove redundant conditional(remove-redundant-if)
Replace multiple comparisons of same variable with `in` operator(merge-comparisons)
2021-11-07 12:26:27 +01:00
Saleh Mir
704d5a9e48 replace broker.stop_loss_at usage with broker.reduce_position_at which is smarter 2021-10-23 21:45:18 +02:00
Saleh Mir
183557e4b1 round exiting orders to be MARKET orders if the price diff is very tiny 2021-10-23 21:24:23 +02:00
Saleh Mir
f1a0f5992c Merge branch 'master' into dashboard 2021-10-11 19:54:20 +02:00
Saleh Mir
5a83331bc0 add support for unit testing the live-trade plugin 2021-10-09 20:32:04 +02:00
Saleh Mir
09a16501ee implement "PARTIAL_FILLED" support 2021-10-09 19:39:17 +02:00
Saleh Mir
448face575 make self._open_position_orders and self._close_position_orders list again 2021-10-09 18:23:46 +02:00
Saleh Mir
713b7cc7a1 Merge branch 'refactor-closing-order-handling' 2021-10-09 16:11:13 +02:00
Saleh Mir
a718d1f03e for small price differences, use a MARKET order 2021-10-09 12:23:55 +02:00
Saleh Mir
2f72a1a285 add useful comments 2021-10-07 17:17:33 +02:00
Saleh Mir
f0fb5dc53a make self.log() a static method 2021-10-07 16:40:16 +02:00
Saleh Mir
acac321259 refactor _open_position_orders: use dict instead fo list 2021-10-07 16:39:22 +02:00
Saleh Mir
14b1b9441f replace on_take_profit and on_stop_loss with on_position_close 2021-10-07 16:12:04 +02:00
Markus
b3e29d4703 Only calculate smart sharpe and sortino in the final report. 2021-10-04 12:00:28 +02:00
Saleh Mir
94914ad2ce Merge branch 'master' into dashboard 2021-09-23 11:54:03 +02:00
Markus
afcdc2e018 Fix typing. 2021-09-17 14:03:18 +02:00
Markus
0e62855aa5 Add typing. 2021-09-17 13:54:13 +02:00
Saleh Mir
01eb8c46c4 improve handling of rejected orders 2021-09-16 16:34:29 +02:00
Saleh Mir
1a8dfca8f7 Refactors for exchange handling 2021-09-12 17:44:29 +02:00
Markus
89ac1ce260 Pycharm inspection. 2021-07-26 16:33:25 +02:00
Markus
5fae57fdc9 pyupgrade --py37-plus 2021-07-25 11:27:06 +02:00
Markus
eb6809f8a2 Sourcery optimize 2021-07-25 11:00:50 +02:00
Saleh Mir
2f7f177244 redo tests to work with routes refactor 2021-07-05 20:11:28 +04:30
Saleh Mir
31eed9c650 remove @cached decorator's uses in Strategy API 2021-05-31 18:13:09 +04:30
Saleh Mir
ab98621835 add self.log() method to Strategy API 2021-05-27 13:11:16 +04:30
Saleh Mir
a723380469 refactor lru_cache 2021-05-24 12:45:28 +04:30
Saleh Mir
e9adb55941 remove unnecessary cachings 2021-05-24 12:35:08 +04:30
Saleh Mir
d349f53a2b add support for the liquidation_price of positions in live mode 2021-05-24 11:11:38 +04:30
Saleh Mir
f4c377ee40 implement mark_price, funding_rate, next_funding_timestamp properties 2021-05-23 18:03:51 +04:30
Saleh Mir
02d08d817b placeholder for tests for cross mode 2021-05-22 21:03:33 +04:30