Registered User Joined: 8/7/2012 Posts: 28
|
Hi,
I wrote a progam to scan for pullbacks to the 10-day moving avg. The code is
as follows:
(L > AVGC10 OR L <= AVGC10)
AND (L1 > AVGC10)
AND (L2 > AVGC10)
AND (L3 > AVGC10)
AND (L4 > AVGC10)
AND (L5 > AVGC10)
AND (L6 > AVGC10)
AND (L7 > AVGC10)
AND (L8 > AVGC10)
AND (L10 > MINL45 AND L11 > MINL45 AND L12 > MINL45 AND L13 > MINL45
AND L14 > MINL45 AND L15 > MINL45 AND L16 >MINL45 AND L17 > MINL45
AND L18 > MINL45 AND L19 > MINL45 AND L20 > MINL45)
I tested the above on ticker symbol ADM,which visual inspection of the stock chart
indicates that it does indeed conform. However, it gave back a FALSE reading.
I noticed that the value for the AVGC10 term was the same for all entries. For example.
the values used to compute the L4 term (L4 > AVGC10) appeared as 51.15 > 51.63.
The value for the 10-day MA was given on the price chart as 50.71 for L4 (and the low
was given as 51.15). Thus, the expression would have been expected to be 51.15 > 50.71.
What is the appropriate code term to obtain the 10-day MA value for the day in question, eg, 50.71,
versus the value used for the AVGC10 term throughout the computation, eg, 51.63?
Thank you.
|
Registered User Joined: 8/7/2012 Posts: 28
|
QUOTE (pendletonc)
Hi,
I wrote a progam to scan for pullbacks to the 10-day moving avg. The code is
as follows:
(L > AVGC10 OR L <= AVGC10)
AND (L1 > AVGC10)
AND (L2 > AVGC10)
AND (L3 > AVGC10)
AND (L4 > AVGC10)
AND (L5 > AVGC10)
AND (L6 > AVGC10)
AND (L7 > AVGC10)
AND (L8 > AVGC10)
Thank you.
By Jove I think I've got it!
L4 > AVGC10.4 etc.
|
Registered User Joined: 1/28/2005 Posts: 6,049
|
QUOTE (pendletonc)
By Jove I think I've got it!
L4 > AVGC10.4 etc.
Yes thats it.
AVGC10 TODAY
AVGC10.1 YESTERDAY
AVGC10.2 BAR BEFORE YESTERDAY
Thanks
|