Posted By

luklukls on 02/09/11


Tagged

Forex


Versions (?)

EA Using TrendSignal(1)


 / Published in: C
 

  1. //+------------------------------------------------------------------+
  2. //| sendi_trand.mq4 |
  3. //| Copyright © 2010, Lukluk Software Corp. |
  4. //| http://www.dijaminpuas.com |
  5. //+------------------------------------------------------------------+
  6. #property copyright "Copyright © 2010, Lukluk Software Corp."
  7. #property link "http://www.dijaminpuas.com"
  8.  
  9. //+------------------------------------------------------------------+
  10. //| expert initialization function |
  11. //+------------------------------------------------------------------+
  12. int init()
  13. {
  14. //----
  15.  
  16. //----
  17. return(0);
  18. }
  19. //+------------------------------------------------------------------+
  20. //| expert deinitialization function |
  21. //+------------------------------------------------------------------+
  22. int deinit()
  23. {
  24. //----
  25.  
  26. //----
  27. return(0);
  28. }
  29. //+------------------------------------------------------------------+
  30. //| expert start function |
  31. //+------------------------------------------------------------------+
  32. int start()
  33. {
  34. //----
  35. if(getSell())
  36. {
  37. DrawLine(Red);
  38. }
  39. if(getBuy())
  40. {
  41. DrawLine(Blue);
  42. }
  43.  
  44. //----
  45. return(0);
  46. }
  47. //+------------------------------------------------------------------+
  48. bool getSell()
  49. {
  50. bool r=false;
  51. double s;
  52. s=iCustom(NULL,0,"TS",7,300,0,1);
  53. if(s>0)
  54. {
  55. r=true;
  56. }
  57. return(r);
  58. }
  59. bool getBuy()
  60. {
  61. bool r=false;
  62. double s;
  63. s=iCustom(NULL,0,"TS",7,300,1,1);
  64. if(s>0)
  65. {
  66. r=true;
  67. }
  68. return(r);
  69. }
  70. void DrawLine(double cl)
  71. {
  72. string name="x";
  73. ObjectCreate(name+Bars,OBJ_VLINE,0,TimeCurrent(),Open[0]);
  74. ObjectSet(name+Bars,OBJPROP_STYLE,STYLE_DASH);
  75. ObjectSet(name+Bars,OBJPROP_COLOR,cl);
  76.  
  77. }

Report this snippet  

You need to login to post a comment.