programming in mql5

 
Hello,
I am new to programming and wanted an answer to my following question. 
In mql5 the instructions in the Ontick function are executed at each Tick. is there a way to take the price value (bid or ask) at a given time and store it as a reference value to use it later in the program. for example if I want to have the opening price of the US market (9:30 ET) for a financial asset like SP500 for example
 
Hello. To store a value you need to put it in a suitable variable. In your case, I think a double will do. Follow this link https://www.mql5.com/en/docs/basis/types/double