Programing learner... Help...

 

Dear All...  I hope you are very well...

I learn to program and did a simple EA to determine the low value in the 3 last barr and open a buy order... but i have a problem, it did not put the order... Anybody can help me? The program get the low price and showed the Alert, but do not put the buy order...


Thanks in advanced...

//--------------------------------------------------------------------
// NewBar_jeaa_Rev 2.mq4
//--------------------------------------------------------------------
#property copyright "Jeaa"

extern int GV_CantidadBarras=3;
extern int digits=5;
//--------------------------------------------------------------------
extern double Lots               = 0.01;
extern double StopLoss           = 100;
extern double TakeProfit         = 100;
extern int    Slippage           = 3;


//--------------------------------------------------------------------
bool GV_Flag_NuevaBarra=false;
//======================================================================

int start()
{
double Precio;
//--------------------------------------------------------------------
Fun_NuevaBarra(); // Funcion call
if (GV_Flag_NuevaBarra==false)
return;
//=========================================================================


int IndMin =ArrayMinimum(Low, GV_CantidadBarras,1);

Precio=Low[IndMin];

int ticket=OrderSend(Symbol(),OP_BUY,Lots,Precio,Slippage,StopLoss,TakeProfit,"My orderrr",16384,0,Blue);

Alert(Symbol(),": Barras= ",GV_CantidadBarras, ", Min= ",DoubleToString(Precio,digits));

return;
    }

void Fun_NuevaBarra()
{
static datetime NewTime=0;
GV_Flag_NuevaBarra=false;

if(NewTime!=Time[0])
{
NewTime=Time[0];
GV_Flag_NuevaBarra=true;
}
}