// Indicator: BB_Cross.mq4

#property copyright "Created with EABuilder.com"
#property link      "https://www.eabuilder.com"
#property version   "1.00"
#property description ""

#include <stdlib.mqh>
#include <stderror.mqh>

#property indicator_chart_window
#property indicator_buffers 2

#property indicator_type1 DRAW_ARROW
#property indicator_width1 3
#property indicator_color1 0xFFAA00
#property indicator_label1 "Buy"

#property indicator_type2 DRAW_ARROW
#property indicator_width2 3
#property indicator_color2 0x0000FF
#property indicator_label2 "Sell"

#define PLOT_MAXIMUM_BARS_BACK 5000
#define OMIT_OLDEST_BARS 50

double Buffer1[];
double Buffer2[];

extern int Period_BB = 20;
extern double Deviations = 1;
datetime time_alert;
extern bool Audible_Alerts = true;
extern bool Push_Notifications = true;
double myPoint;

void myAlert(string type, string message) {
   if(type == "print")
      Print(message);
   else if(type == "error")
      Print(type+" | BB_Cross @ "+Symbol()+","+IntegerToString(Period())+" | "+message);
   else if(type == "indicator") {
      if(Audible_Alerts) Alert(type+" | BB_Cross @ "+Symbol()+","+IntegerToString(Period())+" | "+message);
      if(Push_Notifications) SendNotification(type+" | BB_Cross @ "+Symbol()+","+IntegerToString(Period())+" | "+message);
   }
}

int OnInit() {
   IndicatorBuffers(2);
   SetIndexBuffer(0, Buffer1);
   SetIndexEmptyValue(0, EMPTY_VALUE);
   SetIndexDrawBegin(0, MathMax(Bars(Symbol(), PERIOD_CURRENT)-PLOT_MAXIMUM_BARS_BACK+1, OMIT_OLDEST_BARS+1));
   SetIndexArrow(0, 241);
   SetIndexBuffer(1, Buffer2);
   SetIndexEmptyValue(1, EMPTY_VALUE);
   SetIndexDrawBegin(1, MathMax(Bars(Symbol(), PERIOD_CURRENT)-PLOT_MAXIMUM_BARS_BACK+1, OMIT_OLDEST_BARS+1));
   SetIndexArrow(1, 242);
   myPoint = Point();
   if(Digits() == 5 || Digits() == 3)
      myPoint *= 10;
   return(INIT_SUCCEEDED);
}

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[]) {

   int limit = rates_total - prev_calculated;
   ArraySetAsSeries(Buffer1, true);
   ArraySetAsSeries(Buffer2, true);
   
   if(prev_calculated < 1) {
      ArrayInitialize(Buffer1, EMPTY_VALUE);
      ArrayInitialize(Buffer2, EMPTY_VALUE);
   } else limit++;
   
   bool arrowPlotted = false; // Add this variable to track if an arrow has been plotted
   
   for(int i = limit-1; i >= 0; i--) {
      if (i >= MathMin(PLOT_MAXIMUM_BARS_BACK-1, rates_total-1-OMIT_OLDEST_BARS)) continue;

      if (!arrowPlotted && Close[i] > iBands(NULL, PERIOD_CURRENT, Period_BB, Deviations, 0, PRICE_CLOSE, MODE_UPPER, i)
      && Close[i+1] < iBands(NULL, PERIOD_CURRENT, Period_BB, Deviations, 0, PRICE_CLOSE, MODE_UPPER, i+1)) {
         Buffer1[i] = Low[i] - iATR(NULL, PERIOD_CURRENT, 14, i);
         if(i == 1 && Time[1] != time_alert) myAlert("indicator", "Buy");
         time_alert = Time[1];
         arrowPlotted = true; // Arrow plotted, ensure no further arrows in this loop
      } else {
         Buffer1[i] = EMPTY_VALUE;
      }

      if (!arrowPlotted && Close[i] < iBands(NULL, PERIOD_CURRENT, Period_BB, Deviations, 0, PRICE_CLOSE, MODE_LOWER, i)
      && Close[i+1] > iBands(NULL, PERIOD_CURRENT, Period_BB, Deviations, 0, PRICE_CLOSE, MODE_LOWER, i+1)) {
         Buffer2[i] = High[i] + iATR(NULL, PERIOD_CURRENT, 14, i);
         if(i == 1 && Time[1] != time_alert) myAlert("indicator", "Sell");
         time_alert = Time[1];
         arrowPlotted = true; // Arrow plotted, ensure no further arrows in this loop
      } else {
         Buffer2[i] = EMPTY_VALUE;
      }
   }
   return(rates_total);
}

still sell arrow show again after first sell found and already displayed