TodoTrader의 DeepTrading with TensorFlow

1.
트레이딩과 관련한 글을 쓰는 블러거들도 시류에 따라 부침을 겪습니다. HFT가 각광을 받았던 때 자주 찾았던 곳들중 지금까지 남아 있는 곳은 거의 없습니다. 망하지 않을 것같았던 Lowlatency.com도 명맥이 끊어졌습니다. 요즘 많이 올라오는 글들은 기계학습과 관련한 곳들이 있습니다. 그중 두개를 소개합니다. 첫째 Robot Wealth입니다. R을 이용한 사례를 소개하고 있고 Zerro Platform을 이용하고 있습니다. 독일 스타트업으로 이해하는 Zorro Platform은 C문법을 이용하여 전략을 개발할 수 있도록 하는 환경을 제공합니다.

Deep Learning for Trading Part 1: Can it Work?
Deep Learning for Trading Part 2: Configuring TensorFlow and Keras to run on GPU
Deep Learning for Trading Part 3: Feed Forward Networks

Machine learning for Trading:What Does it Really Look Like?
Machine learning for Trading: Part 2

둘째는 TodoTrader입니다. 앞서 Robot Wealth가 R언어를 주로 사용한 것에 비하여 Python과 Tensorflow를 이용한 트레이딩시스템을 주로 다루고 있습니다. 여기도 아쉽게 19년말까지 글을 올라오다가 최근에는 뜸합니다. TodoTrader를 운영하는 사람은 Ramon Martin인데 기계학습(Python)과 관련한 교육이나 컨설팅을 하는 듯 합니다. 올라온 글들입니다.

먼저 DeepTrading with TensorFlow은 Tensorflow의 기본을 다룹니다. Tensorflow가 동작하는 흐름에 따라 간략한 설명을 제공합니다.

두번째 DeepTrading with TensorFlow II의 주제는 ‘How to create elemental NN(Neural Network) tensors in TensorFlow’입니다.
세번째 DeepTrading with TensorFlow III의 주제는 ‘Implementing a one hidden layer Neural Network’입니다.

네번째 DeepTrading with Tensorflow IV의 주제는 ‘Implementing a one hidden layer Neural Network with save and restore’입니다. 모델의 재사용이 가능한 Save와 Restore를 덧붙인 모형입니다.

The progress of the model can be saved during and after training. This means that a model can be resumed where it left off and avoid long training times. Saving also means that you can share your model and others can recreate your work.

다섯번째 Deep Trading with TensorFlow V의 주제는 ‘Implementing a multiple hidden layer Neural Network’입니다. 앞서 TensorFlow III가 One Hidden Layer과 비교해보시면 됩니다.

여섯번째부터는 앞서의 모형을 실제 금융시장에 적용하는 사례들입니다. 그중 첫번째는 DeepTrading with TensorFlow VI로 주제는 ‘Making the first prediction in the Forex Market’입니다. 두번째 시장은 금시장입니다. 일곱번째 DeepTrading with TensorFlow VII로 주제는 ‘Making prediction of GOLD price’로 금시장입니다.

이상의 주제와 관련한 Jupyter notebook용 파일들은 아래에서 확인하실 수 있습니다. 이상의 연재물과 관련한 프로젝트 소스는 DeepTrading를 참조하세요.

01_How_TensorFlow_Works.ipynb
02_Tensors.ipynb
03_One_Hidden_Layer_NN.ipynb
04_One_Hidden_Layer_NN_Save_Restore.ipynb
05_Multiple_Hidden_Layers_NN.ipynb
06_Multiple_Hidden_Layers_NN-Restoring_Model.ipynb
07_First_Forex_Prediction-240Min.ipynb
07_First_Forex_Prediction-60Min.ipynb
07_First_Forex_Prediction_15Min.ipynb
08_Gold_Prediction-60Min.ipynb

3.
이제 학습으로 획득한 지식을 실거래시스템에 적용할 차례입니다. 여덟번째 Deep Trading with TensorFlow VIII은 Deployment와 관련한 주제를 다록 있습니다. 제목은 ‘Trading system Tensorflow serving’입니다.

After training and testing your model, you had a great question: how will you deploy the model and make predictions for new data samples? Luckily for us, TensorFlow was developed for production, and it provides a robust solution for model deployment, known as TensorFlow Serving. In this approaching, we have three steps:

  • Export your model from Tensorflow for serving (production repository)
  • Create and launch a Docker container with your model (Tensorflow server for model hosting)
  • Deploy it with Kubernetes into a cloud platform, (example Google Cloud, Amazon AWS, or Azure Kubernetes Services AKS). This deployment option is more professional but not included in this tutorial.

관련한 소스는 https://github.com/parrondo/deeptrading-tfserving-python에서 확인하실 수 있습니다.

Production System을 구축하면 끝일까요? 아닙니다. 지금까지 수행했던 과정을 매일 혹은 매주 반복하여야 합니다. 학습해야 성장하는 시스템이니까 학습이 멈추면 지진아가 됩니다.(^^) 이와 관련한 주제를 다루는 글이 Deep Trading with TensorFlow: Recapitulating입니다.

In order to develop and manage a model ready for production in trading, you must work through the following stages:

  • Ingest data (Get and prepare your data.)
  • Implement the model (Develop your model.)
  • Train a machine learning model with your data:
    • Train the model
    • Evaluate the accuracy of the model
    • Adjust the hyper-parameters (with performance metrics)
  • Deploy your trained model.
  • Use the model (Send prediction requests to your model):
    • Online prediction
    • Batch Prediction
  • Monitor the predictions continuously.
  • Manage your models and their versions.

이상의 내용을 정리해서 논문으로 발표하였는데.. Cognitive Trading System Model입니다. 발표한 논문은  https://papers.ssrn.com/abstract=3450470입니다.

Download (PDF, Unknown)

Leave a Comment

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.