Arrow for consecutive three candles - indicator

 

Trying to place an arrow/text if there is three consecutive bearish or bullish candles formed. Tried a couple of options, but unable to handle Arrow's position. Either too many arrows got painted or the location was at the wrong place. Also tried place text but no luck.

#property copyright ""
#property link ""
#property indicator_chart_window
#property indicator_buffers 0

// exported variables

// local variables
string LF = "\n";  // use this in custom or utility blocks where you need line feeds
int ObjCount = 0;  // count of all objects created on the chart, allows creation of objects with unique names
int current = 0; // variable points to current bar
int init()
{
    if (true) ObjectsDeleteAll();      // clear the chart
    IndicatorShortName("");
    IndicatorDigits(0);
    IndicatorBuffers(0);
    
    
    return(0);
}

//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
{
    if (true) ObjectsDeleteAll();
    
    
    return(0);
}

//+------------------------------------------------------------------+
//| Custom indicator start function                                  |
//+------------------------------------------------------------------+
int start()
{
    OnEveryTick1();
    
    return(0);
}

//+------------------------------------------------------------------+

void OnEveryTick1()
{
    
    int i;
    int counted_bars = IndicatorCounted();
    if(counted_bars < 0) return(-1);
    if(counted_bars > 0) counted_bars--;
    i = Bars - counted_bars;
    // main calculation loop
    while (i >= 0)
    {
        current = i;
        TA();
        
        i--;
    }
}

void TA()
{
    if (Open[1] > Close[1] && Open[2] > Close[2] && Open[3] > Close[3])
    {
        Arrow();
        
    }
}

void Arrow()
{
    ObjCount += 1;
    string objName = "EAChart_" + ObjCount;
    ObjectCreate(objName, OBJ_ARROW, 0, Time[current], Bid);
    ObjectSet(objName, OBJPROP_COLOR, White);
    ObjectSet(objName, OBJPROP_ARROWCODE, SYMBOL_ARROWUP);
    
}


#property indicator_chart_window // an indicator is drawn in the main chart window
#property indicator_buffers 1
int limit;
int init ()
{
//----
return(0);
}
int deinit()
{
return(0);
}
int start()
{
string text;
int counted_bars=IndicatorCounted();
limit=Bars-counted_bars;
//---- check for possible errors
if(counted_bars<0) {
Alert("No Bars..");
return(-1);
}
//---- last counted bar will be recounted
for(int i=1; i<limit; i++) {
text="";
    if (Open[1] > Close[1] && Open[2] > Close[2] && Open[3] > Close[3])
     text="3HC";

if(text!="")
{
ObjectCreate(DoubleToStr(i,0)+" label", OBJ_TEXT, 0, Time[i], High[i]);
ObjectSetText(DoubleToStr(i,0)+" label", text, 10, "Arial",Yellow);
}
}
}
Reason: