Impaired cerebral autoregulation (CA) can cause negative outcomes in neurological conditions. Real-time CA monitoring can predict and thereby help prevent postoperative complications for neurosurgery patients, especially those suffering from moyamoya disease (MMD). We applied the concept of moving average to the correlation between mean arterial blood pressure (MBP) and cerebral oxygen saturation (SCO2) to monitor CA in real time, revealing optimal window size for the moving average. The experiment was conducted with 68 surgical vital-sign records containing MBP and SCO2. To evaluate CA, the cerebral oximetry index (COx) and coherence obtained from transfer function analysis (TFA) were calculated and compared between patients with postoperative infarction and those who without. For real-time monitoring, the moving average was applied to COx and coherence to determine the differences between groups, and the optimal moving-average window size was identified. The average COx and coherence within the very-low-frequency (VLF) range (0.02-0.07 Hz) during the entire surgery were significantly different between the groups (COx: AUROC = 0.78,p= 0.003; coherence: AUROC = 0.69,p= 0.029). For the case of real-time monitoring, COx showed a reasonable performance (AUROC > 0.74) with moving-average window sizes larger than 30 minutes. Coherence showed an AUROC > 0.7 for time windows of up to 60 minutes; however, for windows larger than this threshold, the performance became unstable. With an appropriate window size, COx showed stable performance as a predictor of postoperative infarction in MMD patients.