Here are two more complicated examples of building indicators in Power Basic. We have included not only the source code but the compiled DLL and template files as well. The first example is due to Jack Singer, and the second is an extension of his idea.
In the first example, Retrace Buy, the indicator finds the highest value of the input time series during the period specified by the parameter period. Then if finds the lowest value of the series after that high. It then computes the percent change from that low. The theory is that if the percent change is greater than, say, 10%, we are in a buy situation.
In the second example, Retrace Sell, the logic is reversed. We look for the lowest in the window (Period) and starting from there we seek the high. We then compute the percent change (which is zero or negative) from that high.
Use the optimizer in the Trader Professional to find optimal values of the window size and the retracement threshold (i.e., put both indicators in a trading strategy, one for buy and one for sell). Jack Singer suggests using this indicator on weekly mutual fund data with a window size of 104 weeks.
Click here to download a self extracting executable containing source code, a DLL and two template files.