Git Product home page Git Product logo

fdrnn's Introduction

FDRNN

Implementing Deng, Y., Bao, F., Kong, Y., Ren, Z., & Dai, Q. (2016). Deep direct reinforcement learning for financial signal representation and trading. IEEE transactions on neural networks and learning systems, 28(3), 653-664.

Preparation

  1. Prepare the index data as CSV file. The file must include column CloseDiff, which represents the index difference CloseDiff[t] = Index[t] - Index[t-1]. The CSV files must arrange as following directory structure:
    +-- Data
    |    +-- futures
    |    |   +-- future_2018-01-01.csv
    |    |   +-- future_2018-01-02.csv
    |    |   +-- ...
    
  2. To reduce the training time, it is strongly recommended that computing the parameters of fuzzy representation before training. The vanilla index file can be transformed into fuzzy version via applying FuzzyStreamer in handler.py.
    from handler import FuzzyStreamer
    #streamer = FuzzyStreamer(<window size>, <fuzzy degree>)
    streamer = FuzzyStreamer(lag, fuzzy_degree)
    # streamer.transform(<folder of original index files>, <folder of fuzzy index files>)
    streamer = streamer.transform('./Data/futures/train', './Data/fuzzy_futures/train')
  3. Adjust the required parameters in config.ini
    [default]
    # Number of training epochs
    epochs = 1000
    # Save the model each n epochs
    save_per_epoch = 20
    # Transaction cost
    c = 0.05
    # Window size
    lag = 50
    # Data path
    data_src = ./Data
    # Log path
    log_src = ./Pickle
    
    [fddrl]
    fuzzy_degree = 3

Run

Running FDRNN - The proposed method in the paper

python main.py

Running baseline DDRL - The proposed model without fuzzy representation

python baseline_ddrl.py

Running baseline DRL - The proposed method without fuzzy representation and autoencoder

python baseline_drl.py

fdrnn's People

Contributors

pandede avatar

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.