Help: How to write simple EA to buy and sell at a specific time? - page 6

 

help getting rid of a function in skyline's "Daily Scalping EA"

I need some help modifying the ea to stop closing orders daily and/or weekly at a specific time

I just want it to close the trades only at TP or SL

this should be easy for a programmer but for a complete noob like me it's been like hell for the last 6 hours

any help please ?

 

EA not working right, please check

Can someone take a look at this Time Based EA and figure out why most of the times it doesn't trade when you tell it to and some time it will initiate on one currency but not another. Weird

Thanks

EDIT: looks like if the time is not exactly then it doesn't trade. Using IBFX noticed that the time jumps and skips seconds. How can I fix this?

Files:
 

I didnt write it but it takes your hour 1-24 multiples x 100 and adds your minute. one only knows what that totals.

ct = Hour() * 100 + Minute();

it also opens your buy at the open above the high/low.... not much for an ea.

 
ajk:
I didnt write it but it takes your hour 1-24 multiples x 100 and adds your minute. one only knows what that totals.

ct = Hour() * 100 + Minute();

it also opens your buy at the open above the high/low.... not much for an ea.

OK, thanks. All I want is an EA to open a trade at a specified time and thats it. Can you write one for me?

Thanks.

 

How specific would you like it?

You could say..

if (Hour() == 5 && Minute() == 30)

{

...

}

[/code]

or how about a 3 minute window?

[code]

if (Hour() == 5 && MathAbs(Minute() - 30 ) < 3)

{

...

}

You could also add Seconds() to the code, but I think that would be too restrictive since an EA only runs once per tick and you don't know when that tick will occur (during the slow times it may be awhile...)

 
Flying Fish:
How specific would you like it?

You could say..

if (Hour() == 5 && Minute() == 30)

{

...

}

[/code]

or how about a 3 minute window?

[code]

if (Hour() == 5 && MathAbs(Minute() - 30 ) < 3)

{

...

}

You could also add Seconds() to the code, but I think that would be too restrictive since an EA only runs once per tick and you don't know when that tick will occur (during the slow times it may be awhile...)

What is this actually doing? I don't understand what this code is doing.

Thanks you

 

I didn't understand.

This EA seems that starts and finishes to work for the time that you choice in the settings. Now, is it able to open a sell and buy order in the same time on the same pair with prefixed TP and SL?

 
matrixebiz:
What is this actually doing? I don't understand what this code is doing. Thanks you

I thought you were asking for some programming help, I missed the part were you wanted someone to code it for you. Please disregard my post.

 
 

Explanation about EA (with the same name and functions so may be it is the same EA) is on the first page of this thread.

And the other EAs are on this thread (as th links) https://www.mql5.com/en/forum

Reason: