View Single Post
  #9 (permalink)  
Old 06-30-2006, 01:15 PM
Aaragorn's Avatar
Aaragorn Aaragorn is offline
Senior Member
 
Join Date: Jun 2006
Location: USA
Posts: 801
Aaragorn is on a distinguished road
Quote:
Originally Posted by pipeline

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.
it almost helps if you know what I mean..assuming it returns true then what, how do you get the value of the indicator out of the array at the current close now that it's been detected that there is a new bar?
Reply With Quote