HELP ME!!!!!!!!!please!!!!

 

The system will sell when the current price reach the upper bolinger bands,but it seems don't work .Help me,thank a million!!!!!!!

Files:
bands.mq4  2 kb
 

the program is trying to open a sell if the High of the current bar is above the upper band

change this line:

double myopen=iHigh(Symbol(),0,0);

to

double myopen=Bid;

 
NOOB250:

The system will sell when the current price reach the upper bolinger bands,but it seems don't work .Help me,thank a million!!!!!!!


1) Check the retcode from the OrderSend

2) Put Print() statments in your code so you can debug it and see what is going wrong. like this

//<---- Put this above the "if"

Print("bandshigh = " + DoubleToStr(bandshigh, Digits));
Print("bandslow = " + DoubleToStr(bandshigh, Digits));
Print("myopen = " + DoubleToStr(bandshigh, Digits));

//<---- Put this above the OrderSend

Print("About to make a trade");   

//<--- Check your error on order send like this

     ticket=OrderSend(Symbol(),OP_SELL,0.1,Bid,500,Bid+1000*Point,Bid-200*Point,"sell",1,0,White);
     if(!(ticket>=0))
         int err = GetLastError();
         
         Print("OrderSend() failed error #: " + err);


 

 
serpentsnoir:

the program is trying to open a sell if the High of the current bar is above the upper band

change this line:

double myopen=iHigh(Symbol(),0,0);

to

double myopen=Bid;


thank you it 's really helpful!
 
danjp:


1) Check the retcode from the OrderSend

2) Put Print() statments in your code so you can debug it and see what is going wrong. like this


thank you guys