Giter VIP home page Giter VIP logo

trading-feature-pretrainer's Introduction

trading-feature-pretrainer

This repo contains code for generating pretrained networks equivalent to a wide variety of trading indicators, such as moving averages, MACD, RSI, and many more colorful metrics.

The goal of this project is to generate neural networks that act as function approximators for an arbitrary set of deterministic transformations relevant to forex/stock/derivative market trading. These generated networks should form the input layers to networks built for specific purposes, such as policy gradient reinforcement learning trading agents. Depending on the application, generated network weights should be either fixed, making the generated networks act as generators of known features, or trained further in an application-specific context.

Note that although for some indicators, neural networks are at best function approximators (e.g., simple moving averages), other indicators can be represented exactly using carefully chosen neural network architectures and weights (e.g., exponential moving averages and moving average convergence divergence).

A simple illustration

Consider an exponential moving average, implemented by the following recursive equation:

EMAα(t) = αx(t) + (1 - α)EMAα(t - 1)

  where α = 2/(N + 1) for window N.

An exactly equivalent RNN can be constructed using a single recurrent neuron. The neuron accepts a single input, x, the hidden state is equivalent to EMAα(t - 1), and the output is equivalent to EMAα(t). From inspection of the equation above, the input and hidden state weights for the neuron are α and 1 - α, respectively.

Similarly, since Moving Average Convergence Divergence is defined as the difference between two exponential moving averages of different window sizes (say α and β), the following RNN is exactly equivalent:

trading-feature-pretrainer's People

Contributors

timesler avatar

Watchers

James Cloos avatar

Forkers

praveen686

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.