SCM

SCM Repository

[blotter] View of /pkg/quantstrat/demo/luxor.getSymbols.R
ViewVC logotype

View of /pkg/quantstrat/demo/luxor.getSymbols.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1469 - (download) (annotate)
Thu May 16 15:28:47 2013 UTC (6 years, 2 months ago) by opentrades
File size: 949 byte(s)
- to.minutes30() was called twice

#!/usr/bin/Rscript --vanilla
#
# Jan Humme (@opentrades) - August 2012, revised April 2013
#
# Tested and found to work correctly using blotter r1457
#
# After Jaekle & Tamasini: A new approach to system development and portfolio optimisation (ISBN 978-1-905641-79-6)
#
# loading symbol data

Sys.setenv(TZ="UTC")

### packages
#
# quantstrat package will pull in some other packages:
# FinancialInstrument, quantmod, blotter, xts

require(quantstrat)

### FinancialInstrument

currency(c('GBP', 'USD'))

exchange_rate('GBPUSD', tick_size=0.0001)

### quantmod

getSymbols.FI(Symbols='GBPUSD',
	      dir=system.file('extdata',package='quantstrat'),
#	      dir='~/R/OHLC',
	      from=.from, to=.to
)

# ALTERNATIVE WAY TO FETCH SYMBOL DATA
#setSymbolLookup.FI(system.file('extdata',package='quantstrat'), 'GBPUSD')
#getSymbols('GBPUSD', from=.from, to=.to, verbose=FALSE)

### xts

GBPUSD = to.minutes30(GBPUSD)
GBPUSD = align.time(GBPUSD, 1800)


root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge