Plan the program
Give each part of the program one job.
The idea
Build a small program whose decisions you can follow.
Our first version reads made-up or recorded prices. It does not send real orders.
A small example
Split the work into four pieces:
- Read: accept the next price.
- Calculate: update the three-price average.
- Decide: record above average or not above average.
- Log: save the price, average, and decision.
We will add simulated trades only after these pieces are understandable.
Try it
What should the program record after receiving just two prices?
Write the answer before asking an AI tool to create any code.
Check your answer
Not enough data. The rule requires three prices.
This is part of the specification: a short description of what the program must do. Include ordinary cases, missing information, and how to stop. Next, you will ask an AI tool to build one small piece.