As I already responded in another post, AmiBroker does not support arrays of strings. I also explained why your code doesn't work the way you want it to.
You could create a loop to call Foreign for each bar, but that is likely to be quite slow. Something like this untested snippet:
Alternatively, you could revise your strategy rules so that you don't need to find the ATM option for every bar of the backtest. For example, you might just need that information when there's an entry signal.
Yes, it is absolutely essential that you fully understand both arrays and scalars (single values) in AmiBroker.
The Foreign function returns an array, which is stored in the variable callOIArray. That's why I used "Array" in the variable name: to make it clear that variable is an array.
To reference a single value from the array, we have to provide an index inside square brackets. The statement callOIArray[bar] returns the array element (which is a scalar) stored at index bar.
This line was new to me, assigning a single value to an array inside a loop without referencing a single array. Now that i think about it, this seems logical.