During respiratory-gated radiotherapy (RGRT), gate on and off latencies cause deviations of gating windows, possibly leading to delivery of low- and high-dose radiations to tumors and normal tissues, respectively. Currently, there are no RGRT systems that have definite tools to compensate for the delays. To address the problem, we propose a framework consisting of two steps: (1) multistep-ahead prediction and (2) prediction-based gating. For each step, we have devised a specific algorithm to accomplish the task. Numerical experiments were performed using respiratory signals of a phantom and ten volunteers, and our prediction-based RGRT system exhibited superior performance in more than a few signal samples. In some, however, signal prediction and prediction-based gating did not work well, maybe due to signal irregularity and/or baseline drift. The proposed approach has potential applicability in RGRT, and further studies are needed to verify and refine the constituent algorithms.