To: Sean W. Smith who wrote (3003 ) 1/13/1998 12:48:00 AM From: TechTrader42 Respond to of 11149
Here's a start on a translation of the MSWIN slope formula. This is just an attempt at the numerator of the formula, and it may be complete nonsense. But I'm finding it so difficult that I'll post this much in the hope that someone can help (save me from a slippery slope). As I said, this doesn't include the denominator with the power function yet. This formula assumes that 100 days of data are loaded in Metastock (to get around the problem of the cumulate function). It's probably a misguided attempt, but here it is (help!!!): //Slope, assuming that 100 days of data is loaded in Metastock //This is only the numerator of the formula //Still working on denominator (and numerator, for that matter) //Here's MSWIN formula:( (14 * (Sum(Cum( 1 ) * C ,14 ) ) ) - //(Sum(Cum( 1 ) ,14 ) * (Sum( C ,14) ) ) ) / //( (14 * Sum(Pwr (Cum( 1 ) ,2 ) ,14 ) ) // - Pwr(Sum(Cum( 1 ) ,14 ) ,2 ) ) output="slope.lst"; DaysToLoad=500; integer i,k; float j,l,m,n, numerator; j:=0; for i=0 to -13 step -1 do j := j + close(i); //j is sum(c, 14) next i; l:=86; for k=87 to 100 step 1 do l := l+k; next k; //k represents sum(cum(1),14) m :=14*l*close(0); // this is: (14 * (Sum(Cum( 1 ) * C ,14 ) ) ) n :=l*j; //this is: (Sum(Cum( 1 ) ,14 ) * (Sum( C ,14) ) ) ) numerator := m-n; println symbol , "," ,numerator; ************ I'm not exactly sure what's going on with those summations -- whether one represents 14 times the most recent close times a cumulative total of the days, to compare with the sum of the close for each day over 14 days, again times the cumulative total of the days. I think that's the idea, but I may have it wrong. I may have it hilariously wrong, in fact. Anyway, if anyone cares to step up to the drawing board..... Brooke