MATLAB > MarketView MATLAB SDK User Guide |
GlobalView Matlab SDK is the easiest way to get quotes and time series into Matlab. All you need is a copy of Matlab, the SDK, and GlobalView username and password. With Matlab and the SDK installed, run Matlab and connect to GlobalView servers (substituting your username and password in the line below):
>> con = gvconnect ('username','password')
Matlab will reply with:
con =
GvIpc.Matlab.ServerConnection handle
Package: GvIpc.Matlab
Properties:
Barrels: [1x1 GvIpc.Matlab.UnitConversion]
Liters: [1x1 GvIpc.Matlab.UnitConversion]
Kiloliters: [1x1 GvIpc.Matlab.UnitConversion]
CubicMeters: [1x1 GvIpc.Matlab.UnitConversion]
Gallons: [1x1 GvIpc.Matlab.UnitConversion]
ThouStdCubicFt: [1x1 GvIpc.Matlab.UnitConversion]
MetricTons: [1x1 GvIpc.Matlab.UnitConversion]
ShortTons: [1x1 GvIpc.Matlab.UnitConversion]
MMBTUs: [1x1 GvIpc.Matlab.UnitConversion]
Therms: [1x1 GvIpc.Matlab.UnitConversion]
Gigajoules: [1x1 GvIpc.Matlab.UnitConversion]
GigawattHours: [1x1 GvIpc.Matlab.UnitConversion]
KilowattHours: [1x1 GvIpc.Matlab.UnitConversion]
MegawattHours: [1x1 GvIpc.Matlab.UnitConversion]
Methods, Events, Superclasses
At this point we have a nice connection object stored in our variable con. We can now use it in order to get quotes and time series. Let's start with quotes:
>> quote = gvquote(con,'/GCL')
Matlab will reply with the /GCL quote:
quote =
Last: 88.8300
NetChange: 1.5600
PercentChange: 1.7900
High: 89.2100
Low: 86.4600
Open: 87.5100
Close: NaN
Bid: 88.8200
Ask: 88.8300
TradeSize: 1
OpenInterest: 294270
Volume: 173160
MostRecentValue: 88.8300
PrevPrice: 88.8300
MidPoint: 87.8350
Strike: NaN
PrevHigh: 87.6200
PrevLow: 85.1100
PrevOpen: 85.3300
PrevClose: 87.2700
PrevVol: 192606
BidSize: 9
AskSize: 2
TickCount: 105783
Currency: 'USD'
LotUnit: 'BBL'
PutCall: 'U'
Underlier: '/CL'
ContractDate: '01-Oct-2011'
ExpirationDate: '20-Sep-2011'
CloseDate: '29-Aug-2011'
SettleDate: ''
TradeDateTimeUtc: '30-Aug-2011 15:35:44'
BidDateTimeUtc: '30-Aug-2011 15:35:45'
AskDateTimeUtc: '30-Aug-2011 15:35:45'
MostRecentValueDate: '30-Aug-2011'
The quote you have received as a result is a standard Matlab structure, so you can use its properties using the dot operator:
>> quote.Last
And Matlab will respond with:
ans =
88.8300