MATLAB Examples

Shooju MATLAB Client Sample Usage

This example file demonstrates basic usage.

Contents

Connect to Shooju Server

Connect and authenticate with Shooju server. Use the full Shooju server address or the short account name. To find your API Key, go to Action=>Settings in the Shooju web interface.

Shooju.Connect(SERVER, USER, API_KEY);

Load Dates Table

Load dates and points into a table where columns are series and rows are dates. Use a Shooju query. Only the first parameter is required. See Function Hints for more info.

disp(Shooju.LoadDatesTable(QUERY, COLUMN_FIELD, DATE_FROM, DATE_TO, MAX_ROWS));
                            PSX       XOM       CVX       GOOG      COP       MSFT 
                           ______    ______    ______    ______    ______    ______

    2015-04-01T00:00:00     79.94     84.46    104.79    542.56     63.02     40.72
    2015-04-02T00:00:00     78.17      84.3    105.28    535.53     63.18     40.29
    2015-04-06T00:00:00     78.55     85.13    106.92    536.77     65.39     41.55
    2015-04-07T00:00:00     77.77     85.75    108.54    537.02     65.79     41.53
    2015-04-08T00:00:00     77.41     84.06    106.66    541.61     64.81     41.42
    2015-04-09T00:00:00     77.81     84.65    106.95    540.78        67     41.48
    2015-04-10T00:00:00     78.34     85.56    106.91    540.01     66.53     41.72
    2015-04-13T00:00:00     76.93     84.64     106.5    539.17     66.34     41.76
    2015-04-14T00:00:00     77.83    85.919    108.84    530.39     68.36     41.65
    2015-04-15T00:00:00    78.393    87.357    110.41    532.53      69.4     42.26
    2015-04-16T00:00:00    78.691     87.01    109.07     533.8     69.01     42.16
    2015-04-17T00:00:00    77.469    86.217    108.03    524.05     67.69     41.62
    2015-04-20T00:00:00     78.75    86.524     109.2    535.38     68.61    42.633
    2015-04-21T00:00:00    78.949    86.167    108.65    533.97    67.257    42.365
    2015-04-22T00:00:00    80.359    86.743    108.42    539.37    67.119    42.712
    2015-04-23T00:00:00    80.667    86.822    108.89       547    67.495     43.06
    2015-04-24T00:00:00    81.024    86.257    108.79    565.06    66.753    47.561
    2015-04-27T00:00:00    80.508    86.296    108.62    555.37    66.308     47.72
    2015-04-28T00:00:00    81.044     87.08    110.02    553.68    66.981    48.843
    2015-04-29T00:00:00    80.438    87.149    110.63    549.08    67.297    48.743
    2015-04-30T00:00:00     78.76    86.653    109.96    537.34    67.159    48.326
    2015-05-01T00:00:00    81.044    88.121    107.96     537.9    66.684    48.346

Load Fields Table

Load field values into a table where columns are fields and rows are series. Use a Shooju query and Shooju fields. See Function Hints for more info.

disp(Shooju.LoadFieldsTable(QUERY, {FIELD1, FIELD2, FIELD3, FIELD4}));
            sid                           name                   exchange    pe_ratio    market_cap
    ____________________    _________________________________    ________    ________    __________

    'YF\\GOOG\\AdjClose'    'Google Inc.'                        'NMS'       '25.53'     '368.58B' 
    'YF\\PSX\\AdjClose'     'Phillips 66 Common Stock'           'NYQ'       '10.90'     '43.86B'  
    'YF\\XOM\\AdjClose'     'Exxon Mobil Corporation Common '    'NYQ'       '12.98'     '361.75B' 
    'YF\\CVX\\AdjClose'     'Chevron Corporation Common Stoc'    'NYQ'       '11.45'     '197.24B' 
    'YF\\COP\\AdjClose'     'ConocoPhillips Common Stock'        'NYQ'       '16.18'     '80.28B'  
    'YF\\MSFT\\AdjClose'    'Microsoft Corporation'              'NMS'       '19.47'     '379.40B'