---
title: "Moving Average Distance Ratio"
method: POST
path: "/assets/indicators/moving-average-distance-ratio"
tags: ["Assets / Indicators"]
---

# Moving Average Distance Ratio

`POST /assets/indicators/moving-average-distance-ratio`

Compute the moving average distance ratio of an asset.

References
* [Avramov D, Kaplanski G, Subrahmanyam A. Moving average distance as a predictor of equity returns. Rev Financ Econ. 2021; 39: 127–145](https://onlinelibrary.wiley.com/doi/abs/10.1002/rfe.1118)
* [Menachem Meni Abudy, Guy Kaplanski, Yevgeny Mugerman, Market timing with moving average distance: International evidence, Journal of International Financial Markets, Institutions and Money, Volume 97, 2024, 102065](https://www.sciencedirect.com/science/article/abs/pii/S1042443124001318)

## Request body

- union
  - object
    - `assets` object[], required
      - `assetReturns` number[], required — assetReturns[t] is the logarithmic return of the asset at the time t
      - `assetMovingAverageDistanceRatioSkipPeriod` integer — The number of the most recent periods excluded from the asset moving average distance ratio computation; must be < assetMovingAverageDistanceRatioShortWindowSize
      - `assetMovingAverageDistanceRatioShortWindowSize` integer, required — The size of the short look back period over which to compute the asset moving average distance ratio; must be lower than assetMovingAverageDistanceRatioLongWindowSize
      - `assetMovingAverageDistanceRatioLongWindowSize` integer, required — The size of the long look back period over which to compute the asset moving average distance ratio; must be greater than assetMovingAverageDistanceRatioShortWindowSize
  - object
    - `assets` object[], required
      - `assetPrices` object[], required — assetPrices[t] contains price information for the asset at the date t
        - `date` string, required — The date corresponding to the date t in format YYYY-MM-DD; all dates must be distinct
        - `close` number, required — The close price of the asset at the date t
      - `assetMovingAverageDistanceRatioSkipPeriod` integer — The number of the most recent periods excluded from the asset moving average distance ratio computation; must be < assetMovingAverageDistanceRatioShortWindowSize
      - `assetMovingAverageDistanceRatioShortWindowSize` integer, required — The size of the short look back period over which to compute the asset moving average distance ratio; must be lower than assetMovingAverageDistanceRatioLongWindowSize
      - `assetMovingAverageDistanceRatioLongWindowSize` integer, required — The size of the long look back period over which to compute the asset moving average distance ratio; must be greater than assetMovingAverageDistanceRatioShortWindowSize

## Response `200`

OK

- object
  - `assets` object[], required
    - `assetMovingAverageDistanceRatio` number, required — The asset moving average distance ratio

---

[API](https://skmtc.net/portfoliooptimizer/apis/portfolio-optimizer.md) · [All operations](https://skmtc.net/portfoliooptimizer/apis/portfolio-optimizer/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/portfoliooptimizer/portfolio-optimizer/revisions/d016f340e91c/schema)
