Attaching a Custom Indicator in making my EA

 
Good day to everyone. I have an indicator here that shows arrows in my chart. If the arrows pointin up then i will buy and if the arrows pointing down then i will sell. I try to attach it in my EA but when i try it on the tester, when the arrow appears and pointing up...it Opens a multiple buy position. What codes i will add so that when the arrow appear it will open 1 trade in every arrow. 

Thank you in advance. I hope someone can help me to solve my problem. God Bless you all. 
 
Nieco Pama:
Good day to everyone. I have an indicator here that shows arrows in my chart. If the arrows pointin up then i will buy and if the arrows pointing down then i will sell. I try to attach it in my EA but when i try it on the tester, when the arrow appears and pointing up...it Opens a multiple buy position. What codes i will add so that when the arrow appear it will open 1 trade in every arrow. 

Thank you in advance. I hope someone can help me to solve my problem. God Bless you all. 

 if (IsNewCandle())
    {

What codes i will add so that when the arrow appear it will open 1 trade in every arrow.

     }


bool IsNewCandle()
{
   static int BarsOnChart=0;
    if (Bars == BarsOnChart)
    return (false);
    BarsOnChart = Bars;
    return(true);
}

 
Nedyalka Zhelyazkova:

 if (IsNewCandle())
    {

What codes i will add so that when the arrow appear it will open 1 trade in every arrow.

     }


bool IsNewCandle()
{
   static int BarsOnChart=0;
    if (Bars == BarsOnChart)
    return (false);
    BarsOnChart = Bars;
    return(true);
}

Thank you very much for you being so generous with your knowledge. God Bless you more.

 
thank God Almighty, not me
Reason: