I have a positionsizing algorithm created in Python that computes the positionsize of the next trade. The intention is that the Python algorithm outputs the positionsize to a CSV file, and then AmiBroker reads the last line of the CSV and uses that information as positionsize for the next trade . However, the problem is that the AFL script has to wait for the positionsize to be computed in python and appended as a new row in the csv. Does anyone have any suggestions on how to solve this? I basically need the backtester to wait for the new line to be appended before continuing the backtest.