MQL4 - automated forex trading   /  

Forum

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

Back to topics list To post a new topic, please log in or register

avatar
3
NOOB250 2012.01.28 01:24 

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

Attached files:
  bands.mq4 (1.08 KB)
Displaying a News Calendar

Displaying a News Calendar

This article contains the description of writing a simple and convenient indicator displaying in a working area the main economic events from external Internet resources.


avatar
135
serpentsnoir 2012.01.28 02:03 

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;


avatar
123
danjp 2012.01.28 02:29 
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);


 


avatar
3
NOOB250 2012.01.28 13:56 
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!

avatar
3
NOOB250 2012.01.28 13:57 
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
Back to topics list  

To add comments, please log in or register