iClose is iCurrent

 

Can anyone explain why iClose uses every tick instead of the last tick that arrived at then end of the time period ?

iClose should be renamed iCurrent and a new iClose function that uses the last tick to arrive, by 59.9999 seconds at the last minute of the charts time period should be called iClose.

I know I could write my own function to do this but it would be less confusing if the developers had done it properly in the first place.

 

Write your function, MT4 is unlikely to be "enhanced".

 

what's wong with iClose()? It does what its name says, it will return the close price of every closed candle.


What would your proposed "better" iClose() do? Would it tell me the close price before the candle has actually closed? This would indeed be a useful function. If you got it working please post it here. Knowing on Monday where the week will close on Friday would be very useful.

 

iClose = iCurrent only for the zero bar.

 

Based on this thread, here is the best EA ever :-)

if(  iClose(Symbol(),PERIOD_D1, -1 )-Ask > 50*Point)
      OrderSend(Symbol(),OP_BUY,1.0, Ask,2, 0 /* no stop loss! we know Close[-1] */,Ask+50*Point,"",0,0,0);
 
gatornuke:

iClose = iCurrent only for the zero bar.

Also you don't know when a bar will close until you get the next tick. So just before that tick iClose does equal the bars final close.
Reason: