SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Strategies & Market Trends : TA-Quotes Plus -- Ignore unavailable to you. Want to Upgrade?


To: Bob Jagow who wrote (9244)4/6/1999 10:18:00 AM
From: TechTrader42  Read Replies (2) | Respond to of 11149
 
Bob: You were supposed to "try building trend scans" to see what it all meant. Then it would all become clear. Walking back on an EMA isn't as difficult as it sounds. The key thing is to make sure the cavalletti are installed and anchored properly, to reduce movement in the wire -- and to use a balance pole.

Philippe Petit




To: Bob Jagow who wrote (9244)4/6/1999 2:14:00 PM
From: Peter H. Mack  Read Replies (1) | Respond to of 11149
 
Sorry, I should have offered a larger explanation of my Hammer example.

My definition of a Hammer (“Technical Analysis from A to Z “– Steven B. Achelis) is a japanese candlestick pattern resembling a hammer, that is to say, A head body along with a trailing shadow. This pattern is bullish when it is preceded by a significant downtrend. (I have paraphrased rather than quoted)

In a message , Monty Lenard, (9034) suggested a scan coding for a hammer which caught my eye, as a good exercise. In it he described the hammer formation in two lines:

If…
Open ( i ) => low ( i ) + range ( i ) * .50 and
close ( i ) => low ( i ) + range ( i ) * .50 and ….

I thought that it might work well if the preceding “significant downturn might be found by using a walking EMA scan. Therefore:

Last :=0; // initialize last
For day = 0 to –30 step –1 do // walk back from today for 30 days
Temp := EmovAvg (day, 26, cl) // get the EmovAvg value for current day.
If temp < last then // check to see that we are on a down slope, if not, abort (note since we are walking backwards, each new value must be higher than the preceding one)

Flag := 0; // kill printing
Day := -30; //Set day to end for loop
Else
Last := temp; // update last and continue..
endif;
next day;

The only other part of the code that was of interest was in the criteria section, which specifies:
MACD(0) <= 0 // which specifies that the 12 day EMA is below the 26 day EMA thus indicating (but not guaranteeing) a down trend.

Since the Hammer formation is specified for today only, it will not report them if they don't exist.. Fortunately when I tested this, I had several show up.. I suppose that to back test this, one could walk backward using the hammer formation test until a hammer was found, and then check it's bullish portent by testing to see if there was a significant down turn preceding it. Otherwise remove the price limiting criteria.

regards
pete

The general code is organised
If criteria is true ( a hammer is found and the stock is within price range and Macd is below 0 (which doesn't neccessarily suggest downturn although it does indicate it..)
Then run a slope test for thirty days and if that indicates a slope, print it.




To: Bob Jagow who wrote (9244)4/6/1999 4:16:00 PM
From: Peter H. Mack  Read Replies (1) | Respond to of 11149
 
There might be something in the code, or it is just a case of today being a bad day for hammers..
I offer here essentially the same code but it now looks for ANY hammer in the last 100 days, and then checks for a downslope preceding it.. Admittedly this is more complicated to follow, but I just couldn't let it rest..

Note that the printout gives the date of the hammer found.

regards
pete

exchange = nyse, amex, nasdaq;
output = "hammer test.lst";

integer day, hamday, span, flag;
float temp, last;

DaysRequired(200);
DaysToLoad(199);

last :=0;
span := -100;
flag :=0;

for day = 0 to span step -1 do

if range(day)> 0 and
open(day) => (low(day) + (range(day)*.5)) and
close(day) => low(day) + (range(day)*.5) and
open(day) != close(day) and
// (open(day)= high(day OR close(day) = high (day)) // statement doesnt work
MACD(day) <= 0 and
close(day) < 20 and
close(day) > 1 then
hamday := day; // a hammer found
flag :=1;
day := span;
endif;
next day;

// look for preceding slope
if flag >0 then
for day = hamday to hamday-30 step -1 do
temp := EMovAvg(day,26,cl);
if temp < last then
flag :=0;
day := hamday-30;
else
last := temp;
endif; // if temp local
next day;
endif;


if flag > 0 then
println symbol,",",close(0),",",Date(hamday),",","Hammer",",",date(0);
endif; // local