Query on Applying Transformation to Custom Aggregate Series

Hi all,

Quick question: Is it possible to apply a transformation, such as a moving average, to a raw custom aggregate series and then calculate a binary signal based on the value of that moving average? If so, could you please explain how to do it?

Alternatively, should the transformation be applied directly within the custom aggregate series definition? If that’s the case, could you kindly explain the process?

Thanks a lot in advance.

Happy trading!

The formula would look like this where my Agg series is named EarnYield SP500:

Eval(SMA(30, 0, GetSeries("EarnYield SP500")) > 4, 1, 0)

The eval statement returns 1 if the 30 day sma of the EarnYield is >4 and returns 0 if it is <= 4.

You can paste your formula into the Fundamental chart to test it.

1 Like

I cannot make GetSeries() to work in aggregate series creation

I managed to achieve what I was looking for with a bunch of SetVar :sweat_smile:

Aggregate series doesn't support transformations, as it only supports computing an aggregate value across a universe. Where exactly do you intend to use the signal? I would recommend creating a formula to encapsulate what Dan suggested.

Thnaks for the reply. The intend is to use it in macro charts.

Sorry, I didn't realize you were on the Macro Chart page.

There is no way to apply the SMA directly in the Aggregate Series as Aaron mentioned. But the Macro Chart can set a binary signal based on the SMA of your series. Do these steps accomplish your goal?:

Create a new Macro chart.
Click on My Series and select your series. This opens the Add Series page.
For Transformation, pick Binary, Above SMA (or below SMA if you prefer that) and enter a value for number of Bars.
If you want to run a backtest here, click Add Backtest.