Checking Candle Open - page 2

 
Buy trades are closed at Bid, not Ask
 
GumRai:
Buy trades are closed at Bid, not Ask

I tried that, but that didn't seem to work either. In the end what did work, was that I simply changed it to: if(iClose(NULL,0,1)<PreviousSlow) and that seemed to work!

Thanks again for all the help GumRai! Truly appreciated! See you around :)

 
if(OrdersTotal()==0)
Not filtering by magic number makes EA incompatible with all others (including itself on other TFs,) and manual trading Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 forum
 
GumRai:
The code within the curly brackets will only be executed at the first tick of a new bar
GumRai:
The code within the curly brackets will only be executed at the first tick of a new bar
Better to use Bars
 
eevviill: Better to use Bars
Bars is unreliable (a refresh/reconnect can change number of bars on chart) volume is unreliable (miss ticks) Always use time. New candle - MQL4 forum
 
WHRoeder:
Not filtering by magic number makes EA incompatible with all others (including itself on other TFs,) and manual trading Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 forum

Hi WHRoeder, thanks a lot for the info. So let me break this down so I understand it better.

  1. The time-frame code that GumRai has provided are the right way for candle-open correct?
  2. Regarding the rest of the code: the way I have it right now, it'll fail the moment I try to use this for more than one pair at a time? This might explain why I'm getting a 4051 error code in the journal.
  3. The code in the link you have provided, how and where does that fit in, especially since I still have to create a 'mirror' code for the EA that goes short (basically following the same but opposite rules)?

 
If you write direction independent code you don't need to write 'mirror' code. See My Code
 
WHRoeder:
eevviill: Better to use Bars
Bars is unreliable (a refresh/reconnect can change number of bars on chart) volume is unreliable (miss ticks) Always use time. New candle - MQL4 forum

And?

Reconect will not change Time of bar?! Hahaha... 

 

Don't Hahaha me. THINK.

The time of a bar is fixed. It never changes.

If a new bar forms the time of the bar of the same index changes.

 
WHRoeder:
If you write direction independent code you don't need to write 'mirror' code. See My Code

Thanks a lot for this WHRoeder. I'm working till really late these days, so I'll get to this in a few days--it will take me some time to understand it, as your code is quite complex. 

That said, when I try and just put the code in on a new sheet of expert advisor, it gives a whole bunch of errors and does not recognize data that has periods in it such as this one:

extern int     Magic.Number.Base          = 20130213;

 It sees Magic Number and Base as separate...any idea why it's doing that?

Reason: