GET    /api/MarketCycles/{symbol}

End of Day dominant cycle analysis for 3,000 US companies, major global market indices, commodities and foreign exchange rates. Returns current dominant cycle.


  • Symbol/Market to analyze for current dominant cycle.
  • Range (min/max) to scan for actual dominant cycle length and last date to use.


  • Current dominant cycle length in bars
  • Cycle info (amplitude, phase)
  • Human readable last cycle pivots as bar offset from last bar (lastlow, lasttop)
  • Human readable next cycle pivots as bot offsets from last bar (nextlow, nexttop)
  • Human readable current cycle phase (e.g. approaching top)
  • Profitability score for trading the detected cycle against the price dataset
  • Phasing Score to show the combined phase status for current long- and short-term cycle on a scale from (-200 to +200
  • Full timeseries datapoints with cycle value, price-cycle and close to plot a chart with dominant cycle as indicator

Example Request:

Index – marketType: INDEX

Examples: DJIA, SP500

Federal Reserve Bank of St. Louis – FRED – Check Symbols

Forex – marketType: FX


Quandl – ECB – Check Symbols

Commodities – marketType: COM

Examples: AG_USD (Silver) , AU_LPM (Gold)

Quandl – WIKI Commodities – Check Symbols

Stocks – marketType: STOCKS

Examples: AAPL, MSFT

Quandl – WIKI EOD Stocks – Check Symbols

Crypto Currencies – marketType: CRYPTO

Examples: BTC (Bitcoin USD), ETH (Ethereum USD)

CryptoCompare –  USD Toplist – Check Symbols

The following example uses a php function to add a new shortcode (marketcycles symbol=… market=…) to wordpress site:

Add the following shortcode to a wordpress page to see the current dominant cycles for major indices:

(marketcycles symbol=”SP500,DJIA,NASDAQ100,NIKKEI225,VIXCLS” market=”INDEX”)


SymbolDatePriceCycle PhasePhasing ScoreCycle LengthNext Cycle PivotBars to Go
SP500April 13, 20214141.59Downtrend_Starting19539Low16.5
DJIAApril 13, 202133677.27BOTTOM_Arrival19539Low1.5
NASDAQ100April 13, 202113986.49Downtrend_Starting040Low16.7
NIKKEI225April 14, 202129620.99Uptrend_ApproachingTop-13047Top5.4
VIXCLSApril 13, 202116.65BOTTOM_Departure-19039Top18.3

Example page:
See here:

PHP Backend:
Add the following code to your functions.php file:

// Add marketcycles shortcode
function wtt_marketcycles( $atts ) {

	// get symbol and market from attributes
	$a = shortcode_atts( array(
        'symbol' => 'DJIA',
        'market' => 'INDEX',
    ), $atts );

	$symbols = explode(',', $a['symbol']);



<tr class='avia-heading-row'>

<th class='avia-desc-col'>Symbol</th>

<th class='avia-desc-col'>Date</th>

<th class='avia-desc-col'>Price</th>

<th class='avia-desc-col'>Cycle Phase</th>

<th class='avia-desc-col'>Phasing Score</th>

<th class='avia-desc-col'>Cycle Length</th>

<th class='avia-desc-col'>Next Cycle Pivot</th>

<th class='avia-desc-col'>Bars to Go</th>



	foreach ($symbols as $symbol) {

		if(($body = get_transient($cacheKey)) === false) 

			$body = wp_remote_retrieve_body( wp_remote_get( $wttapi ) );
			set_transient($cacheKey, $body, 3600);

		if (isset($body) && $body !== '') {
			//If something went wrong, $body would then be empty, so you’d have to check for that
			$cycle = json_decode($body, true);
			if ($cycle['nextlow'] > $cycle['nexttop'])
			} else

			if (strpos($cycle['phase_status'], 'TOP') !== false) {
			} else if (strpos($cycle['phase_status'], 'BOTTOM') !== false) {
			} else {

			if ($cycle['PhasingScore'] > 190) {
			} else if ($cycle['PhasingScore'] < -190) {
			} else {

			$mydate=date("F j, Y", strtotime($cycle&#91;'AnalysisEndDate'&#93;));

<tr class='avia-heading-row'>".sprintf("




<td bgcolor='%s'>%s</td>

<td bgcolor='%s'>%s</td>




", $cycle['Symbol'], $mydate, $cycle['currentPrice'], $backcolor, $cycle['phase_status'], $pbackcolor, $cycle['PhasingScore'], $cycle['length'], $nextpivottype, $nextpivotbars)."</tr>





	return $table;

add_shortcode( 'marketcycles', 'wtt_marketcycles' );

To get you started quickly, we provide a short Excel sheet which allows to pull up dominant cycle information for EOD ticker symbols and to plot the chart with cycle as indicator. We just use the PowerQuery functions available in Excel to connect to external data-sources.

You can dowload the ready-made pre-build workbook down below. If you want to build a workbook on your own, the quick steps are:

  1. Create & setup a table named “Parameter” where all API parameters are available:
  2. Create a new query from web
  3. Enter an example API call in the windowe.g.:
  4. Switch to “Home” / “Advanced Editor”
  5. Change or Edit the power queryThe PowerQuery to get all chart data is:
      Parameter = Excel.CurrentWorkbook(){[Name="Parameter"]}[Content],
      sym = Parameter{0}[Value],
      mt = Parameter{1}[Value],
      ad = Parameter{2}[Value],
      min = Number.ToText(Parameter{3}[Value], "D", "") ,
      max = Number.ToText(Parameter{4}[Value], "D", "") ,
      forward = Number.ToText(Parameter{5}[Value], "D", "") ,
      fillweekdays = Parameter{6}[Value],
      apikey = Parameter{7}[Value],
      Source = Json.Document(Web.Contents(URL,
      [Query=[ #"marketType"=mt , #"analysisDate"=ad, #"minCycleLength"=min, #"maxCycleLength"=max, 
      #"plotForward"=forward, #"fillMissingWeekdays"=fillweekdays, #"includeTimeseries"="true",
      TimeSeries = Source[TimeSeries],
      #"TimeSeries to Table" = Table.FromList(TimeSeries, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
      #"Expanded Records" = Table.ExpandRecordColumn(#"TimeSeries to Table", "Column1", 
      { "date", "price", "dominantCycle", "cycleHighlighter"}, 
      { "date", "price", "dominantCycle", "cycleHighlighter"}),
      #"Changed Type" = Table.TransformColumnTypes(#"Expanded Records",{{"date", type date}})
      #"Changed Type"
  6. If needed, you need to change the privacy settings to allow data loading from external sources

Download Excel file with power query: