error send arrow

To add comments, please log in or register
Alberto Pinto
27
Alberto Pinto  
Good afternoon, I have this code, inserted in an EA, and I wanted it, whenever I comply, the rule of a signal, with an arrow, only that it fulfills the signal, once up and once down, and does not come anymore Arrows

int APTO_10 = 1;

int APTO_101=1;

if (Seconds() != 0){
        APT_10 =0;
        APT_101=0;
        }   

if((TRENDD_S == "UP") &&
   ((Minute() == 0 || Minute() == 5 ||Minute() == 10 ||Minute() == 15 ||Minute() == 20 ||Minute() == 25
   ||Minute() == 30 ||Minute() == 35 ||Minute() == 40 ||Minute() == 45 ||Minute() == 50 ||Minute() == 55)) && (ORDTT_S < 1) && Seconds() < 1){
   if(APT_10 < APTO_10){
   MESSAGE = "Signal Buy  " + Symbol();
   SendNotification(MESSAGE);
   Alert(Symbol(),SIGNAL_BUY);
   ObjectCreate("UpEURUSD ",OBJ_ARROW,0,Time[0],Low[0]);
   ObjectSet ("UpEURUSD",OBJPROP_COLOR,Green);
   ObjectSet("UpEURUSD ",OBJPROP_ARROWCODE,233);
   APT_10++;
      }
   }
   if((TRENDD_S == "DOWN") &&
   ((Minute() == 0 || Minute() == 5 ||Minute() == 10 ||Minute() == 15 ||Minute() == 20 ||Minute() == 25
   ||Minute() == 30 ||Minute() == 35 ||Minute() == 40 ||Minute() == 45 ||Minute() == 50 ||Minute() == 55)) && (ORDTT_S < 1) && Seconds() < 1){
   if(APT_101 < APTO_101){
   MESSAGE = "Signal Sell  " + Symbol();
   SendNotification(MESSAGE);
   Alert(Symbol(), SIGNAL_SELL);
   ObjectCreate("DownEURUSD ",OBJ_ARROW,0,Time[0],High[0]);
   ObjectSet ("DownEURUSD",OBJPROP_COLOR,Red);
   ObjectSet("DownEURUSD ",OBJPROP_ARROWCODE,234);
   APT_101++;
      }
   }

whroeder1
17944
whroeder1  
  1. When you post code please use the SRC button !

  2. if (Seconds() != 0){
            APT_10 =0;
            APT_101=0;
            }   
    If you do not receive a tick during the first second of a minute this code doesn't run. There can be minutes between ticks during the Asian session, think M1 chart. There can be days between ticks, think weekend, market holiday. Remember the previous datetime and reset after a duration.

  3. Your code
    ((Minute() == 0 || Minute() == 5 ||Minute() == 10 ||Minute() == 15 ||Minute() == 20 ||Minute() == 25
       ||Minute() == 30 ||Minute() == 35 ||Minute() == 40 ||Minute() == 45 ||Minute() == 50 ||Minute() == 55))
    Simplified
    ((Minute() % 5 == 0))

  4. ObjectCreate("DownEURUSD ",OBJ_ARROW,0,Time[0],High[0]);
    You create the object, there can be only one with the same name. Why would you expect more?
To add comments, please log in or register