Hi sunshine
This is what I've often done:
datetime ThisBarTime; // declare an EA global variable to store bar time ... int init() { ... ThisBarTime = Time[0]; ... } int start() { ... if( ThisBarTime != Time[0] ) // it must be a new bar { ... // the code here executes once per bar ThisBarTime = Time[0]; } ... }
Cheers
Jellybean
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
I want to programm an EA, which only open a new order when the close price of the candle matches my requirements.
How can I programm it, that the EA has only to look at the close time of the actual candle or at the start time from the following.
I hope you can understand my problem and give me a tipp for the solution.
Perhaps I have only a black out and that is a very silly question?!
Lot's of thanks!