Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finetuning and traning #1

Open
traderpedroso opened this issue Jun 17, 2024 · 4 comments
Open

Finetuning and traning #1

traderpedroso opened this issue Jun 17, 2024 · 4 comments

Comments

@traderpedroso
Copy link

Thank you for making this fascinating project available in a way that is applicable to LNN in the stock market. Is there any chance you could share the training code for testing with different assets?

@lorenzmeis
Copy link

please find here a notebook I used to train another ticker (SPY). Tested OK with app.py.
It is using the same model config as the AAPL and TSLA models. Based on it you should be able to train new ticker until Hussein releases his code.
I don`t fully understand the reasoning of the regularizer settings of the first Dense layer and how they were calculated.
Hoping that @HusseinJammal can give us some enlightenment here ;-)

model.add(Dense(
units=64,
activation='linear',
kernel_initializer=GlorotUniform(),
bias_initializer=Zeros(),
kernel_regularizer=L1L2(l1=9.999999747378752e-06, l2=9.999999747378752e-05),
bias_regularizer=L1L2(l2=9.999999747378752e-06),
activity_regularizer=L1L2(l1=9.999999747378752e-05),
name='dense'
))

@traderpedroso
Copy link
Author

please find here a notebook I used to train another ticker (SPY). Tested OK with app.py. It is using the same model config as the AAPL and TSLA models. Based on it you should be able to train new ticker until Hussein releases his code. I don`t fully understand the reasoning of the regularizer settings of the first Dense layer and how they were calculated. Hoping that @HusseinJammal can give us some enlightenment here ;-)

model.add(Dense( units=64, activation='linear', kernel_initializer=GlorotUniform(), bias_initializer=Zeros(), kernel_regularizer=L1L2(l1=9.999999747378752e-06, l2=9.999999747378752e-05), bias_regularizer=L1L2(l2=9.999999747378752e-06), activity_regularizer=L1L2(l1=9.999999747378752e-05), name='dense' ))

Thanks, buddy! I'm going to start implementing this right now. The cross-validation logs are giving me a good idea. I'll train it and integrate it into backtesting to see how it performs in a more realistic environment. I'll let you know if there are any updates and share the code.

@HusseinJammal
Copy link
Owner

Hello guys! @lorenzmeis @traderpedroso
First of all, thank you for your feedback and thanks @lorenzmeis for your contribution as well. I really appreciate it!
Regarding the training code, I'm sorry that I couldn't provide for two reasons:

  1. The institution I work with had some regulations regarding sharing the code and I didn't have permission to do so.
  2. The project is going under some advancements in the model (as a second phase)
    I hope you guys understand this case.

If you need more help or have any concerns, please do not hesitate to contact me.
I'd be happy to assist!

@traderpedroso
Copy link
Author

Thank you for the feedback, and no problem! I've made some progress on the code thanks to @lorenzmeis and of course, you @HusseinJammal. I'd like to share my progress in improvements. I did the following:

  • Removed all technical indicators and simply used Fibonacci as the base.
  • Instead of using it normally, I separated it into three parts: 0% (current price), -100%, +100%. This created a form of price range or channel.
  • I mentioned Fibonacci because I used the same calculations, but for different price areas with these three points.
  • I created what would be classes, not prices. These classes represent support and resistance and served as a basis for stop and take profit.
  • The results are astonishing. I had something similar with Transformer Quantiles, but the liquid NN proved much more efficient, especially for the short term.
  • Once I have a production-ready solution, I'll share the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants