Write Python algorithm code for automated trading and integrate with Interactive Brokers APIs.
Below are the key functions required:
1. Fetch real time stock prices of two stock A and Stock B from IB to a temp file
2. Plot one real time chart of stock A and stock B from the above data
3. Create decision points based on events from the above 2 charts
4. Based on above decision Buy or Sell stock A. Calculate the maximum number of Stocks A can be purchased based on available cash and order the Buy.
5. Do the trading as many times as Decision points occur
6. At the end of the day transfer the day's profit to Bank and keep the principal amount for next day trading.
7. Repeat 1 to 6 on each trading day
If you have experience in handling the similar project, please contact.