The program should? wake up? at a specified time, start TWS (if not already running), login, retrieve the current price of an instrument, the current position (number of shares already held in the portfolio) ? and the last five closing prices, subsequently, based on a simple caculation, submit a buy or sell order for them same or a? related instrument.
After completion of the task, logout and shut down TWS.
The program is to be started from the commandline via the scheduler or cron, alternatively a service or daemon process would be nice to have.
All tasks performed? need be written to a log file (the data retrieved and the orders submitted).
The program is to be written in Java (1.6) in combination with InteractiveBrokers TWS (build 894) and API 9.62, which are currently the latest versions (to be downloaded from? [[login to view URL]][1]).
Credentials for a simulated trading account will be provided, if not already available.
The coder should have done previous work with the TWS API.