As part of an indicator I need to use the Daily close price for a product which is calculated at 15:30. For the day session leading up to the 15:30 close I need to use the previous day's close. I have attempted to use the following statement. however it doesnt seem to be quite working as I expect it to. This is my first attempt at an if else statement so I am sure I have just coded it incorrectly. Any help would be much appreciated.
Code:
if (getHour(0,sym(yen_sym)) >9 && getHour(0,sym(yen_sym)) < 16 ) { // Refering to previous days close for 9am-4pm nCloseDay1=close(-1,sym(TCM_sym_day)); } else {xClose = close(sym(TCM_sym_day)); ; }
Comment