6
9

More than 1 year has passed since last update.

強化学習を使ってfx取引を学習する

Last updated at Posted at 2022-02-23

作ったもの

fxの過去のデータを利用して強化学習を使って自動取引を学習させること目標にします。詳しいコードは上記のリポジトリを参照してください。

データの準備

  1. Mettrader5をインストールします
  2. デモアカウントかリアルアカウントを作成します
  3. pythonでMetatrader5パッケージをインストールします
pip install Metatrader5

そして以下のコードを実行します。

cd data
python gen_data.py

実行

from agent import dqn
agent = dqn.Agent(model_name="efficientnet_b0", s=5, action_type=3, pip_scale=1, n=1, loss_cut=False, use_device="tpu", dueling=False)

agent.run()
agent.plot_result(w=self.best_w, risk=0.04, s=self.s)

結果

これは違うデータによるものです
FireShot Capture 002 - forex-trading_dqn.ipynb at main · nagikomo_forex-trading - github.com.png

6
9
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
9