static int lastway =0;
static int way =0;
static int direct=0;
int check (double cci ,double point)
{
if(cci > point)
{
way=1;
}
if(cci < point)
{
way=2;
}
if(way!= lastway)
{
lastway = way;
direct = 1;
return (lastway);
}
return (0);
}
int start()
{
int total;
int ticket;
double cci46=iCCI(NULL,0,46,PRICE_TYPICAL,0);
int go= check(cci46,5.0);
total=OrdersTotal();
if(total<1)
{
if(go==1 && direct==1)
{
ticket=OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Ask-Point*100,Ask+Point*50,"firstea",0,0,Green);
OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES);
direct=0;
}
return (0);
}
}