Thank you for your reply.
You can't link the index to a specific bar within OnRender. You wouldn't be able to refer to a data series like closePrice[i] and expect that it has any relation to a specific bar. You'd need to make that assignment in OnBarUpdate.
Please let us know if we may be of further assistance to you.
Comment