Coder Social home page Coder Social logo

bitcointrading's Introduction

BitcoinTrading

Bitcoin trading strategy wiht meXBT Exchange

  • License: GNU General Public License
  • Guadalajara, México

Bitcoin is more than just an efficient tool of making peer to peer payments, securly and instantly. Like other currencies, trading can be performed for hedging, arbitrage or speculative purposes. This code is shared for showing how to construct a very basic and yet profitable trading strategy, using the meXBT Bitcoin Exchange particularly the "BtcMxn" market.

Used R Packages

In order to list and load or if not install all the required r packages, the following code is used.

Pkg <- c("base","digest","downloader","fBasics","foreach","forecast","grid",
"gridExtra","ggplot2","httr","jsonlite","lubridate","moments",
"orderbook","PerformanceAnalytics","plyr","quantmod",
"Quandl","reshape2","RCurl","stats","scales","tseries","TTR","TSA",
"xts","zoo")

inst <- Pkg %in% installed.packages()
if(length(Pkg[!inst]) > 0) install.packages(Pkg[!inst])
instpackages <- lapply(Pkg, library, character.only=TRUE)

Support connections

This trading strategy uses several functions so with the finality to diversify some functions there are used other repositories:

Collect data

To collect data is as simple as one line per request, with the respect parameters to include.

BtcPair  <- OHLC(Instrmt,since,interval)
IPC <- OYStockD1("^IPC","yahoo",Sys.Date()-1000,Sys.Date())

Now we define the following

  • Existence: Relative Strength Index (RSI) technical indicator.
  • Phenomena: OverBought and OverSold levels/areas.
  • Parameter: Amount of historical prices, Back periods for calculation, Upper and Lower limits.
  • Variable Type: Endogenous.
  • Opportunity: Sell at OverBought / Buy at OverSold.

The following code

After this all the rest code is globally to calculate and plot the trading signal, then generates the table of strategy parameter and the table of performance summary, next the risk and performance measures are calculated to finally create the graphical summary and plot it.

Here is the output you should see: ArimaForecast

bitcointrading's People

Contributors

iffranciscome 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.