There are lots of misunderstandings / misconceptions here.
First and foremost, you need to understand that AmiBroker is MULTITHREADED application.
And that each AFL formula runs in DIFFERENT thread. The thread that is handling data is ALSO different than formula execution thread. Therefore any ‘import’ action triggered from AFL level would NOT be immediately reflected in current formula array but only possibly in NEXT execution.
Having said that, import can easily be triggered from AFL, without batch
AB = CreateObject("Broker.Application");
AB.Import( 0, "filename", "format.definition"); // see the footer note 1)
Batch can also be used but that is not the point.
The thing is that doing so to feed real time data is BAD idea in first place.
The ONLY correct way to implement streaming in EFFICIENT way is to write a proper data plugin using AmiBroker Development Kit (downloadable from http://www.amibroker.com/download.html)
Note 1: 3rd argument in the Import call is format definition file: