the lookback function seems to return a wrong number when the signal variable is set to 1. It always returns a lower number that what it should (off by one unit) so if you want to replicate the error do this:
int lookback = ti_lib.macdLookback(2, 7, 1);
and you will see the problem. The lookback numer will be 5 instead of 6. Now, do this:
int lookback = ti_lib.macdLookback(2, 7, 2);
and you will get the exact number in the lookback (7).
I use genetic algorithms in my strategies and the GA is the one that sets the values of the different variables. And yes, they look funky like those sometimes; but the results work, and work very well... except for this.