Strategy based on the number of signals generated by another strategy
Author: sedelstein
Creation Date: 3/30/2018 3:43 PM
profile picture



I'm curious as to how I would capture the number of daily signals generated for a portfolio.
The idea is to see if the number of signals (not executions) is highly indicative of a large market move.

Is the idea to loop day by day for a single symbol representing "the market", say SPY (the symbol to trade), and then within the daily loop, to generate signals for the individual symbols in a dataset, keep a global variable around to keep count, then generate an order for SPY based on that variable.
I think the coding is straightforward but is there an obviously better program flow?

profile picture


It would depend on the system's complexity I suppose. One of the simplest ways might be to run a dedicated "donor" Strategy on SPY and have it save the number of signals in a DataSeries via SetGlobal. Then you execute the "recipient" Strategy on a DataSet, reading the DataSeries back from Wealth-Lab's GOP.
profile picture


I think perhaps you misunderstood (or perhaps it's me again). The SPY strategy would be the recipient.

If the dataset returns a large number of alerts, then the market e.g. SPY will rally or decline sharply. The SPY receives the signals from the dataset. In this case, the donor strategy would have to run each symbol and the receiver would count the alerts.

I suppose, looping through a dataset symbol by symbol or calling the donor multiple times is essentially the same. Was wondering if programatically it makes a difference.

Thanks again
profile picture


I misinterpreted your question but you're right, it's essentially the same the other way round. Moreover, the choice for GOP isn't fixed: it can be replaced by file or database by some.

Or maybe you'd want to refactor the Strategy to loop by DataSetSymbols like this: WealthScript Techniques | Portfolio-wide conditions
profile picture


Thanks will give a look
profile picture


If the dataset returns a large number of alerts, then the market e.g. SPY will rally or decline sharply. The SPY receives the signals from the dataset.
What I would do is create a "Custom SPY-trending Index" of beacon or pathfinder stocks with Index-Lab, then trade SPY on that Index's sentiment.

The challenge here is picking leading-indicator beacon stocks to populate that SPY-trending Index with, but it sounds like you've already done that by following the Alerts generated by your existing "beacon strategy". With some coding, it might be possible to incorporate the salient code of your existing beacon strategy into a SPY-thrending Index through the Index-Lab API, but that's too complicated for the first attempt. I would simply pick some existing "accumulating indicator" and funnel all your beacon stocks into that to build your SPY-trending Index composite.

At any rate, I would give Index-Lab a look.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).