Professional Documents
Culture Documents
Strategies with R
3rd April 2014
Agenda
Overview of Mango
Data Analytics
Introduction to Backtesting
The Backtesting Project
Leveraging Oracle R Enterprise
Summary
Mango in a nutshell
Providers of analytic products and services
Specialise in analytic application development
Unique mix of business-focused statisticians and
mainstream software developers
Private company founded in 2002
Offices in UK & China
Global Team of 65 and expanding
ISO 9001 Accredited
Partner with Oracle on R project
Data Analytics
Data Analytics
Companies are awash with structured and
unstructured data
The insight locked in this data can help us to
make better decisions and gain a competitive
advantage
Data Analytics can help to extract the key
information from our data
Introduction to Backtesting
Introduction to Backtesting
Algorithmic trading makes up a large % of market
trades
Backtesting is the process of testing a trading
strategy using historical data
Allows the development of an automated trading
strategy
Backtesting Example
Backtest!!
Backtesting Example
Long
Short
Graphical User
Interface
Scripting
Interface
Analytic
Engine
Analytic Code
MgMent UI
Graphical User
Interface
Scripting
Interface
Analytic
Engine
Analytic Code
MgMent UI
Graphical User
Interface
Scripting
Interface
Analytic
Engine
Analytic Code
MgMent UI
Graphical User
Interface
Scripting
Interface
Analytic
Engine
Analytic Code
MgMent UI
Scripting
Interface
Analytic
Engine
Bespoke C
Graphical User
Interface
Analytic Code
MgMent UI
ORE Functions
> apropos("^ore")
[1] "OREShowDoc"
[5] "ore.corr"
[9] "ore.datastoreSummary"
[13] "ore.doEval"
[17] "ore.exists"
[21] "ore.getXlevels"
[25] "ore.groupApply"
[29] "ore.indexApply"
[33] "ore.load"
[37] "ore.minute"
[41] "ore.odmAssocRules"
[45] "ore.odmNB"
[49] "ore.predict"
[53] "ore.push"
[57] "ore.rm"
[61] "ore.rollsd"
[65] "ore.save"
[69] "ore.showHiveOptions"
[73] "ore.sync"
[77] "ore.year"
"ore.attach"
"ore.create"
"ore.delete"
"ore.drop"
"ore.frame"
"ore.getXnlevels"
"ore.hash"
"ore.is.connected"
"ore.ls"
"ore.month"
"ore.odmDT"
"ore.odmNMF"
"ore.pull"
"ore.push"
"ore.rollmax"
"ore.rollsum"
"ore.scriptCreate"
"ore.sort"
"ore.tableApply"
"oreOut"
"ore.connect"
"ore.crosstab"
"ore.detach"
"ore.esm"
"ore.freq"
"ore.glm"
"ore.hiveOptions"
"ore.lazyLoad"
"ore.make.names"
"ore.neural"
"ore.odmGLM"
"ore.odmOC"
"ore.pull"
"ore.rank"
"ore.rollmean"
"ore.rollvar"
"ore.scriptDrop"
"ore.stepwise"
"ore.toXML"
"ore.const"
"ore.datastore"
"ore.disconnect"
"ore.exec"
"ore.get"
"ore.glm.control"
"ore.hour"
"ore.lm"
"ore.mday"
"ore.odmAI"
"ore.odmKMeans"
"ore.odmSVM"
"ore.pull"
"ore.recode"
"ore.rollmin"
"ore.rowApply"
"ore.second"
"ore.summary"
"ore.univariate"
}
> loadRdaObject
function(fileName, category = "RawData", dataMethod = .backTest$dataMethod, ) {
get(ore.load(returnObject))
> ore.datastoreSummary("RAWDATA_PRICE")
object.name class
size length row.count col.count
1
getIt matrix 34776172 4336119
3917
1107
"RAWDATA_FISCALYR1"
"RAWDATA_HIGHY1"
"RAWDATA_IH7Y1"
"ore.attach"
"ore.create"
"ore.delete"
"ore.drop"
"ore.frame"
"ore.getXnlevels"
"ore.hash"
"ore.is.connected"
"ore.ls"
"ore.month"
"ore.odmDT"
"ore.odmNMF"
"ore.pull"
"ore.push"
"ore.rollmax"
"ore.rollsum"
"ore.scriptCreate"
"ore.sort"
"ore.tableApply"
"ore.connect"
"ore.crosstab"
"ore.detach"
"ore.esm"
"ore.freq"
"ore.glm"
"ore.hiveOptions"
"ore.lazyLoad"
"ore.make.names"
"ore.neural"
"ore.odmGLM"
"ore.odmOC"
"ore.pull"
"ore.rank"
"ore.rollmean"
"ore.rollvar"
"ore.scriptDrop"
"ore.stepwise"
"ore.toXML"
"ore.const"
"ore.datastore"
"ore.disconnect"
"ore.exec"
"ore.get"
"ore.glm.control"
"ore.hour"
"ore.lm"
"ore.mday"
"ore.odmAI"
"ore.odmKMeans"
"ore.odmSVM"
"ore.pull"
"ore.recode"
"ore.rollmin"
"ore.rowApply"
"ore.second"
"ore.summary"
"ore.univariate"
> myMat
[,1] [,2] [,3] [,4] [,5]
[1,]
4
7
1
1
1
[2,]
2
4
6
2
3
[3,]
4
0
4
2
3
[4,]
2
2
5
4
4
[5,]
4
1
2
2
1
[6,]
5
4
4
4
1
[7,]
2
3
0
0
4
[8,]
4
4
4
4
4
> MMIN(myMat, 3)
[,1] [,2] [,3] [,4] [,5]
[1,]
NA
NA
NA
NA
NA
[2,]
NA
NA
NA
NA
NA
[3,]
2
0
1
1
1
[4,]
2
0
4
2
3
[5,]
2
0
2
2
1
[6,]
2
1
2
2
1
[7,]
2
1
0
0
1
[8,]
2
3
0
0
1
user
0.134
system elapsed
0.037 240.697
> 240.697/60
[1] 4.01161
"relRets"
"hMat"
"classed"
"tCosts"
Updated Application
Backtest
Application
Universe
Feed
Scripting
Interface
Analytic
Engine
Bespoke C
Graphical User
Interface
Analytic Code
MgMent UI
Updated Application
Backtest
Application
Universe
Feed
Graphical User
Interface
Scripting
Interface
Analytic
Engine
Analytic Code
MgMent UI
Updated Application
Backtest
Application
Universe
Feed
Graphical User
Interface
SQL
Interface
Embedded
Scripts
Analytic
Engine
Analytic Code
Interface
Benefits of ORE
Significant immediate benefits in performance and
code management
Database script management makes deployment
very simple
Script and SQL interfaces allow for close
integration into business processes in a controlled
manner
Summary
Summary
Oracle R Enterprise provides a sophisticated platform
for integrating R into business processes
Adds scalability and performance improvements to
flexible R environment
Integrating a legacy application with ORE proved to
be easy to achieve
We have this running on demo servers if you want to
see it .
Discussion