Spartan Trader - part 4 (H16) - can be done as a team
Trading stocks
Goal
By completing this homework you will begin implementing a manual stock trader and will have learned about classes in object-oriented programming.
Context

"It is time to start thinking about trading, and I have a DAZZLING idea."
Ms. Tickertracker is again in your office, and as usual she is overexcited.
"It would be MONUMENTALLY complex to try to figure out an algorithm that selects and executes trades from scratch. Therefore, we
will simplify our system design task by splitting it into two parts: first, we will build a trading workstation that only requires
manual input; then we will add the necessary 'intelligence' that will take the place of the human trader. The
algorithm will use the software like we would, selecting symbols and calling functions like a human trader. Much easier to
understand and code."
"So... you are suggesting that I should begin building trading functionality without worrying who will operate it: person or
machine?" said you.
"PRECISELY! You and I are operating on EXQUISITELY calibrated intellectual wavelengths!"
You are not that sure about those calibrated wavelengths, yet you find Ms. Tickertracker's suggestion reasonable: build trading
functionality first, add intelligence later. You feel you can do that.
"I am on it, Boss."
Requirements
- All previous functionality works well
- Compute and visualize pre-execution stock transaction data (e.g., price, dividend, transaction cost, etc. - see the demo in the vLab for the full list)
- Checks the validity of the user input
- Checks the validity of a transaction before sending it to Athens, the exchange
- Highlights key transactions data when the execution button is pressed.
For reference, this data model shows the structure of the three databases. This file contains some code, so that you do not have to type as much. As before, feel free to change the look and feel of the app. As for previous homework (and for all the coming homework) do not just copy and paste. Figure out what the code does or you will be lost later. Ask questions in class or in Teams if anything is not clear.
Bug fix:
[1] There is an error in the video at about 4:35. To create a class, DO NOT right-click on "my project". Right-click instead on the "Spartan trader" icon (or whatever you are calling that item). In both cases you are creating a class, but in the former case you are saving it in the wrong place.
[2] TPVatStart = CalcTPVAtStart() should NOT be inside CalcFinancialMetrics. It should be placed as the last line in SetFinancialConstants()
Note: If your Spartan Trader complains that there is no CAccount, that is not necessarily an error. It is just telling you a fact.