均线交叉报警.pdfVIP

  • 5
  • 0
  • 约4.21千字
  • 约 7页
  • 2020-10-22 发布于广东
  • 举报
学 海 无 涯 1. #property indicator_chart_window 2. #property indicator_buffers 4 3. #property indicator_color1 Yellow 4. #property indicator_color2 White 5. #property indicator_color3 Yellow 6. #property indicator_color4 White 7. 8. // input parameters 9. extern int 均线周期 1=10; 10. extern int 均线周期 2=130; 11. extern int 类型 1=1; //类型: 0-SMA; 1-EMA; 2-SMMA; 3-LWMA 12. extern int 类型 2=1; //类型: 0-SMA; 1-EMA; 2-SMMA; 3-LWMA 13. extern string 类型说明=0-SMA; 1-EMA; 2-SMMA; 3-LWMA; 14. extern int 文字水平=0; 15. extern int 文字垂直=0; 16. extern int 文字大小=14; 17. extern string 文字标识=1; 18. extern color 文字颜色=Yellow; 19. extern int 是否报警=1; 20. extern int 是否发邮件=1; 21. // buffers 22. double Ma10[]; 1 学 海 无 涯 23. double Ma130[]; 24. double Up[]; 25. double Down[]; 26. int TimeInMinute; 27. int FlagAlert=0; 28. //+ + 29. //| Custom indicator initialization function | 30. //+ + 31. int init() 32. { 33. // indicators 34. IndicatorBuffers(4); 35. SetIndexStyle(0,DRAW_LINE); 36. SetIndexStyle(1,DRAW_LINE); 37. SetIndexStyle(2,DRAW_ARROW); 38. SetIndexStyle(3,DRAW_ARROW); 39. SetIndexBuffer(0,Ma10); 40. SetIndexBuffer(1,Ma130); 41. SetIndexBuffer(2,Up); 42. SetIndexBuffer(3,Down); 43. SetIndexArrow(2,233); 44. SetIndexArrow(3,234); 2 学 海 无 涯 45. TimeInMinute=0; 46. // 47. return(0); 48. } 49. 50. int start() 51. { 52. int i; 53. int limit; 54. string Signal; 55. int counted_bars=IndicatorCounted(); 56. // check for possible errors 57. if(counted_bars0) return(-1); 58. // the last counted bar will be recounted 59. if(counted_bars0) counted_bars--; 60. limit=Bars-counted_bars; 61. for (i=limit-1;i=0;i--) 62. { 63. Ma10[i]=iMA(NULL,0,均线周期 1,0,类型 1,PRICE_CLOSE,i); 64. Ma130[i]=iMA(NULL,0,均线周期 2,0,类型 2,PRICE_CLOSE,i);

文档评论(0)

1亿VIP精品文档

相关文档