Netanelshoshan / freqAI-LSTM

A Trading Model Utilizing a Dynamic Weighting and Aggregate Scoring System with LSTM Networks
MIT License
81 stars 25 forks source link

Only short #7

Closed shj00007 closed 1 month ago

shj00007 commented 2 months ago

Hello, I used your demo to perform backtesting over multiple time periods and found that the backtesting results only generated short positions. Could this be due to a restriction in the code, or is there an issue with the strategy?

Vintelligence commented 2 months ago

I have this issue as well. This explains why my backtesting didn't show any trades that were made Netanel :)

I have set 'can_short' to false.

shj00007 commented 2 months ago

@Vintelligence Has this strategy been used in live trading? I am planning to test it in real trading.

Vintelligence commented 2 months ago

@shj00007 , these model and strategy have not been used by me to do live trading. I would like to see positive backtest results first.

shj00007 commented 2 months ago

@Vintelligence I will try to be an adventurer, and I will give you feedback.

shj00007 commented 2 months ago

@Vintelligence I see that the threshold_buy variable in the ExampleLSTMStrategy is always set to 0. Is this correct? Is it part of the intended strategy, or is it unfinished?

Vintelligence commented 1 month ago

@shj00007 In the ExampleLSTMStrategy in this GitHub I can see that the threshold_buy variable is set to about 0.59, not to 0?

shj00007 commented 1 month ago

@shj00007 In the ExampleLSTMStrategy in this GitHub I can see that the threshold_buy variable is set to about 0.59, not to 0?

@Vintelligence Does freqai automatically perform Hyperopt? I didn't see buy_param being called.

Vintelligence commented 1 month ago

@shj00007 , I actually don't know. I think the threshold_buy variable is used in the LSTMExampleStrategy in the populate_enty_trend and populate_exit_trend functions?

@Netanelshoshan or @ylck , hope to hear from one of you regarding the issue where the strategy is not making trades when can_short is set to false. Any help would be greatly appreciated. :)

Netanelshoshan commented 1 month ago

Hi @shj00007

  1. The uploaded strategy is an example. It generates only short signals bc you should fine-tune the weights.

  2. This repo was initially a Tensorflow plugin for Freqtrade then I ported it to PyTorch and was served as a "how to". The example strategy was something I uploaded bc asked to give an example.

I highly recommend you rewrite the strategy, fine-tune the weights with one of the loss-functions that Freqtrade offer or implement a custom one yourself (they use scikit-learn in the backend).

As much as all of us wants to find the perfect strategy - ALWAYS test your strategy before you push it to prod (aka live).