The Metastock platform only allow functions/formulas to use constant values when looking back over historical price bars.
This is a major limitation as stocks do not determine themselves to fixed time periods.
In order to overcome this, an external formula function is required, using the Metastock Developers Kit to calculate certain variables.
To develop a Metastock external function (as per the Metastock Developers Kit), written in C/C++ to provide certain variables associated with Linear Regression Trend Channels, whereby the Starting Bar and the End Bar of the channel are determined by a combination of Moving Average Crossover points, and then the lowest value prior to the crossover point (for uptrends) or the bar with the highest closing value prior to the crossover point (for downtrends).
The Metastock function will primarily be used in explorations, to both filter out potential target stocks, as well as result fields that are subsequently extracted to external files.
Experience in Metastock Developers Kit (MSX/MSFL) and previous work on trading solutions, candlestick patterns/oscillators are preferred.