Return to Snippet

Revision: 40887
at February 9, 2011 14:14 by luklukls


Initial Code
//+------------------------------------------------------------------+
//|                                                  sendi_trand.mq4 |
//|                          Copyright © 2010, Lukluk Software Corp. |
//|                                       http://www.dijaminpuas.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, Lukluk Software Corp."
#property link      "http://www.dijaminpuas.com"

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
      if(getSell())
      {
         DrawLine(Red);
      }
      if(getBuy())
      {
         DrawLine(Blue);
      }
      
//----
   return(0);
  }
//+------------------------------------------------------------------+
bool getSell()
{
   bool r=false;
   double s;
   s=iCustom(NULL,0,"TS",7,300,0,1);
   if(s>0)
   {
      r=true;
   }
   return(r);
}
bool getBuy()
{
   bool r=false;
   double s;
   s=iCustom(NULL,0,"TS",7,300,1,1);
   if(s>0)
   {
      r=true;
   }
   return(r);
}
void DrawLine(double cl)
{
         string name="x";
        ObjectCreate(name+Bars,OBJ_VLINE,0,TimeCurrent(),Open[0]);
        ObjectSet(name+Bars,OBJPROP_STYLE,STYLE_DASH);
        ObjectSet(name+Bars,OBJPROP_COLOR,cl);        
        
}

Initial URL


Initial Description


Initial Title
EA Using TrendSignal(1)

Initial Tags


Initial Language
C