first , middle and close candle code ...

 

hi

i want to try to get some Bid in different time in candle 15M ..

i mean, i want to know Bid in Minute 6 of a candle or some other time ..

i used for and sleep() for that and volume[0]=1 for opening candle

but its not good and i can't to have strategy test ...

so help me about that

this is my code ->

int start()
{
int y = 1;
while (y==1)
{
RefreshRates();
if(Volume[0]==1){
double a = Bid;
Sleep(6000);
RefreshRates();
double b = Bid ;
// do somthing
}
}
return(0);
}
 

  1. Volume[0]==1 is unreliable
    int start(){
       static datetime Time0; bool new.bar  = Time0 < Time[0];
       if (!new.bar) return(0);
       Time0 = Time[0];     ...
    

  2. i mean, i want to know Bid in Minute 6 of a candle or some other time
    iclose(null, PERIOD_M1, shift)
  3. Don't loop, exit and come back on the next tick. EA's should be written to handle the case of the terminal being resumed (inadvertent close, PC crash, or power failure.)
Reason: