POST api/TSCalc/Post

Time Series calculation for a given set of returns v.s. benchmark returns.

Request Information

URI Parameters

None.

Body Parameters

TSCalcRequest
NameDescriptionTypeAdditional information
t

string

None.

p

TSCalcParam

None.

Request Formats

application/json, text/json

Sample:
{
  "t": "sample string 1",
  "p": {
    "sec": "sample string 1",
    "secRets": [
      {
        "date": 1,
        "val": 2.1
      },
      {
        "date": 1,
        "val": 2.1
      }
    ],
    "ref": "sample string 2",
    "refRets": [
      {
        "date": 1,
        "val": 2.1
      },
      {
        "date": 1,
        "val": 2.1
      }
    ],
    "s": 3,
    "cn": "sample string 4",
    "cv": 5,
    "p": "sample string 6",
    "offset": 7,
    "rates": [
      {
        "Date": 1,
        "Rate": 2.1
      },
      {
        "Date": 1,
        "Rate": 2.1
      }
    ]
  }
}

application/xml, text/xml

Sample:
<TSCalcRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BondEdge.Equity">
  <p>
    <cn>sample string 4</cn>
    <cv>5</cv>
    <offset>7</offset>
    <p>sample string 6</p>
    <rates>
      <RiskFreeRate>
        <Date>1</Date>
        <Rate>2.1</Rate>
      </RiskFreeRate>
      <RiskFreeRate>
        <Date>1</Date>
        <Rate>2.1</Rate>
      </RiskFreeRate>
    </rates>
    <ref>sample string 2</ref>
    <refRets>
      <TSReturn>
        <date>1</date>
        <val>2.1</val>
      </TSReturn>
      <TSReturn>
        <date>1</date>
        <val>2.1</val>
      </TSReturn>
    </refRets>
    <s>3</s>
    <sec>sample string 1</sec>
    <secRets>
      <TSReturn>
        <date>1</date>
        <val>2.1</val>
      </TSReturn>
      <TSReturn>
        <date>1</date>
        <val>2.1</val>
      </TSReturn>
    </secRets>
  </p>
  <t>sample string 1</t>
</TSCalcRequest>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'TSCalcRequest'.

Response Information

Resource Description

Collection of TSCalc
NameDescriptionTypeAdditional information
calcID

string

None.

beta

decimal number

None.

momentum

decimal number

None.

volatility

decimal number

None.

sharpeRatio

decimal number

None.

treynorRatio

decimal number

None.

informationRatio

decimal number

None.

sortinoRatio

decimal number

None.

r2

decimal number

None.

alpha

decimal number

None.

upCapture

decimal number

None.

downCapture

decimal number

None.

trackingError

decimal number

None.

annualizedReturn

decimal number

None.

standardDeviation

decimal number

None.

riskFreeRate

decimal number

None.

calcTime

string

None.

calcError

string

None.

dataSpan

integer

None.

dataLoss

integer

None.

Response Formats

application/json, text/json

Sample:
[
  {
    "calcID": "sample string 1",
    "beta": 2.1,
    "momentum": 3.1,
    "volatility": 4.1,
    "sharpeRatio": 5.1,
    "treynorRatio": 6.1,
    "informationRatio": 7.1,
    "sortinoRatio": 8.1,
    "r2": 9.1,
    "alpha": 10.1,
    "upCapture": 11.1,
    "downCapture": 12.1,
    "trackingError": 13.1,
    "annualizedReturn": 14.1,
    "standardDeviation": 15.1,
    "riskFreeRate": 16.1,
    "calcTime": "sample string 17",
    "calcError": "sample string 18",
    "dataSpan": 19,
    "dataLoss": 20
  },
  {
    "calcID": "sample string 1",
    "beta": 2.1,
    "momentum": 3.1,
    "volatility": 4.1,
    "sharpeRatio": 5.1,
    "treynorRatio": 6.1,
    "informationRatio": 7.1,
    "sortinoRatio": 8.1,
    "r2": 9.1,
    "alpha": 10.1,
    "upCapture": 11.1,
    "downCapture": 12.1,
    "trackingError": 13.1,
    "annualizedReturn": 14.1,
    "standardDeviation": 15.1,
    "riskFreeRate": 16.1,
    "calcTime": "sample string 17",
    "calcError": "sample string 18",
    "dataSpan": 19,
    "dataLoss": 20
  }
]

application/xml, text/xml

Sample:
<ArrayOfTSCalc xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BondEdge.Equity">
  <TSCalc>
    <alpha>10.1</alpha>
    <annualizedReturn>14.1</annualizedReturn>
    <beta>2.1</beta>
    <calcError>sample string 18</calcError>
    <calcID>sample string 1</calcID>
    <calcTime>sample string 17</calcTime>
    <dataLoss>20</dataLoss>
    <dataSpan>19</dataSpan>
    <downCapture>12.1</downCapture>
    <informationRatio>7.1</informationRatio>
    <momentum>3.1</momentum>
    <r2>9.1</r2>
    <riskFreeRate>16.1</riskFreeRate>
    <sharpeRatio>5.1</sharpeRatio>
    <sortinoRatio>8.1</sortinoRatio>
    <standardDeviation>15.1</standardDeviation>
    <trackingError>13.1</trackingError>
    <treynorRatio>6.1</treynorRatio>
    <upCapture>11.1</upCapture>
    <volatility>4.1</volatility>
  </TSCalc>
  <TSCalc>
    <alpha>10.1</alpha>
    <annualizedReturn>14.1</annualizedReturn>
    <beta>2.1</beta>
    <calcError>sample string 18</calcError>
    <calcID>sample string 1</calcID>
    <calcTime>sample string 17</calcTime>
    <dataLoss>20</dataLoss>
    <dataSpan>19</dataSpan>
    <downCapture>12.1</downCapture>
    <informationRatio>7.1</informationRatio>
    <momentum>3.1</momentum>
    <r2>9.1</r2>
    <riskFreeRate>16.1</riskFreeRate>
    <sharpeRatio>5.1</sharpeRatio>
    <sortinoRatio>8.1</sortinoRatio>
    <standardDeviation>15.1</standardDeviation>
    <trackingError>13.1</trackingError>
    <treynorRatio>6.1</treynorRatio>
    <upCapture>11.1</upCapture>
    <volatility>4.1</volatility>
  </TSCalc>
</ArrayOfTSCalc>