home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / finance / tas515dm.zip / EXAMPLES.ZIP / MACD_BUY.TAS < prev    next >
Text File  |  1992-02-12  |  2KB  |  66 lines

  1. { MACD_BUY.TAS, by Werner Pelz
  2. Here is the BOTTOM-version, which picks MACD-signals after a substantial 
  3. decline in the underlying stocks. Try this one on JAPAN !!! It is basically
  4. the same script. Only the direction is different. I find it more useful to
  5. filter with 2 different scripts, because it's less confusing. So when your 
  6. guts tell you a market may be overdone on the upside, use the TOP-version.
  7. And vice versa for the downside. In either case, watch for the 3 moving
  8. averages. They represent the TRIPLE-MOVING-AVERAGE-COMPARISON-MODEL.
  9.  
  10.  
  11. SHORT-TERM-MA > MEDIUM-TERM-MA > LONG-TERM-MA  =  UPTREND
  12.  
  13. LT-MA         > MT-MA          > ST-MA         =  DOWNTREND
  14.  
  15. MT-MA         > ST-MA          > LT-MA         =  TURNING DOWN
  16.  
  17. LT-MA         > ST-MA          > MT-MA         =  TURNING UP
  18.  
  19.  
  20. Priority should be given to the trend. The sell signals you got should 
  21. shake hands with TURNING DOWN situations, i.e. the ST-MA crosses the MT-MA
  22. from top to down. I use 10-, 20- and 40-days-periods. Works smoothely.
  23.  
  24. }
  25. #max_quotes 100
  26. #output_file 'macd_buy.lst'
  27. graph_switch = 1;
  28. if first_ticker then
  29. begin
  30. writeln('TICKER   SHORT MA   LONG MA   MACD_$   MACD_%  TRIGGER');
  31. end;
  32. short_ma : array;
  33. short_ma = mov(c,12,'e');
  34. long_ma  : array;
  35. long_ma  = mov(c,25,'e');
  36. macd_abs : array;
  37. macd_abs = macd();
  38. macd_pct : array;
  39. macd_pct = DIV(macd(),short_ma)* 100;
  40. trigger  : array;
  41. trigger  = MACDTRI();
  42. if macd_pct < -2.0 and  macd_pct > - 3.0 and trigger < macd_abs then
  43. BEGIN
  44. gosub dograph;
  45. writeln(ticker,short_ma,'   ',long_ma,' ',macd_abs,'',macd_pct,
  46. ' ',trigger,'  ',' ***BUY***');
  47. if macd_pct < -3.0 and trigger < macd_abs then
  48. BEGIN
  49. gosub dograph;
  50. writeln(ticker,short_ma,'   ',long_ma,' ',macd_abs,'',macd_pct,
  51. ' ',trigger,'  ',' ***STRONG BUY***');
  52. END;
  53. return;
  54. :dograph
  55. if graph_switch = 0 then return;
  56. opengraph(2,-100,0);
  57. sizegraph(1,1);
  58. graph(1,mov(c,10,'s'),'10-days-SMA',mov(c,20,'s'),'20-days-SMA',
  59.       mov(c,40,'s'),'40-days-SMA')
  60. graph(macd(),'MACD-$',trigger,'TRIGGER')
  61. {drawline(11,0,2.0,0,2.0);}
  62. {drawline(13,0,3.0,0,3.0);}
  63. closegraph();
  64. return;
  65.  
  66.