EA not picking trades

Back to topics list To post a new topic, please log in or register
avatar
49
Opengates 2015.11.16 02:59
 

Hello Everybody,

Please I need your help. I made this ea to pick trades on news release but when the time set is reached it doesn't pick trades.

Take a look at the code below maybe there is something I am doing wrong: Thanks in advance

extern string        newsdate         = "2015.06.10"; // Date for the News to be released
extern string        newstime         = "14:00";   // Time for the News to be released

datetime Cur_time=TimeCurrent();
string   timedate=StringConcatenate(newsdate," ",newstime);
datetime Starttime=StrToTime(timedate); 

 if(Cur_time>=Starttime && clear_to_send) { 
    RefreshRates();
    Ticket=OrderSend(Symbol(),OP_BUYSTOP,lot,Ask+iDstc*Point,0,Bid-(stp_ls*Point+iDstc*Point),Bid+(iTp1*Point+iDstc*Point));     
    Ticket=OrderSend(Symbol(),OP_BUYSTOP,lot,Ask+iDstc*Point,0,Bid-(stp_ls*Point+iDstc*Point),Bid+(iTp2*Point+iDstc*Point));    
    Ticket=OrderSend(Symbol(),OP_SELLSTOP,lot,Bid-iDstc*Point,0,Ask+(stp_ls*Point+iDstc*Point),Ask-(iTp1*Point+iDstc*Point));        
    Ticket=OrderSend(Symbol(),OP_SELLSTOP,lot,Bid-iDstc*Point,0,Ask+(stp_ls*Point+iDstc*Point),Ask-(iTp2*Point+iDstc*Point));      
    clear_to_send=false;   }    
avatar
Moderator
3427
GumRai 2015.11.16 03:38 #
 

Check if an OrderSend fails and print the error

Where is clear_to_send set to true? 

Why are you calculating Stoploss and Take profits on Bid and Ask? They should be calculated from the entry price. 

Back to topics list  

To add comments, please log in or register