nateemma / strategies

Custom trading strategies using the freqtrade framework
318 stars 85 forks source link

TS_Coeff_DWT exception #39

Closed vinters768 closed 9 months ago

vinters768 commented 9 months ago

Hey, thanks for sharing your work with us, helped me a great deal to understand ML and data analysis in more detail.

Saw that you pushed in a new strategy, seemed quite interesting, but when I tried running a dry run got the following exceptions:

freqtrade | 2023-11-13 19:40:06,085 - freqtrade.strategy.interface - WARNING - Unable to analyze candle (OHLCV) data for pair BTC/USDT:USDT: could not broadcast input array from shape (998,) into shape (1000,) freqtrade | 2023-11-13 19:40:06,162 - freqtrade.strategy.strategy_wrapper - WARNING - Strategy caused the following exception: could not broadcast input array from shape (998,) into shape (1000,)<bound method IStrategy._analyze_ticker_internal of <TS_Coeff_DWT.TS_Coeff_DWT object at 0x7f5c66d241d0>> freqtrade | 2023-11-13 19:40:06,163 - freqtrade.strategy.interface - WARNING - Unable to analyze candle (OHLCV) data for pair ETH/USDT:USDT: could not broadcast input array from shape (998,) into shape (1000,) freqtrade | 2023-11-13 19:40:06,239 - freqtrade.strategy.strategy_wrapper - WARNING - Strategy caused the following exception: could not broadcast input array from shape (998,) into shape (1000,)<bound method IStrategy._analyze_ticker_internal of <TS_Coeff_DWT.TS_Coeff_DWT object at 0x7f5c66d241d0>> freqtrade | 2023-11-13 19:40:06,239 - freqtrade.strategy.interface - WARNING - Unable to analyze candle (OHLCV) data for pair SOL/USDT:USDT: could not broadcast input array from shape (998,) into shape (1000,) freqtrade | 2023-11-13 19:40:06,315 - freqtrade.strategy.strategy_wrapper - WARNING - Strategy caused the following exception: could not broadcast input array from shape (998,) into shape (1000,)<bound method IStrategy._analyze_ticker_internal of <TS_Coeff_DWT.TS_Coeff_DWT object at 0x7f5c66d241d0>>

Found that this can be fixed by removing -1 in build_coefficient_table function: ` def build_coefficient_table(self, data: np.array):

    # roll through the  data and create coefficients for each step
    nrows = np.shape(data)[0]

    # print(f'build_coefficient_table() data:{np.shape(data)}')

    start = 0
    if nrows > self.model_window:
        end = start + self.model_window - 1 ==> HERE
    else:
        end = start + 32
    dest = end`

But then got this:

freqtrade | 2023-11-13 19:44:08,891 - freqtrade.strategy.interface - WARNING - Unable to analyze candle (OHLCV) data for pair BTC/USDT:USDT: X has 179 features, but SGDRegressor is expecting 176 features as input. freqtrade | 2023-11-13 19:44:08,959 - freqtrade.strategy.strategy_wrapper - WARNING - Strategy caused the following exception: X has 179 features, but SGDRegressor is expecting 176 features as input.<bound method IStrategy._analyze_ticker_internal of <TS_Coeff_DWT.TS_Coeff_DWT object at 0x7fb1ee379b10>> freqtrade | 2023-11-13 19:44:08,960 - freqtrade.strategy.interface - WARNING - Unable to analyze candle (OHLCV) data for pair ETH/USDT:USDT: X has 179 features, but SGDRegressor is expecting 176 features as input. freqtrade | 2023-11-13 19:44:09,025 - freqtrade.strategy.strategy_wrapper - WARNING - Strategy caused the following exception: X has 179 features, but SGDRegressor is expecting 176 features as input.<bound method IStrategy._analyze_ticker_internal of <TS_Coeff_DWT.TS_Coeff_DWT object at 0x7fb1ee379b10>> freqtrade | 2023-11-13 19:44:09,026 - freqtrade.strategy.interface - WARNING - Unable to analyze candle (OHLCV) data for pair SOL/USDT:USDT: X has 179 features, but SGDRegressor is expecting 176 features as input. freqtrade | 2023-11-13 19:44:09,086 - freqtrade.strategy.strategy_wrapper - WARNING - Strategy caused the following exception: X has 179 features, but SGDRegressor is expecting 176 features as input.<bound method IStrategy._analyze_ticker_internal of <TS_Coeff_DWT.TS_Coeff_DWT object at 0x7fb1ee379b10>>

Tried bunch of things to trim down the features list, but with no luck. Any suggestion would be great.

Also tried retraining the model to use with futures pair list, as I believe you are testing with spot pairs, but that does not seem to affect the model either.

Thanks,

Kris

nateemma commented 9 months ago

yes, I'm in the middle of testing a fix for that. The issue is that (in live mode) freqtrade passes in bigger dataframes each time, and I was expecting a fixed size dataframe. Update should be available in the next day or so

Cheers,

Phil

On Mon, Nov 13, 2023 at 11:47 AM Kristaps Vinters @.***> wrote:

Hey, thanks for sharing your work with us, helped me a great deal to understand ML and data analysis in more detail.

Saw that you pushed in a new strategy, seemed quite interesting, but when I tried running a dry run got the following exceptions:

freqtrade | 2023-11-13 19:40:06,085 - freqtrade.strategy.interface - WARNING - Unable to analyze candle (OHLCV) data for pair BTC/USDT:USDT: could not broadcast input array from shape (998,) into shape (1000,) freqtrade | 2023-11-13 19:40:06,162 - freqtrade.strategy.strategy_wrapper - WARNING - Strategy caused the following exception: could not broadcast input array from shape (998,) into shape (1000,)<bound method IStrategy._analyze_ticker_internal of <TS_Coeff_DWT.TS_Coeff_DWT object at 0x7f5c66d241d0>> freqtrade | 2023-11-13 19:40:06,163 - freqtrade.strategy.interface - WARNING - Unable to analyze candle (OHLCV) data for pair ETH/USDT:USDT: could not broadcast input array from shape (998,) into shape (1000,) freqtrade | 2023-11-13 19:40:06,239 - freqtrade.strategy.strategy_wrapper - WARNING - Strategy caused the following exception: could not broadcast input array from shape (998,) into shape (1000,)<bound method IStrategy._analyze_ticker_internal of <TS_Coeff_DWT.TS_Coeff_DWT object at 0x7f5c66d241d0>> freqtrade | 2023-11-13 19:40:06,239 - freqtrade.strategy.interface - WARNING - Unable to analyze candle (OHLCV) data for pair SOL/USDT:USDT: could not broadcast input array from shape (998,) into shape (1000,) freqtrade | 2023-11-13 19:40:06,315 - freqtrade.strategy.strategy_wrapper - WARNING - Strategy caused the following exception: could not broadcast input array from shape (998,) into shape (1000,)<bound method IStrategy._analyze_ticker_internal of <TS_Coeff_DWT.TS_Coeff_DWT object at 0x7f5c66d241d0>>

Found that this can be fixed by removing -1 in build_coefficient_table function: ` def build_coefficient_table(self, data: np.array):

# roll through the  data and create coefficients for each step
nrows = np.shape(data)[0]

# print(f'build_coefficient_table() data:{np.shape(data)}')

start = 0
if nrows > self.model_window:
    end = start + self.model_window - 1 ==> HERE
else:
    end = start + 32
dest = end`

But then got this:

freqtrade | 2023-11-13 19:44:08,891 - freqtrade.strategy.interface - WARNING - Unable to analyze candle (OHLCV) data for pair BTC/USDT:USDT: X has 179 features, but SGDRegressor is expecting 176 features as input. freqtrade | 2023-11-13 19:44:08,959 - freqtrade.strategy.strategy_wrapper - WARNING - Strategy caused the following exception: X has 179 features, but SGDRegressor is expecting 176 features as input.<bound method IStrategy._analyze_ticker_internal of <TS_Coeff_DWT.TS_Coeff_DWT object at 0x7fb1ee379b10>> freqtrade | 2023-11-13 19:44:08,960 - freqtrade.strategy.interface - WARNING - Unable to analyze candle (OHLCV) data for pair ETH/USDT:USDT: X has 179 features, but SGDRegressor is expecting 176 features as input. freqtrade | 2023-11-13 19:44:09,025 - freqtrade.strategy.strategy_wrapper - WARNING - Strategy caused the following exception: X has 179 features, but SGDRegressor is expecting 176 features as input.<bound method IStrategy._analyze_ticker_internal of <TS_Coeff_DWT.TS_Coeff_DWT object at 0x7fb1ee379b10>> freqtrade | 2023-11-13 19:44:09,026 - freqtrade.strategy.interface - WARNING - Unable to analyze candle (OHLCV) data for pair SOL/USDT:USDT: X has 179 features, but SGDRegressor is expecting 176 features as input. freqtrade | 2023-11-13 19:44:09,086 - freqtrade.strategy.strategy_wrapper - WARNING - Strategy caused the following exception: X has 179 features, but SGDRegressor is expecting 176 features as input.<bound method IStrategy._analyze_ticker_internal of <TS_Coeff_DWT.TS_Coeff_DWT object at 0x7fb1ee379b10>>

Tried bunch of things to trim down the features list, but with no luck. Any suggestion would be great.

Also tried retraining the model to use with futures pair list, as I believe you are testing with spot pairs, but that does not seem to affect the model either.

Thanks,

Kris

— Reply to this email directly, view it on GitHub https://github.com/nateemma/strategies/issues/39, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABD4X5527375IMYHLL2AXTTYEJ2NDAVCNFSM6AAAAAA7JVULPKVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE4TCMZWGEYTAMY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

nateemma commented 9 months ago

FYI, this has been fixed

On Mon, Nov 13, 2023 at 11:52 AM Phil Price @.***> wrote:

yes, I'm in the middle of testing a fix for that. The issue is that (in live mode) freqtrade passes in bigger dataframes each time, and I was expecting a fixed size dataframe. Update should be available in the next day or so

Cheers,

Phil

On Mon, Nov 13, 2023 at 11:47 AM Kristaps Vinters < @.***> wrote:

Hey, thanks for sharing your work with us, helped me a great deal to understand ML and data analysis in more detail.

Saw that you pushed in a new strategy, seemed quite interesting, but when I tried running a dry run got the following exceptions:

freqtrade | 2023-11-13 19:40:06,085 - freqtrade.strategy.interface - WARNING - Unable to analyze candle (OHLCV) data for pair BTC/USDT:USDT: could not broadcast input array from shape (998,) into shape (1000,) freqtrade | 2023-11-13 19:40:06,162 - freqtrade.strategy.strategy_wrapper - WARNING - Strategy caused the following exception: could not broadcast input array from shape (998,) into shape (1000,)<bound method IStrategy._analyze_ticker_internal of <TS_Coeff_DWT.TS_Coeff_DWT object at 0x7f5c66d241d0>> freqtrade | 2023-11-13 19:40:06,163 - freqtrade.strategy.interface - WARNING - Unable to analyze candle (OHLCV) data for pair ETH/USDT:USDT: could not broadcast input array from shape (998,) into shape (1000,) freqtrade | 2023-11-13 19:40:06,239 - freqtrade.strategy.strategy_wrapper - WARNING - Strategy caused the following exception: could not broadcast input array from shape (998,) into shape (1000,)<bound method IStrategy._analyze_ticker_internal of <TS_Coeff_DWT.TS_Coeff_DWT object at 0x7f5c66d241d0>> freqtrade | 2023-11-13 19:40:06,239 - freqtrade.strategy.interface - WARNING - Unable to analyze candle (OHLCV) data for pair SOL/USDT:USDT: could not broadcast input array from shape (998,) into shape (1000,) freqtrade | 2023-11-13 19:40:06,315 - freqtrade.strategy.strategy_wrapper - WARNING - Strategy caused the following exception: could not broadcast input array from shape (998,) into shape (1000,)<bound method IStrategy._analyze_ticker_internal of <TS_Coeff_DWT.TS_Coeff_DWT object at 0x7f5c66d241d0>>

Found that this can be fixed by removing -1 in build_coefficient_table function: ` def build_coefficient_table(self, data: np.array):

# roll through the  data and create coefficients for each step
nrows = np.shape(data)[0]

# print(f'build_coefficient_table() data:{np.shape(data)}')

start = 0
if nrows > self.model_window:
    end = start + self.model_window - 1 ==> HERE
else:
    end = start + 32
dest = end`

But then got this:

freqtrade | 2023-11-13 19:44:08,891 - freqtrade.strategy.interface - WARNING - Unable to analyze candle (OHLCV) data for pair BTC/USDT:USDT: X has 179 features, but SGDRegressor is expecting 176 features as input. freqtrade | 2023-11-13 19:44:08,959 - freqtrade.strategy.strategy_wrapper - WARNING - Strategy caused the following exception: X has 179 features, but SGDRegressor is expecting 176 features as input.<bound method IStrategy._analyze_ticker_internal of <TS_Coeff_DWT.TS_Coeff_DWT object at 0x7fb1ee379b10>> freqtrade | 2023-11-13 19:44:08,960 - freqtrade.strategy.interface - WARNING - Unable to analyze candle (OHLCV) data for pair ETH/USDT:USDT: X has 179 features, but SGDRegressor is expecting 176 features as input. freqtrade | 2023-11-13 19:44:09,025 - freqtrade.strategy.strategy_wrapper - WARNING - Strategy caused the following exception: X has 179 features, but SGDRegressor is expecting 176 features as input.<bound method IStrategy._analyze_ticker_internal of <TS_Coeff_DWT.TS_Coeff_DWT object at 0x7fb1ee379b10>> freqtrade | 2023-11-13 19:44:09,026 - freqtrade.strategy.interface - WARNING - Unable to analyze candle (OHLCV) data for pair SOL/USDT:USDT: X has 179 features, but SGDRegressor is expecting 176 features as input. freqtrade | 2023-11-13 19:44:09,086 - freqtrade.strategy.strategy_wrapper - WARNING - Strategy caused the following exception: X has 179 features, but SGDRegressor is expecting 176 features as input.<bound method IStrategy._analyze_ticker_internal of <TS_Coeff_DWT.TS_Coeff_DWT object at 0x7fb1ee379b10>>

Tried bunch of things to trim down the features list, but with no luck. Any suggestion would be great.

Also tried retraining the model to use with futures pair list, as I believe you are testing with spot pairs, but that does not seem to affect the model either.

Thanks,

Kris

— Reply to this email directly, view it on GitHub https://github.com/nateemma/strategies/issues/39, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABD4X5527375IMYHLL2AXTTYEJ2NDAVCNFSM6AAAAAA7JVULPKVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE4TCMZWGEYTAMY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

vinters768 commented 9 months ago

Thanks, can confirm that it's working as expected.