¿OP_BUY/SELL setting tha exact operation?

 

Hi all,

It's my first post here.

I'm starting to learn about EA recebtly, and I've a doubt about time functions. I've been looking for a code that allow to buy/sell at a specific time, but I only found examples that work with a time value of HH:MM. What about seconds? Is it possible to define a buy/sell order, at an specific HH:MM:SS?

I made some trials, but what I only obtain are orders executed at the begining of the stablish minute. For example, how can i set a buy order at 14:55:55?

I tried samples with this kind of terms, but with no results (based on the Timentry.mq4 file):

extern int    Hour_For_Long_Entry    = 14;    
extern int    Minute_For_Long_Entry  = 55;
extern int    Seconds_For_Long_Entry = 55;

[...]

 if(Long_Entry==true && Hour()==Hour_For_Long_Entry && Minute()==Minute_For_Short_Entry && Seconds()==Seconds_For_Short_Entry && IsTradeAllowed()==true)

=>OP_BUY/SELL....


Sorry for such elementary question (novice).


Thanks in advance.

Dek.

 
dekam30:

I made some trials, but what I only obtain are orders executed at the begining of the stablish minute. For example, how can i set a buy order at 14:55:55?

I tried samples with this kind of terms, but with no results (based on the Timentry.mq4 file):

Dek.

Please post MT4-related questions on the MT4 forum
MQL4: automated trading forum
  • www.mql5.com
MQL4: automated trading forum
 
Malacarne:
Please post MT4-related questions on the MT4 forum

UPppsss¡¡

Sorry¡ :)

Reason: