int last_bar=0;
int start()
{
......
if(last_bar != iTime(Symbol(),0,0) )
{
last_bar = iTime(Symbol(),0,0); // update flag
//do your stuff here....
//.....
}
....
}
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
sI have been experimenting with various self-constructed EAs, but I cannot seem to get them to open at the beginning of a new bar (whatever time frame I use), after a trade has closed.
Could someone point me in the right direction to where I could obtain the necessary code, so that a new trade opens in the bar after closing the previous trade, or explain why I’m having this problem?
Thanks in advance.
PJH