How to obtain the closed price within a specified period?

 

Hi, I would like to draw to vertical line on the current chart. Let's called these lines "start" and "end".

How can I obtain the prices within these lines (time period).

Please help. Thanks.

 

If you have the bar numbers of the vertical lines you can use Close[bar_number] and simply loop between bar_start and bar_finish and populate an array with the close values.

If you don't have the bar numbers but you have the datetime you can use iBarshift(Null,0, datetime) to get the bar numbers . . . if you don't have the datetime you can get it by looking at the Object Properties using ObjectGet and OBJPROP_TIME1

Reason: