Coder Social home page Coder Social logo

doo-forex's Introduction

doo-forex

DooPHP Forex backend for enyo-forex charting frontend

##Objective:

Load raw tick/quote data [realtime & historical] into a MySQL Database. API outputs JSON aggregated candlestick data, including custom technical analysis indicators. All candlestick time windows [s,m,h,d,w,M] are supported. Candlestick data is cached on demand in local Redis instance (in memory) except for weekly and monthly time windows.

  • Custom Indicators can be built by adding a new class/file:
doo-forex/protected/class/Technical Indicators/

###Quick Start:

##Installation:

  • Install dependancies:

    • MySQL Server 5.6+ [requires millisecond datetime]
    • Redis Server 2.4+ [used for in memory on demand cache]
    • screen [optional for running forex updater]
    • php-cli
    • php-pdo
    • php-mysql
  • Install Doo PHP Framework http://doophp.com/

  • Clone doo-forex and init submodules

git clone https://github.com/hurdad/doo-forex.git /usr/share/doo-forex
cd /usr/share/doo-forex/
git submodule update --init
  • Configure Doo Framework path:
vi doo-forex/protected/config/common.conf.php
$config['BASE_PATH'] = realpath('..').'/dooframework/';
  • Configure Apache alias:
vi /etc/httpd/conf.d/doo-forex.conf

Example configuration with install path : /usr/share/doo-forex and url : /doo-forex

Alias /doo-forex /usr/share/doo-forex
<Directory "/usr/share/doo-forex">
  AllowOverride All
</Directory>

Note: you will need to modify doo-forex/.htaccess 'RewriteBase' if you use another url

  • Install Database Schema
cd /usr/share/doo-forex
php install_db.php

##Backfill Historical Data [Optional]

cd /usr/share/doo-forex
php cli.php forex_loader /path/to/EURUSD.csv

Note: you will need to manually run hour & day aggregations for any backfill'd data

php cli.php quote_aggregator day EUR/USD '2012-01-01'

##Start Forex Update with hour and daily pre-aggregations enabled

cd /usr/share/doo-forex
screen -A -m -d -S forex php cli.php forex_update 1

##JSONP API Rotues

  • OHLC [open high low close] candle stick
http://localhost/doo-forex/ohlc?pair=EUR/USD&callback=myjsonpcallback
  • TA [technical analysis]
http://localhost/doo-forex/ta?function=RSI&pair=EUR/USD&callback=myjsonpcallback

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.