PureBytes Links
Trading Reference Links
|
As promosed earlier, no more fight letters today and just juicy code...Is it code like Welle's Wilder thougth up in the seveties? Maybe, and then again...maybe not...you be the judge
WARNING: I make this stuff up as I go, and if my spelling is any indication, this programming may be riddled with unintentional and intentional freaky stuff. Please feel free to correct me where logic and code do not co-incide.
DUNN'S DENSITY OF CLOSES
What Does It Do
//////////////////////////
It looks at the last 10 days of closes and check one days close against the previous days close and then is +1 or -1. The indicator can swing from -10 to 10. My hope is that an increasing number of closes in a certain direction maybe a lead indicator for a new trend when combined with moving averages etc.
{Dunn's Density}
{Paste this in as an INDICATOR...or paste it into a system}
Value1= C-C[1];
Value2= C[1]-C[2];
Value3= C[2]-C[3];
Value4= C[3]-C[4];
Value5= C[4]-C[5];
Value6= C[5]-C[6];
Value7= C[6]-C[7];
Value8= C[7]-C[8];
Value9= C[8]-C[9];
Value10= C[9]-C[10];
value11=0;
value12=0;
If Value1 > 0 then value11=value11+1;
If Value1 < 0 then value11=value11-1;
If Value2 > 0 then value11=value11+1;
If Value2 < 0 then value11=value11-1;
If Value3 > 0 then value11=value11+1;
If Value3 < 0 then value11=value11-1;
If Value4 > 0 then value11=value11+1;
If Value4 < 0 then value11=value11-1;
If Value5 > 0 then value11=value11+1;
If Value5 < 0 then value11=value11-1;
If Value6 > 0 then value11=value11+1;
If Value6 < 0 then value11=value11-1;
If Value7 > 0 then value11=value11+1;
If Value7 < 0 then value11=value11-1;
If Value8 > 0 then value11=value11+1;
If Value8 < 0 then value11=value11-1;
If Value9 > 0 then value11=value11+1;
If Value9 < 0 then value11=value11-1;
If Value10 > 0 then value11=value11+1;
If Value10 < 0 then value11=value11-1;
plot1(value11, "densityC");
plot2(0, "mid");
|