diff --git a/build_helpers/pyarrow-18.1.0-cp311-cp311-linux_armv7l.whl b/build_helpers/pyarrow-19.0.0-cp311-cp311-linux_armv7l.whl similarity index 61% rename from build_helpers/pyarrow-18.1.0-cp311-cp311-linux_armv7l.whl rename to build_helpers/pyarrow-19.0.0-cp311-cp311-linux_armv7l.whl index d40603a5f1d..dbd6ba99191 100644 Binary files a/build_helpers/pyarrow-18.1.0-cp311-cp311-linux_armv7l.whl and b/build_helpers/pyarrow-19.0.0-cp311-cp311-linux_armv7l.whl differ diff --git a/docs/strategy-callbacks.md b/docs/strategy-callbacks.md index 54b73a3f386..64f7987f606 100644 --- a/docs/strategy-callbacks.md +++ b/docs/strategy-callbacks.md @@ -774,6 +774,11 @@ The combined stake currently allocated to the position is held in `trade.stake_a Same thing also can happen with partial exit. So be sure to have a strict logic and/or check for the last filled order. +!!! Warning "Performance with many position adjustments" + Position adjustments can be a good approach to increase a strategy's output - but it can also have drawbacks if using this feature extensively. + Each of the orders will be attached to the trade object for the duration of the trade - hence increasing memory usage. + Trades with long duration and 10s or even 100ds of position adjustments are therefore not recommended, and should be closed at regular intervals to not affect performance. + !!! Warning "Backtesting" During backtesting this callback is called for each candle in `timeframe` or `timeframe_detail`, so run-time performance will be affected. This can also cause deviating results between live and backtesting, since backtesting can adjust the trade only once per candle, whereas live could adjust the trade multiple times per candle. @@ -810,11 +815,6 @@ Back to the example above, since current rate is 200, the current USDT value of While `/stopentry` command stops the bot from entering new trades, the position adjustment feature will continue buying new orders on existing trades. -!!! Warning "Performance with many position adjustments" - Position adjustments can be a good approach to increase a strategy's output - but it can also have drawbacks if using this feature extensively. - Each of the orders will be attached to the trade object for the duration of the trade - hence increasing memory usage. - Trades with long duration and 10s or even 100ds of position adjustments are therefore not recommended, and should be closed at regular intervals to not affect performance. - ``` python # Default imports diff --git a/requirements.txt b/requirements.txt index 96105420835..825f43355b9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -24,7 +24,7 @@ pycoingecko==3.2.0 jinja2==3.1.5 joblib==1.4.2 rich==13.9.4 -pyarrow==18.1.0; platform_machine != 'armv7l' +pyarrow==19.0.0; platform_machine != 'armv7l' # find first, C search in arrays py_find_1st==1.1.7 diff --git a/tests/exchange/test_exchange_ws.py b/tests/exchange/test_exchange_ws.py index f7775b4d7af..a9f5f227691 100644 --- a/tests/exchange/test_exchange_ws.py +++ b/tests/exchange/test_exchange_ws.py @@ -67,12 +67,12 @@ async def test_exchangews_ohlcv(mocker, time_machine): async def sleeper(*args, **kwargs): # pass - await asyncio.sleep(1) + await asyncio.sleep(0.12) return MagicMock() ccxt_object.watch_ohlcv = AsyncMock(side_effect=sleeper) ccxt_object.close = AsyncMock() - time_machine.move_to("2024-11-01 01:00:00 +00:00") + time_machine.move_to("2024-11-01 01:00:02 +00:00") mocker.patch("freqtrade.exchange.exchange_ws.ExchangeWS._start_forever", MagicMock()) @@ -84,7 +84,7 @@ async def sleeper(*args, **kwargs): exchange_ws.schedule_ohlcv("ETH/BTC", "1m", CandleType.SPOT) exchange_ws.schedule_ohlcv("XRP/BTC", "1m", CandleType.SPOT) - await asyncio.sleep(0.5) + await asyncio.sleep(0.2) assert exchange_ws._klines_watching == { ("ETH/BTC", "1m", CandleType.SPOT), @@ -95,20 +95,21 @@ async def sleeper(*args, **kwargs): ("XRP/BTC", "1m", CandleType.SPOT), } await asyncio.sleep(0.1) - assert ccxt_object.watch_ohlcv.call_count == 2 + assert ccxt_object.watch_ohlcv.call_count == 6 ccxt_object.watch_ohlcv.reset_mock() time_machine.shift(timedelta(minutes=5)) - await asyncio.sleep(0.1) exchange_ws.schedule_ohlcv("ETH/BTC", "1m", CandleType.SPOT) - await asyncio.sleep(0.1) + await asyncio.sleep(1) # XRP/BTC should be cleaned up. assert exchange_ws._klines_watching == { ("ETH/BTC", "1m", CandleType.SPOT), } # Cleanup happened. - await asyncio.sleep(0.1) exchange_ws.schedule_ohlcv("ETH/BTC", "1m", CandleType.SPOT) + assert exchange_ws._klines_watching == { + ("ETH/BTC", "1m", CandleType.SPOT), + } assert exchange_ws._klines_scheduled == { ("ETH/BTC", "1m", CandleType.SPOT), }