Main price chart with Rainbow & SAR.afl
上传用户:shiqiang
上传日期:2009-06-12
资源大小:1289k
文件大小:2k
源码类别:

金融证券系统

开发平台:

Others

  1. //------------------------------------------------------------------------------
  2. //
  3. //  Formula Name:    Main price chart with Rainbow & SAR
  4. //  Author/Uploader: Chih-chiang Chen 
  5. //  E-mail:          bbj@mail.apol.com.tw
  6. //  Date/Time Added: 2001-11-04 21:55:45
  7. //  Origin:          Rainbow Chart
  8. //  Keywords:        rainbow chart, sar
  9. //  Level:           basic
  10. //  Flags:           indicator
  11. //  Formula URL:     http://www.amibroker.com/library/formula.php?id=131
  12. //  Details URL:     http://www.amibroker.com/library/detail.php?id=131
  13. //
  14. //------------------------------------------------------------------------------
  15. //
  16. //  The price chart will change color according to sar().
  17. //
  18. //  The red line= 20ma and Blue line = 50MA
  19. //
  20. //  For better visual effect.
  21. //
  22. //  Could someone add volume chart in this chart(like the original price chart
  23. //  does)?
  24. //
  25. //------------------------------------------------------------------------------
  26. /*Main Chart with Rainbow and SAR*/
  27. maxgraph = 15;
  28. graph0 = close;
  29. graph1 = Ma(C,2);
  30. graph2 = Ma(Ma(C,2),2);
  31. graph3 = Ma(Ma(Ma(C,2),2),2);
  32. graph4 = Ma(Ma(Ma(Ma(C,2),2),2),2);
  33. graph5 = Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2);
  34. graph6 = Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2);
  35. graph7 = Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2);
  36. graph8 = Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2);
  37. graph9 = Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2),2);
  38. graph10 = Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2),2),2);
  39. graph0style =64;
  40. graph1style=graph2style=graph3style=graph4style=graph5style=graph6style=graph7style=graph8style=graph9style=graph10style = 1;
  41. graph0barcolor=iif(sar(0.05)<C,2,1);
  42. graph1color = 3;
  43. graph2color = 5;
  44. graph3color =7;
  45. graph4color = 6;
  46. graph5color =15;
  47. graph6color = 8;
  48. graph7color =16;
  49. graph8color = 10;
  50. graph9color = 11;
  51. graph10color = 12;
  52. graph11=ma(C,20);
  53. graph11style=1;
  54. graph11color=5;
  55. graph12=ma(C,50);
  56. graph12style=1;
  57. graph12color=7;
  58. title=name() +"  "+date()+"  Open="+writeval(O)+
  59.         ",  High ="+writeval(H)+",  Low ="+writeval(L)+
  60.         ",  Close="+writeval(C)+",  Change="+writeif((C-ref(C,-1))>0," +"," -")+
  61.          writeval(C-ref(C,-1))
  62.         +"  ("+writeif((C-ref(C,-1))>0," +"," -")+writeval((C-ref(C,-1))/ref(C,-1)*100)+"%  )";