Forex



Go Back   Forex Trading > Programming > MetaTrader
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 10-02-2008, 03:22 AM
Senior Member
 
Join Date: Aug 2008
Location: London
Posts: 138
Limstylz is on a distinguished road
Can someone explain the difference...

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 10-02-2008, 03:52 AM
Senior Member
 
Join Date: Nov 2006
Posts: 308
luxinterior is on a distinguished road
iClose and iOpen are extensions of their array counterparts and allow you to select a different currency pair and different time frame. The array functions only operate on the currency pair on which your EA or indicator are placed.

Hope that helps.

Lux

PS: For more information and usage examples be sure to check the MetaEditor help file. It's your BEST friend!
__________________
Build An Expert Advisor. FREE E-course As Seen On TV
ForexArea.com
Users of Gap Trader from 'Forex-Assistant' MUST Read This
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 10-02-2008, 04:05 AM
cockeyedcowboy's Avatar
Senior Member
 
Join Date: Nov 2005
Posts: 480
cockeyedcowboy is on a distinguished road
Quote:
Originally Posted by Limstylz View Post
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

Last edited by cockeyedcowboy; 10-02-2008 at 04:13 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 10-02-2008, 04:31 AM
Senior Member
 
Join Date: Aug 2008
Location: London
Posts: 138
Limstylz is on a distinguished road
Thanks Gentlemen

Thanks guys.

I tried looking in the help file but could not find a definitive answer. I don't think the help file was written with novices in mind.

To reiterate, if I am coding with global values, I should use Close and if I need to be more specific or to concern the current bars current state I use iClose?

This is just opening up a can of worms for me. Perhaps I should give up and stick to manual trading...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can anybody explain this indicator victornelson Indicators - Metatrader 4 5 11-26-2007 01:57 PM
Carry trading, please explain. thecross General Discussion 2 07-03-2007 09:46 AM
Can somebody explain this!! rarango General Discussion 1 02-23-2007 06:33 AM
Demark arrow please explain toddanderson Indicators - Metatrader 4 0 12-22-2006 03:52 PM
Charts to explain in chatroom iGoR Post and compare Trades 9 07-07-2006 07:28 PM


All times are GMT. The time now is 05:05 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.