Python API for Trading

How to trade and view market data using the Python TWS API.

Installing & Configuring TWS for the API, Receiving Market Data and Historical Candlesticks, Placing Orders, Option Chains, Accessing Portfolio Data


  • Windows, Linux, or Mac OSX computer with GUI and Python 3.3 or higher installed.
  • Familiarity with Python programming
  • The TWS API utilizes socket programming, multiple threads, and other concepts which it is recommended to be familiar with beforehand. If not, it is suggested to first try an Introduction to Python course which covers these topics.


This is a course in programming with the Trader Workstation Application Programming Interface (TWS API) for Python developers. In this course, we describe how to get started in developing Python applications that use the API. 

Josh joined the IBKR API team in 2015 and has been an active contributor to API educational resources including the TWS API reference guide and webinars. Before joining the team, he was an automated trading enthusiast interested in trading APIs and machine learning technologies. Josh has a BS in Computer Science from Carnegie Mellon University.

Lesson Structure:

  • What is the TWS API?
  • Installing & Configuring TWS for the API
  • Accessing the TWS Python API Source Code
  • Essential components of TWS API programs
  • Receiving Market Data and Historical Candlesticks
  • Placing Orders
  • Option Chains, Portfolio Data and Account Information
  • API Case Study in Pair Trades

Who this course is for:

  • Python programmers who want to learn about the Trader Workstation API.

Course content

Python for Basic problems in Complex Numbers

Students will learn how to solve the Complex Numbers in Python


  • Fundamental knowledge of Mathematics


In this course, mathematics of complex numbers is explained in detailed. Mathematical operations on Complex Numbers are explained with examples. All these problems are also solved in Python. Important python modules for this course such as NumPy and Matplotlib are also the part of this course. After the completion of this course students will be able to solve  Complex Number problems manually and by python.

Who this course is for:

  • Every one who wants to learn the basics of complex numbers

Course content

Simple GUI Application (EMI Calc) using Tkiner in Python

Importing Tkinter Library

Working with Lablels, Entry and Button in Tkinter

Creating a Simple EMI calculator project using Tkinter Library of Python 3


  • Basic Knowledge of Python 3


EMI Calculator using Tkinter

Tkinter is is Python’s de facto standard GUI. It comes with with standard Linux, Microsoft Windows and Mac OS X installs of Python.

  • Importing Tkinter Library
  • Creating and Empty GUI window using Tkinter
  • Importing widgets like Button, Entry, Label etc.
  • Placing widgets in Tkinter.
  • Creating and executing a function on Button click
  • Taking user input and applying mathematical operations.
  • Printing results in a label and configuring its style

Who this course is for:

  • Students who are learning Python Programming

Course content

Numerical Root Finding in Python and MATLAB

Theory of Bisection, Secant and Newton-Raphson Methods

Python Implementation of 3 Root Finding Methods

MATLAB Implementation of 3 Root Finding Methods


  • Basic Mathematics
  • Python Programming
  • MATLAB Programming


This series of video tutorials covers the numerical methods for Root Finding (Solving Algebraic Equations) from theory to implementation. In this course, three methods are reviewed and implemented using Python and MATLAB from scratch.

At first, two interval-based methods, namely Bisection method and Secant method, are reviewed and implemented. Then, a point-based method which is known as Newton’s method for root finding, a.k.a. Newton–Raphson method, is reviewed and implemented. This course is instructed by Dr. Mostapha Kalami Heris, who has years of practical work and active teaching in the field of programming, mathematics, control engineering and computational intelligence.

By the end of this course you will be able to know about the fundamental theory of this root finding methods and implementing them using Python and MATLAB programming languages.

Who this course is for:

  • Engineering Students
  • Applied Math and Science Students
  • Anyone interested in numerical methods

Course content

Introduction to C.H.I.P

Creating a basic GUI using python

Assemble a CHIP to create a full-fledged computer

Get up to speed with simple Linux commands

Write a simple Python program to blink a LED

Create a simple GUI using Python programming to control a LED

Create an ATM greeting machine


  • Students will need basic knowledge of programming


This is an introductory course to CHIP which is a 9$ computer. This course is great for those who are interested in either learning physical computing or want to use the chip as a full-fledged computer. This course only assumes that you have basic knowledge of programming and does not require you to know Linux commands or Python programming. However, a knowledge of the mentioned would greatly speed up your learning process.

If you do not know Linux or Python, no need to worry. The course has sections that cover the basics of Linux to get you started.

The chip is a 9$ device which will act as the CPU to which we will need to connect basic peripherals like a keyboard,mouse and a monitor to make it work as a full-fledged computer. The course will teach you to set up the CHIP and make it work as a low cost computer. You will also learn to work with hardware in combination with the GPIO pins of the CHIP.

You will be learning from 3 projects. The first project will be your first step in physical computing and you will learn about GPIO pins and how to use them. 

The second project will teach you to create a very simple and basic GUI with which you can control hardware and thus works as a virtual remote. Pretty cool right?

The third project is an ATM greeting machine which works with sensors to greet a person entering and exiting an ATM vestibule.

The course provides error-free source code for the above mentioned projects.

The entire course course can be completed over a period of 3 hours assuming that you have all the hardware necessary. Do not worry if it takes you longer since the longer it takes, the more you will be learning and more the fun.

By the end of the course, You will learn how to setup the CHIP, install and update the various packages needed for the projects. You will also learn basic Linux commands and the python code to make some really cool projects.

Who this course is for:

  • This is an introductory course meant for those who are interested in exploring the CHIP. While a knowledge of Linux operating system and Python programming language will be helpful, it is not required to follow this course. The basics of Linux will be taught as a part of this course.

Course content

Implementation of ML Algorithm Using Python

python programming


  • anaconda


we learn lots of dataset how to predict values using different machine learning algorithm. problem-solving oriented subject that learns to apply scientific techniques to practical problems. The course orients on practical classes and self-study during preparation of datasets and programming of data analysis tasks. This course takes you through all the important modules that you need to know about, including machine learning and programming languages.

Who this course is for:

  • Beginners Python developer

Course content

Understanding Python (Input-Process-Output)

Learners will combine input and process to build an appropriate output.

Learners will analyze a problem and figure an appropriate solution, written in python.

Identify components of a problem to break it down into what inputs are needed and how to process them accordingly.

Write a simple process to read input and process an acceptable output.


  • No programming experience needed, you will learner everything you need to know.
  • Basic math understand


This course is an introduction to python at a basic level. This is geared toward the users who are overwhelmed with other python courses trying to cover too much material without first having a solid grasp of core concepts. This course covers basic input, output, and processes. Give you lots of examples and pushes you to complete the project to fully grasp the topics.

Examples for input include how to capture input from users, how to define data types of user input, and how to assign variables. For the output portion, we will be covering basic output such as print commands, but also the formatting print commands to make the output more meaningful. We will cover the basic processes using common math functions. We will put all of it together with several projects to ensure understanding. We also cover two additional areas conditional statements such as if-statements and error handling through try-except blocks. I keep things really simple so that learners who may feel overwhelmed can take this course and get the basics done without being overwhelmed.

The big takeaway from this course is taking a learner who has very no experience and taking them from knowing nothing and taking them to understand basics inputs, processes, and outputs. Each learner will have several projects that re-enforce your understanding of core concepts.

Keep in mind this is a free course, and I am limited by Udemy guidelines.

Who this course is for:

  • This is a beginning python course. This will teach basic input, process, and outputs used in python.

Course content

Ready for Python within an Hour

Starting up with Python

Updated Source Code provided to make things faster

For all the type of students

Can begin any Project after this

Will be able to read and understand code

Grasp through the basics from scratch

Practical Approach Towards Python Programming


  • Basic knowledge of computers
  • Compter system to perform hands-on


Python is now the most important skill that anyone can have.

its the most user friendly language and this course is designed just to make that simple

the student will learn the basics and can start working on the language ,reading the codes from other sources and developing his own also

Who this course is for:

  • Python Enthusiasts of any age group
  • Planning to start with python
  • Getting through the syntax of python
  • Curious Project Makers

Course content

The Top 5 Machine Learning Libraries in Python

You’ll receive the completely annotated Jupyter Notebook used in the course.

You’ll be able to define and give examples of the top libraries in Python used to build real world predictive models.

You will be able to create models with the most powerful language for machine learning there is.

You’ll understand the supervised predictive modeling process and learn the core vernacular at a high level.


  • There are no prerequisites however knowledge of Python will be helpful.
  • A familiarity with the concepts of machine learning would be helpful but aren’t necessary.


Recent Review from Similar Course:

“This was one of the most useful classes I have taken in a long time. Very specific, real-world examples. It covered several instances of ‘what is happening’, ‘what it means’ and ‘how you fix it’. I was impressed.”  Steve

Welcome to The Top 5 Machine Learning Libraries in Python.  This is an introductory course on the process of building supervised machine learning models and then using libraries in a computer programming language called Python.

What’s the top career in the world? Doctor? Lawyer? Teacher? Nope. None of those.

The top career in the world is the data scientist. Great. What’s a data scientist?

The area of study which involves extracting knowledge from data is called Data Science and people practicing in this field are called as Data Scientists.

Business generate a huge amount of data.  The data has tremendous value but there so much of it where do you begin to look for value that is actionable? That’s where the data scientist comes in.  The job of the data scientist is to create predictive models that can find hidden patterns in data that will give the business a competitive advantage in their space.

Don’t I need a PhD?  Nope. Some data scientists do have PhDs but it’s not a requirement.  A similar career to that of the data scientist is the machine learning engineer.

machine learning engineer is a person who builds predictive models, scores them and then puts them into production so that others in the company can consume or use their model.  They are usually skilled programmers that have a solid background in data mining or other data related professions and they have learned predictive modeling.

In the course we are going to take a look at what machine learning engineers do. We are going to learn about the process of building supervised predictive models and build several using the most widely used programming language for machine learning. Python. There are literally hundreds of libraries we can import into Python that are machine learning related.

library is simply a group of code that lives outside the core language. We “import it” into our work space when we need to use its functionality. We can mix and match these libraries like Lego blocks.

Thanks for your interest in the The Top 5 Machine Learning Libraries in Python and we will see you in the course. 

Who this course is for:

  • If you’re looking to learn machine learning then this course is for you.

Course content

Principal Component Analysis in Python and MATLAB

Theory of Principal Component Analysis (PCA)

Concept of Dimensionality Reduction

Step-by-step Implementation of PCA

PCA using Scikit-Learn (Python Library for Machine Learning)

PCA using MATLAB (Using Statistics and Machine Learning Toolbox)


  • Python Programming
  • MATLAB Programming
  • Basics of Data Analysis


Principal Component Analysis (PCA) is an unsupervised learning algorithms and it is mainly used for dimensionality reduction, lossy data compression and feature extraction. It is the mostly used unsupervised learning algorithm in the field of Machine Learning.

In this video tutorial, after reviewing the theoretical foundations of Principal Component Analysis (PCA), this method is implemented step-by-step in Python and MATLAB. Also, PCA is performed on Iris Dataset and images of hand-written numerical digits, using Scikit-Learn (Python library for Machine Learning) and Statistics Toolbox of MATLAB. Also the projects files are available to download at the end of this post.

Who this course is for:

  • Data Scientists and Analysts
  • Computer Science and Engineering Students
  • Anyone interested in Data Science

Course content