View Single Post
  #2 (permalink)  
Old 06-30-2006, 06:49 AM
pipeline pipeline is offline
Member
 
Join Date: Mar 2006
Posts: 49
pipeline is on a distinguished road
I see you re trying hard, well done! At this stage I feel that what you need most is to know how to help yourself, so I would advise to use MQL's "NAvigator->Search" function _extensively_, you'll find answers to many of your questions (the only thing one can call from an indicator are the buffers, and this is done through iCustom(); Objects are not arrays etc. and much much more). For example, a search for "array" will teach that Current Bar's array index is 0, Last Bar's arrray index is 1 and so on.

If the search function entries are all overwhelming, you're probably trying to do stuff too difficult for you at this stage. I believe most of the examples above are touched on in codersguru's beginner's course, so I would recommend a second reading.
You might also take a simple EA, and try to simplify/modify it slightly, that will teach you how it works. Once it's done, you can try to complexify it.
Sorry if i m off the mark.

Now, in general, to work on Close price, you test for the Opening of a new bar and then write your conditions on arrays' index 1. A possible code to detect the Opening of a new bar:

bool NewBar()
{
static datetime dt = 0;

if (Time[0] != dt)
{
dt = Time[0];
return(true);
}
return(false);
}

Hope this helps, good luck.

Last edited by pipeline; 06-30-2006 at 06:55 AM.
Reply With Quote