int TF = PERIOD_M5;
int pbl_Bars=0; int start()
{
if(pbl_Bars==0)
{
if(pbl_Bars==Bars)
{
if(isBearish_Engulfing())
{
pbl_Bars--;
}
return (0);
}
bool isBearish_Engulfing()
{
if(!(iOpen(Symbol(),TF,1) > iClose(Symbol(),TF,1)))
{
return (false);
}
if(!(iOpen(Symbol(),TF,2) < iClose(Symbol(),TF,2)))
{
return (false);
}
if(!((iOpen(Symbol(),TF,2) > iClose(Symbol(),TF,1)) && (iClose(Symbol(),TF,2) < iOpen(Symbol(),TF,1))))
{
return (false);
}
if(!((iOpen(Symbol(),TF,3) < iClose(Symbol(),TF,3)))
{
return (false);
}
if(! ((iClose(Symbol(),TF,3) - iOpen(Symbol(),TF,3)) > (iClose(Symbol(),TF,2) - iOpen(Symbol(),TF,2))))
{
return (false);
}
OpenOrder(OP_SELL);
}
return (true);
}
bool OpenOrder(int cmd)