Quote:
Originally Posted by Limstylz
Hi,
Can someone please explain the difference between the following:
if(Close[1] == Open[1])
and
if (iClose(NULL,0,1) == iOpen(NULL,0,1))
Where would I use iClose(NULL,0,1) instead of Close[1] and visa versa?
I'm having some real difficulty in learning the nuances with this language and would be grateful if someone can enlighten me.
Thanks in advance.
|
Close[i] and Open[i] are arrays that contain the price elements of the i bar of the current pair in the current timeframe (chart window)
iClose() and iOpen() are functions that retreives the price element of the stated sysbol, in the given time frame with the shift requested, These function can retreive any price elements but the sysbol must be listed in the market watch window and a history file that goes back to cover the bars or shift back. you can use either formate for the current sysbol and current time frame, so the two examples you gave should return the same answer, but
iClose(GBPUSD, 15, 2 ) would return the close of the Cable two bars back not counting the current bar on a 15 minute chart, again the cable must be actively listed in the market watch window and you must have a history file that contains the close two bars back , now
iClose(GBPUSD, 15, 0 ) will return the current bars value of the last known bid price of the Pound US even if the bar has not closed yet.
Keit