string CheckEntry() { // create an empty string for the signal string signal=""; // symbol, period,20 candles, deviation 2, no shift, close price, candle double LowerBB=iBands(_Symbol,_Period,20,2,0,PRICE_CLOSE,MODE_LOWER,1); double UpperBB=iBands(_Symbol,_Period,20,2,0,PRICE_CLOSE,MODE_UPPER,1); // calculate the candle before double PrevLowerBB=iBands(_Symbol,_Period,20,2,0,PRICE_CLOSE,MODE_LOWER,2); double PrevUpperBB=iBands(_Symbol,_Period,20,2,0,PRICE_CLOSE,MODE_UPPER,2); // if price is above the last close if (Ask > Close[1]) // if close2 was below lower band if (Close[2]LowerBB) { signal="buy"; } // if price is below the last close if (Bid < Close[1]) // if close2 was above upper band if (Close[2]>PrevUpperBB) // if close1 is below upper band if (Close[1]