MQL4 - automated forex trading   /  

Forum

Why does my EA miss the next bar after closing a trade?

Back to topics list To post a new topic, please log in or register

avatar
3
pjh606 2008.11.20 16:46 

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

article

Interview with Michael Bullock (Zonker)

Constantly plowing back all the profit and scaling up the position is pure suicide trading on a real account. But that is not relevant, this is a competition, over 250 competitors, and only three walk away with anything. You do whatever it takes to maximize your chances to be in that Top Three. I'm not sure you can talk about risk in the context of the competition, risk implies you might lose something, but here there is only a chance to gain for those who beat the odds.


avatar
158
abstract_mind 2008.11.20 17:21 

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....

//.....

}

....

}

Back to topics list  

To add comments, please log in or register