Historical Backtest, adding multiple buy


can anybody make this afl

to make a multiple buy and multiple sell according to the input file?
it is now treat a second or third buy or sell as a redundant as Thomas explained in here Backtested results from historical file

it is way beyond my understanding since I am not a programmer, please help?