R and MongoDB, HDF - Matlab, R project and Python | futures.io
futures.io futures trading

Go Back   futures.io

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > Matlab, R project and Python

R and MongoDB, HDF
Started:April 28th, 2014 (02:46 AM) by wh Views / Replies:541 / 2
Last Reply:April 28th, 2014 (10:56 AM) Attachments:0

Welcome to futures.io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

R and MongoDB, HDF

Old April 28th, 2014, 02:46 AM   #1 (permalink)
Elite Member
Neubrandenburg, Germany
Futures Experience: Advanced
Platform: R
Favorite Futures: Stocks
wh's Avatar
Posts: 539 since Jun 2009
Thanks: 297 given, 474 received

R and MongoDB, HDF

With MongoDB you can store EOD and TickData. This is the NoSQL Approach. For Testing you can install yfinanceMongo from Github. The following code gets data from mongo and create a xts for charting or analysis.

symbol <- 'aapl' 
  host <- "localhost:27017"
  username <- ""
  password <- ""
  db <- "yfmongo"
  mongo <- mongo.create(host=host , db=db, username=username, password=password)
  date <- open <- high <- low <- close <- volume <- NULL;
  cursor = mongo.find(mongo, 'yfmongo.timeline',list(sym=symbol),,list(d=1L,o=1L,h=1L,l=1L,c=1L,v=1L))
  while (mongo.cursor.next(cursor)) {
    l = mongo.bson.to.list(mongo.cursor.value(cursor))
    date <- rbind(date,l$d)
    open <- rbind(open,l$o)
    high <- rbind(high,l$h)
    low <- rbind(low,l$l)
    close <- rbind(close,l$c)
    volume <- rbind(volume,l$v)
  data <- data.frame(date = as.Date(date,"%d/%m/%Y"), open = as.numeric(open), high = as.numeric(high), low = as.numeric(low), close = as.numeric(close), volume = as.numeric(volume))
  data <- data[with(data,order(date)),]
 xdata <- xts(data[,2:6], order.by=data$date)
At the time i loop the sp500 stocks for simple stock screening.

next i will test rhdf5 interface.

Best regards

Causality is the relationship between an event (the cause) and a second event (the effect), where the second event is a consequence of the first.
Reply With Quote
The following 2 users say Thank You to wh for this post:

Old April 28th, 2014, 02:46 AM   #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.


Old April 28th, 2014, 10:56 AM   #3 (permalink)
Site Administrator
Manta, Ecuador
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
Big Mike's Avatar
Posts: 45,428 since Jun 2009
Thanks: 28,836 given, 79,550 received

@wh btw if you check:


Towards end of thread you'll see me testing various formats including HDF and my conclusions. Hint, I am not using HDF...


Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following user says Thank You to Big Mike for this post:


futures.io > Futures Trading, News, Charts and Platforms > Platforms and Indicators > Matlab, R project and Python > R and MongoDB, HDF

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

Corey Rosenbloom: Tips, Tactics, and Real Trades: Trading Intraday Trend Reversals

Elite only

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

All times are GMT -4. The time now is 10:53 AM.

Copyright © 2016 by futures.io. All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts

Page generated 2016-10-21 in 0.07 seconds with 18 queries on phoenix via your IP