Cycles App Integration

Providing information on how to link the cycles application with live data updates and transfer composite cycle models back to the TradingView chart

Link TradingView charts with Cycles app via webhooks alerts

The integration provides a back-to-back integration between your TradingView charts and the cycle analysis toolset. Allowing to keep your TradingView chart data synced in real-time with the cycle analysis API and cycle application. Allowing to monitor active cycles in your TradingView chart for any symbol and time-frame.

The first step is to setup a separate alert-condition via a new pine script and attach it to your chart you want to use for cycle analysis.

1. Create alert-condition

Create a new individual alert-condition via a custom pine script. The simplest way of alert-condition for a pine script looks like this:

//@version=4
study("WTT_DataFeed")
plot(close)
alert = true

msg = "{\"streamid\":\"YOUR-STREAM-ID\", \"messagetype\":\"UPSERT\", \"dates\": [ \"{{time}}\" ], \"values\": [ {{close}} ] }"

alertcondition(alert, title='data', message=msg)

Be aware that the text string YOUR-STREAM-ID within the msg variable will be replaced later when you setup the alert. This is just a new alert-condition we place on your chart. This is not the alert. The message object (msg) is already prepared to work with the cycle analysis endpoint. So don't change this message if you want it to work with our cycle analysis.

2. Open symbol/chart

Open your symbol on a TradingView chart. Select the required time-frame and place the new script on the chart. You can use the pre-build script down below and can link it to your favorite indicators.

Want to place this script on your TradingView chart? Just use this prepared script:
https://www.tradingview.com/script/FTEsZurP-Cycle-Analysis-WebHook-API-Integration/

3. Get Cycle Analysis API Key

Before we start the alert and connection, ensure you have your cycle analysis API key at hand. You will find your API key via the cycle application: https://cycle.tools/account/api

Note down that key as you need to enter it when you setup the webhook connection in the next step.

4. Activate the webhook

The "Create Alert" function from TradingView panel will activate the webhook on their servers for your symbol and time-frame:

Create Alert to connect via webhook with cycle analysis

To start the live sync, the web-hook will be activated via the alert activation from the TradingView alert panel. Ensure to select the following options as shown:

TradingView Create Alert

Before you create the alert, replace the YOUR-STREAM-ID tag in the Message section with the stream ID you want to see that in your cycle analysis platform. Also replace YOUR-KEY in the webhook URL with your cycle analysis API key.

5. First webhook activation

After activation, you will see a confirmation in the alert panel that this webhook has now been created. Before we move on to the cycle analysis, we should wait and ensure that the first webhook has successfully been fired. We can see this in the alert panel when a date/time information has been placed in this section below your alert:

TradingView Alert webhook triggered

6. Open Cycle Analysis Streams

Now, you have done everything required on TradingView. The webhook will continuously fire off, even when you close and change your chart configuration. We can now monitor this symbol in our cycle analysis environment to see the cycle detection for that symbol. Open the cycle analysis streams page to see your new symbol added.

Go to the following page to see the connection: https://cycle.tools/settings/streams

In this case, we named the symbol "TV-BTCUSD-5M" - and you will find it with this ID in your cycle analysis streams board:

image-1616921324162.png

After you have setup the connection, there is not enough history available to start the cycle analysis. Therefore you either need to wait until at least 100 datapoints have been fired from the webhook connection or you can backfill the series manually via the "Fill" button and upload CSV data.

 

Composite Cycle Vector Plot

This script allows to transfer the cycle analysis results from the Cycle Model Builder into an indicator plot on the TradingView chart:

image-1624463676762.png

The TradingView script to plot the vector as indicator on the chart is available for public usage here:
https://www.tradingview.com/script/OqeEKITd-WTT-Composite-Cycle-Plotter/

You can add this script to your favorite indicators to apply it to your charts:

image-1624694480305.png

If you are looking for the MotiveWave version of this Composite Cycle Vector plot, please download the MotiveWave integration pagage here.


 
How to transfer your composite plot to TradingView chart:

1. Create your composite plot in the cycle app and click the highlighted icon in the Composite Cycle Model Builder window:

image-1624693982018.png

 

2. A window will open to inform you to copy the vector to your clipboard:

image-1624694060687.png

 

3. You can mark the TradingView indicator as "favorite" so it will appear in your list of favorite indicators:

image-1624694271689.png

 

4. Once applied to the chart paste the string into the "Composite Vector" field.

Ensure to remove all existing content in the field before you paste your new data.

image-1624694342596.png