have tried to print the arrows but all to no avail, please help me out, my codes are below.

Back to topics list  | 1 2 To post a new topic, please log in or register
avatar
19
younghadiz 2015.11.07 14:46 #
 
thanks sir . i just detected it now .
avatar
19
younghadiz 2015.11.07 14:46 #
 
thanks sir . i just detected it now .

#property indicator_chart_window
#property indicator_color1 Green
#property indicator_color2 Red

extern bool Alerts=TRUE;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {

   return (0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int deinit()
  {
   return (0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//----
   if(Alerts==TRUE)
     {
      if(Close[4]>Open[4] && Close[3]>Open[3] && Close[2]>Open[2] && Close[1]<Open[2])
        {
        Alert ("INDICATOR: ",Symbol()+" "+Period()+": Sell Alert @ "+DoubleToStr(Bid,Digits));
         string SELLSIGNAL="SELLSIGNAL"+(string)Time[1];
         if(ObjectFind(0,SELLSIGNAL)!=0)
           {
            ObjectCreate(SELLSIGNAL,OBJ_ARROW_DOWN,0,Time[1],High[1]);
            ObjectSet(SELLSIGNAL,OBJPROP_WIDTH,5);
            ObjectSet(SELLSIGNAL,OBJPROP_ARROWCODE,242);
            ObjectSet(SELLSIGNAL,OBJPROP_COLOR,Red);
            ObjectSetInteger(0,SELLSIGNAL,OBJPROP_ANCHOR,ANCHOR_TOP);
           }
           }
          if(Close[3]<Open[3] && Close[2]<Open[2] && Close[1]>Open[2])
           {
           Alert ("INDICATOR: ",Symbol()+" "+Period()+": Buy Alert @ "+DoubleToStr(Ask,Digits));
           
               string BUYSIGNAL="BUYSIGNAL"+(string)Time[1];
         if(ObjectFind(0,BUYSIGNAL)!=0)
           {
            ObjectCreate(BUYSIGNAL,OBJ_ARROW_BUY,0,Time[1],Low[1]);
            ObjectSet(BUYSIGNAL,OBJPROP_WIDTH,5);
            ObjectSet(BUYSIGNAL,OBJPROP_ARROWCODE,241);
            ObjectSet(BUYSIGNAL,OBJPROP_COLOR,Green);
            ObjectSetInteger(0,BUYSIGNAL,OBJPROP_ANCHOR,ANCHOR_BOTTOM);
              }
           }
        }
     
//----
   return(prev_calculated);
  }
//+------------------------------------------------------------------+

Back to topics list   | 1 2  

To add comments, please log in or register