If you happen to be using Unix or Dos, you may want to take advantage of the output-redirection mechanism that enables you to tell your program to send output to a file instead of displaying that output on your screen.
Assuming that your program's name is analyze_trades
,
the following command line both redirects input from your keyboard to an
input file and redirects output from your screen to a output file:
analyze_trades < test_data > test_result