+1 on Crackem's post.
First thing you should do is manually dose the tank to get to the parameters you want.
Then do not dose for 3-4 days. During these few days, check your levels every day, at the same time, and record them on paper.
After the last day, figure out how much you drop each day for both Calcium and Alkalinity, and then average them out. These totals will be your starting point.
Take those numbers and use the brs calculator to figure out your needed total daily dose. Once you know that, then you can code the apex to spread those amounts out over a 24hr period.
As a side note, I would add the "If pH > 8.35 then off" to the calcium code also. This will keep the calcium from dosing, just like the alkalinity.
IMO, it helps prevent an upset in the balance if your alk was to stay off for an extended amount of time.
.