PEEK means that your system is peeking into the future. This in turn means that you will need a time machine for trading it. Therefore setting the PEEK flag is a bad idea if you don't have such a machine at hand.

Better find out the reason of the error 45, and fix it. In your case it's calling dayHigh/Low before the market day is over. You cannot know the high of a day already in the morning. Thus do not call those functions until the EndMarket hour is over.

The syntax error is a wrong condition in the if clause. "If" checks if something is true or false. A var has a floating point value and cannot be true or false. For doing something at a certain time, use the hour or lhour functions.