Whch bar was my open trade made on?

 

Hi

Could somebody tell me the easiest way I can work out which bar an open trade was made on?

Thanks

Paul

 
int bar_number=iBarShift(NULL,0,OrderOpenTime());
 
stringo:
int bar_number=iBarShift(NULL,0,OrderOpenTime());
If OrderOpenTime() is not the bar (open) time, what is 'the nearest bar shift' stated in the documentation? The previous (older) bar or the next (more recent) bar?
 
stringo:
int bar_number=iBarShift(NULL,0,OrderOpenTime());


Thanks - much appreciated

 
fireflies:
stringo:
int bar_number=iBarShift(NULL,0,OrderOpenTime());
If OrderOpenTime() is not the bar (open) time, what is 'the nearest bar shift' stated in the documentation? The previous (older) bar or the next (more recent) bar?

If order was opened then bar exists in any case because bars are formed from incoming price ticks
Reason: