Sorry Son,
Try to do at least something yourself! For test, don't write formula for different account types, test only YTD calculations of some account. If you manage to do it for one account you can later add logic for different account types (but for AST and LEQ it will be extremely complex).
Vadim