Developing backtesting AFL
Can anyone develop backtesting coding for the following trading system:
The system starts with an account balance of Rs 30,000 and starts by buying 1 unit( contract or share) at the OPENING PRICE OF A SPECIFIED DATE(there should be an option to modify this date)..This is step 1
step 2. buy 1 unit when current account balance increases by Rs.20,000/-
OR
sell 1 unit when current account balance decreases by Rs.10,000/-
step 3. Keep on repeating step 2 unless either (1)the account balance gets exhausted or (2) A FINAL EXIT DATE is specified when all units will be squared off at the closing price of that day.
This is the main theme of the system. Please write back for more clarifications.