PureBytes Links
Trading Reference Links
|
I've taken a Larry Williams indicator for the mid 90's and have attempted to
write the code for a function, indicator, and signal. The indicator plots on
my charts correctly but I can't seem to be able to get my signal to recognize
the indicator. The indicator "WillSentiment18" is based on the concept that
a market is topping out when there are several closes near the high of the
day. If you subtract a day's low from its close and then divide that value
by the total range for the day you get a Percent that indicates about what
investor sentiment had been for the day. Then you take a 18 day moving
average of the daily values to plot as the indicator. The following is what
I've come up with:
{{{ Function }}}
inputs: Length(NumericSimple);
var: x(1);
X = IFF (H - L <> 0,H - L,1) ;
If Length > 0 Then
WillSentiment18 = Average( (c - l)/x,18)
else
WillSentiment18 = 0;
--------------------------------------------------------------
{{{{ Indicator }}}}
plot1(WillSentiment18(18));
--------------------------------------------------------------
{{{ Signal }}}
{ I can't figure out how to use the "MRO" (most recent occurance) so I just
used a previous value of the WillSentiment.}
If WillSentiment(18)[5] < 35 and SlowK(10) crosses over 60
then buy high stop:
Any help would be appreciated.........thanks/John D.
|