Need Help with programming my EA

 

Hello friends,

I am building my first EA and have all my calculations done.

I want the calculations to run every time a new candle opens on a 1H chart.

How do i start the code for that?

For Example:

Every time a new candle opens:

1. A calculation is done.

2. Based on that calculation, a new order is opened which has TP & SL.


Any help will be highly appreciated. Basically i am new to programming.

 

For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart), volume is unreliable (miss ticks), Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
          New candle - MQL4 programming forum #3 (2014)

 
William Roeder #:

For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart), volume is unreliable (miss ticks), Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
          New candle - MQL4 programming forum #3 (2014)

Thanks Man. One more help.

Do I put my code below after // Once Per Bar line?

 

Good morning every body

I would like to build a robot with 2 indicators (stochastics and cycle identifier).

Can someone build it for me ?

Thanks

 
William Roeder #:

For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart), volume is unreliable (miss ticks), Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
          New candle - MQL4 programming forum #3 (2014)

Also how do i run my code again. Because I need it to run the code everytime a new candle is formed.
 
rameezajmeri :


Have you asked your question about which language: the old terminal or MQL5?

 
Vladimir Karputov #:

Have you asked your question about which language: the old terminal or MQL5?


MQL4 ***.

 
rameezajmeri # :

MQL4 ***.

This is the MQL5 forum. There is one special section for the old terminal: MQL4 and MetaTrader 4 . I will move your topic to a special section.

Reason: