Coder Social home page Coder Social logo

komo135 / forex-trading Goto Github PK

View Code? Open in Web Editor NEW
15.0 1.0 6.0 20.46 MB

forex trading with reinforcement learning

Python 0.81% Jupyter Notebook 99.19%
fx forex trade trading reinforcement-learning rl tensorflow tensorflow2 python efficientnet

forex-trading's Introduction

Archived.

The new repository will be https://github.com/komo135/trade-rl.

Download Forex data

  1. Download Metatrader5 from this link and install.
  2. Verify that a demo account exists.
  3. If the demo account does not exist, create a demo account.
create-demo-account.mp4
  1. Go from Tools to Options (Ctr + o).
  2. Go to the chart bar and change Max bars in chart to unlimited.
change-max-bars-in-chart.mp4
  1. install Metatrader5 and ta package
$ pip install MetaTrader5 ta
  1. run generate_data.py
$ cd data
$ python generate_data.py

run agent

$ python
>>> 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.train()
>>>
>>> agent.plot_result(w=self.best_w, risk=0.04, s=self.s)

image

forex-trading's People

Contributors

komo135 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

forex-trading's Issues

'Agent' object has no attribute 'run'

Traceback (most recent call last):
File "C:\Users\Tomk Vu\Desktop\Forex\run.py", line 4, in
agent.run()
AttributeError: 'Agent' object has no attribute 'run'

Help! issues

Type "help", "copyright", "credits" or "license" for more information.

from agent import dqn
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Tomk Vu\Desktop\forex-trading-main\agent\dqn.py", line 5, in
import tensorflow as tf
File "C:\Users\Tomk Vu\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow_init_.py", line 24, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\Tomk Vu\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Tomk Vu\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Tomk Vu\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 114
def TFE_ContextOptionsSetAsync(arg1, async):
^
SyntaxError: invalid syntax

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.