home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1993 #2
/
Image.iso
/
finance
/
tas515dm.zip
/
EXAMPLES.ZIP
/
FOSBACK.TAS
< prev
next >
Wrap
Text File
|
1992-12-31
|
3KB
|
106 lines
#MAX_QUOTES 250
#OUTPUT_FILE 'FOSBACK.TXT'
{
--------------------- FOSBECK TREND INDICATORS -------------------------
Written: 9/13/91 by Judith Lipmanson
Calculates 3 Fosbeck trend stages, and codes Buy/Sell signals. Reference:
Stock Market Logic. Norman Fosbeck. 1986:Institute for Economic Research.
New buys and sells are starred. "Old" sells that have not improved are
coded with an "S", and "old" buys are coded with "H" for hold. The 10-day
RSI is shown for reference only.
}
good_date = date;
alert := ' ';
comment := ' ';
lt = ' ';
it := ' ';
st := ' ';
yst := ' ';
rsi10 : array;
rsi_limit := 50;
if good_date = date then
BB1 : ARRAY; {Building block #1 of all 3 calculations }
BB2 : array; {building block #2. What Fosback calls Strength Rating.}
LT_CALC : ARRAY; {Long-term indicator}
IT_CALC : ARRAY; {Intermediate-term indicator}
ST_CALC : ARRAY; {Short-term calculation}
{ start computing Fosbacks }
BB1 := mov(c,150,'s');
BB2 := roc(c,65,'%');
LT_CALC := roc(bb1,5,'$');
IT_CALC := roc(bb2,5,'$');
ST_CALC := sub(mulby(subfrom(div(c,bb1),1),100),bb2);
rsi10 := rsi(10);
{code results}
IF LT_CALC > 0 THEN
LT = '+'
ELSE
LT = '-';
IF IT_CALC > 0 THEN
IT = '+'
ELSE
IT = '-';
IF ST_CALC > 0 THEN
ST = '+'
ELSE
ST = '-';
if st_calc[-1] > 0 then
yst = '+'
else
yst = '-';
tick_total = tick_total + 1;
if first_ticker then
begin
writeln(' ************************** TRENDS ****************** ')
;
writeln(' FULLNAME CLOSE LT IT ST RSI(10) ');
end;
{show new buy and sell signals}
if lt = '-' and it = '-' and st = '+' and rsi10 >= rsi_limit then
begin
buy_count = buy_count + 1
alert = 'B'
end;
if lt = '-' and it = '-' and st = '+' and yst = '-' and alert = 'B' then
begin
new_buy_count = new_buy_count + 1
comment = '***NEW BUY'
end;
if lt = '+' and it = '+' and st = '-' then
begin
sell_count = sell_count + 1
alert = 'S'
end;
if lt = '+' and it = '+' and st = '-' and yst = '+' and alert = 'S' then
begin
new_sell_count = new_sell_count + 1
comment = '***NEW SELL'
end;
if lt = '-' and it = '-' and st = '-' then
begin
pit_count = pit_count + 1
comment = 'In the Pits'
end;
if lt = '+' and it = '+' and st = '+' then
begin
top_count = top_count + 1
comment = 'Strong Hold'
end;
begin
write(FULLNAME,c,'\t',lt,'\t',it,'\t',st,'\t',alert,rsi10,'\t',comment
);
WRITELN();
end;
if last_ticker then
begin
writeln('\t\t\n\n************** SUMMARY ********************');
writeln('\tTickers Processed: ',INT(tick_total));
writeln('\tNumber in Buy Stage: ',int(buy_count));
writeln('\tNew Buys: ',int(new_buy_count));
writeln('\tNumber in Sell Stage: ',int(sell_count));
writeln('\tNew Sells: ',int(new_sell_count));
writeln('\tStrong Holds: ',int(top_count));
writeln('\tWeakest Stage: ',int(pit_count));
end;