# Close price at specific time

14

Hi, need for my strategy to count entry price Close from yestrday specific time .

examples Yestrday Close price on 15 min chart at 22:15 bar .

I was traing lot of code but still nothing passed for me .

Thanks for each idea.

15577

stentasch: Yestrday Close price on 15 min chart at 22:15 bar .
```string   PriceToStr(double p){   return( DoubleToStr(p, Digits) );            }
#define HR2400 PERIOD_D1 * 60    // 86400 = 24 * 3600
int      TimeOfDay(datetime when=0){      if(when == 0)  when = TimeCurrent();
return( when % HR2400 );            }
datetime DateOfDay(datetime when=0){      if(when == 0)  when = TimeCurrent();
return( when - TimeOfDay(when) );   }
//datetime Tomorrow( datetime when=0){      if(when == 0)  when = TimeCurrent();
//                                          return(DateOfDay(when) + HR2400);   }
datetime Yesterday(datetime when=0){      if(when == 0)  when = TimeCurrent();
int iD1 = iBarShift(NULL, PERIOD_D1, DateOfDay(when) - 1);
return( iTime(NULL, PERIOD_D1, iD1) ); }
#define HR2215 80100 // 22*3600+15*60
int      iChart = iBarShift(NULL,0, Yesterday()+HR2215);
datetime when   = Time[iChart];
double   price  = Close[iChart];
Print("Close @ ", TimeToStr(when, TIME_DATE|TIME_MINUTES|TIME_SECONDS), "=", PriceToStr(price) );
```
14

WHRoeder:

Thank you very much .Working great.