Dose it posible to creat any function of "mql code" posting in this forum? - page 2

To add comments, please log in or register
alliedbassco
5
alliedbassco  

How do I code an EA to enter a trade at the open of a new candle?

Hi everyone,

Please forgive my ignorance, but I am new to the programming side of MQL4.

What I am trying to accomplish is enter one trade at the open of a new candle.

For example, if I had a 30min chart open, I would like to enter one trade at the open. Or if I had a 4hour chart open, how would I enter the trade at the open of that chart?

Also, I would like to enter only 1 trade at the open. I have tried a few commands and found it either entering the trade many times during the first minute, or not at all.

I have tried the "time current" function as well as "if minute = XXXX". The EA works when I backtest it, but when I try to put it on my live demo, it only works once in a while.

Any input would be greatly appreciated.

Thanks in advance.

Sergey Golubev
Moderator
117007
Sergey Golubev  

Moved your post to this thread where you will find some links about how to code one trade oer candle etc.

besides there are some other threads:

https://www.mql5.com/en/forum/173026

https://www.mql5.com/en/forum/general

Sergey Golubev
Moderator
117007
Sergey Golubev  
Sergey Golubev
Moderator
117007
Sergey Golubev
Moderator
117007
Sergey Golubev  

EA instant order requote problem: the thread with codes.

Mt4 and DDE: some programming issue.

Sergey Golubev
Moderator
117007
Sergey Golubev  

Timefilter:

- how to set EA's time in timefilter is on this post and this page.

- how to code timefilter in EAs (codes) is here.

- "Non-Trading Hours" on the screen fixing: example code; now it displays "Trading Hours" during trading hours and "Non-trading Hours" during non-trading hours. Thanks Locutus.

- how to code time filter: public thread.

Solution to computer restarts, keep those EAs running: some good suggestion about.

MM (money management) calculation, indicators, discussion, tools: calculate your lot size and so on. Original thread with several versions.

Magic number:

- Automatic Magic Function: small thread about how to do it.

- how to put magic number in EA: small elite section thread.

- magic number: small thread with explanation.

123
To add comments, please log in or register