What I am looking for is a way to generate a trend line array that I can compare a breakout against. So I'm thinking if I have two points I determined for a trend line priceHigh(5), priceHigh(2) I could feed the points in to

trendArray = TrendLine()
I could compare (and plot)

if (price > trendArray[0] && price > priceHigh{1))
enterLong();


I don't understand what Linearreg is returning. b+m*(TimePeroid-1) is that the next value?

How do I call it?
LinearReg(var* Data, int TimePeriod): var
var *Data = priceHigh[0..5];

nextTrendValue = LinearReg(Data,60);??

Thanks!

Pipinator
Edit --------------
I've tried the following:
var nextValue = LinearReg(priceHigh,5);
printf("nextValue: %2.4f, priceHigh:%2.4f\n",(double)nextValue, (double) priceHigh);

The log file shows values like:
nextValue: 991021190119434640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0000, priceHigh:4211680.0000Bar:150
nextValue: 991021190119434640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0000, priceHigh:4211680.0000Bar:151

Last edited by Pipinator; 12/28/12 14:20.