IBKR Quant Blog


1 2 3 4 5 2 54


Quant

Five Indicators To Build A Trend Following Strategy - Part III


See part II in this series to learn more about Bollinger Bands.

MACD (Moving Average Convergence Divergence)

The Moving Average Convergence Divergence indicator (MACD) is a comparative analysis of two moving averages for two different datasets. Depending on the bandwidth of the time series, you can assess the price fluctuations for two different stretches of time. Say one for a span of a month and another for 200 days. Comparison of the moving average for these two data sets is done based on three main observations viz. convergence, divergence and dramatic rise.

 
How to use MACD in trend following strategies:
If the price fluctuations for one data set is less than the moving average, while for the other data the fluctuations are above the moving average, it is wiser to take a short position on the stock because the price variation is not stable. 

Plotting MACD in python for trend following strategies:
The Python code is given below: 

# MACD

data['macd'], data['macdsignal'], data['macdhist'] = ta.MACD(data.close, fastperiod=12, slowperiod=26, signalperiod=9)

data[['macd','macdsignal']].plot(figsize=(10,5))

plt.show()


The graph plotted is shown below:

 

Quant

 

In the next article, Rekhit will discuss RSI (Relative Strength Index).

 

*Any trading symbols displayed are for illustrative purposes only and are not intended to portray recommendations.

Learn more QuantInsti here https://www.quantinsti.com

To learn more about Python and R, visit QuantInsti website and their educational offerings at their Executive Programme in Algorithmic Trading (EPAT™).

Trading on margin is only for sophisticated investors with high risk tolerance. You may lose more than your initial investment.


This material is from QuantInsti and is being posted with QuantInsti’s permission. The views expressed in this material are solely those of the author and/or QuantInsti and IBKR is not endorsing or recommending any investment or trading discussed in the material. This material is not and should not be construed as an offer to sell or the solicitation of an offer to buy any security. To the extent that this material discusses general market activity, industry or sector trends or other broad based economic or political conditions, it should not be construed as research or investment advice. To the extent that it includes references to specific securities, commodities, currencies, or other instruments, those references do not constitute a recommendation to buy, sell or hold such security. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.

 


23062




Quant

Towards Better Keras Modeling - Part I


 

Quant

 

The field of deep learning is frequently described as a mix of art and science. One of the most "art-sy" parts of the field, in my experience, is the subject of network topology design - i.e., choosing the right geometry, size, depth, and type of network.

Machine learning practitioners develop rules of thumb for reasonable starting points - and learn heuristics for how to iterate towards optimality.

In this post, I'll walk you through my early exploration with Talos, a simple framework that automates the workflow of conducting hyperparameter optimization on Keras models. I'm relatively new to Talos, so this brief tutorial should be no substitute for the project's documentation or support forum.

 

As a sample dataset, I'll make use of data from a recent contest at Numerai, an interesting project that is best thought of as Kaggle, Quantopian, and Ethereum all rolled into one.

Numerai provides datasets to any data scientists interested in developing prediction models - much like Kaggle. Those who feel they have trained useful models can choose to enter a weekly contest for a chance to win cash prizes.

To access this sample dataset, I'll make use of Numerox, an API interface to Numerai's data contests.

This post will cover:

  • Installing Talos and Numerox
  • Downloading and preparing data from Numerai
  • Setting up and executing a coarse parameter sweep on a Keras model
  • Analyzing the results
  • Conducting a second, "finer" scan on the parameter space
  • Reaching a final model

    If you'd like to replicate and experiment with the below code, you can download the source notebook for this post by right-clicking on the below button and choosing "save link as"

 

Python

 

In the next post, the author will show us how to set up Talos and Numerox.

 

----------------

About The Alpha Scientist

I'm Chad, aka The Alpha Scientist. I've created The Alpha Scientist blog to explore the intersection of my two professional passions: locating "alpha" in market inefficiencies and applying data science methods. If you've found this post useful, please follow @data2alpha on Twitter and forward to a friend or colleague who may also find this topic interesting. https://alphascientist.com/

 

This material is from The Alpha Scientist and is being posted with The Alpha Scientist’s permission. The views expressed in this material are solely those of the author and/or The Alpha Scientist and IBKR is not endorsing or recommending any investment or trading discussed in the material. This material is not and should not be construed as an offer to sell or the solicitation of an offer to buy any security. To the extent that this material discusses general market activity, industry or sector trends or other broad based economic or political conditions, it should not be construed as research or investment advice. To the extent that it includes references to specific securities, commodities, currencies, or other instruments, those references do not constitute a recommendation to buy, sell or hold such security. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.


23190




Quant

Placing Orders - IBKR Traders' Academy Python API Course


Python

In this lesson, the instructor discusses how orders can be placed, monitored, modified, and cancelled from the TWS API.

To provide a picture of the essential components necessary to place an order, he demonstrates a simple Python program: Program.py

Finish the lesson by testing your knowledge with a short quiz!

https://gdcdyn.interactivebrokers.com/en/index.php?f=25228&course=22

 

The analysis in this material is provided for information only and is not and should not be construed as an offer to sell or the solicitation of an offer to buy any security. To the extent that this material discusses general market activity, industry or sector trends or other broad-based economic or political conditions, it should not be construed as research or investment advice. To the extent that it includes references to specific securities, commodities, currencies, or other instruments, those references do not constitute a recommendation by IBKR to buy, sell or hold such investments. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.


23061




Quant

Top 10 Machine Learning Algorithms for Beginners - Part 3


See the previous part of this series to learn more about KNN Classification and Support Vector Machine (SVM).

 

Decision Trees

Decision trees are basically a tree-like support tool, which can be used to represent a cause and its effect. Since one cause can have multiple effects, we list them down (quite like a tree with its branches).

Quant

We can build the decision tree by organizing the input data and predictor variables, and according to some criteria that we will specify.

The main steps to build a decision tree are:

  1. Retrieve market data for a financial instrument.
  2. Introduce the Predictor variables (i.e., Technical indicators, Sentiment indicators, Breadth indicators, etc.)
  3. Setup the Target variable or the desired output.
  4. Split data between training and test data.
  5. Generate the decision tree training the model.
  6. Test and analyze the model.

The disadvantage of decision trees is that they are prone to overfitting due to their inherent design structure.

 

Stay tuned for the fourth installment in this series to learn about Random Forest!

 

 

Learn more QuantInsti here https://www.quantinsti.com

To learn more about Python and R, visit QuantInsti website and their educational offerings at their Executive Programme in Algorithmic Trading (EPAT™).

This material is from QuantInsti and is being posted with QuantInsti’s permission. The views expressed in this material are solely those of the author and/or QuantInsti and IBKR is not endorsing or recommending any investment or trading discussed in the material. This material is not and should not be construed as an offer to sell or the solicitation of an offer to buy any security. To the extent that this material discusses general market activity, industry or sector trends or other broad based economic or political conditions, it should not be construed as research or investment advice. To the extent that it includes references to specific securities, commodities, currencies, or other instruments, those references do not constitute a recommendation to buy, sell or hold such security. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.

 

 

 


23114




Quant

IBKR Live Event


Career Fair at University of Illinois at Chicago

 

Save the Date!


IBKR invites Engineering and Quant students from the University of Illinois at Chicago to stop by our booth during the upcoming Career Fair.
 

University of Illinois at Chicago
Date: Thursday, March 21, 2019
Time: 10:00 AM CT - 2:00 PM CT

  

Visit IBKR Careers page for a listing of Java, C++ or Python developer jobs.

 

The analysis in this material is provided for information only and is not and should not be construed as an offer to sell or the solicitation of an offer to buy any security. To the extent that this material discusses general market activity, industry or sector trends or other broad-based economic or political conditions, it should not be construed as research or investment advice. To the extent that it includes references to specific securities, commodities, currencies, or other instruments, those references do not constitute a recommendation by IBKR to buy, sell or hold such investments. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.


23060




1 2 3 4 5 2 54

Disclosures

We appreciate your feedback. If you have any questions or comments about IBKR Quant Blog please contact ibkrquant@ibkr.com.

The material (including articles and commentary) provided on IBKR Quant Blog is offered for informational purposes only. The posted material is NOT a recommendation by Interactive Brokers (IB) that you or your clients should contract for the services of or invest with any of the independent advisors or hedge funds or others who may post on IBKR Quant Blog or invest with any advisors or hedge funds. The advisors, hedge funds and other analysts who may post on IBKR Quant Blog are independent of IB and IB does not make any representations or warranties concerning the past or future performance of these advisors, hedge funds and others or the accuracy of the information they provide. Interactive Brokers does not conduct a "suitability review" to make sure the trading of any advisor or hedge fund or other party is suitable for you.

Securities or other financial instruments mentioned in the material posted are not suitable for all investors. The material posted does not take into account your particular investment objectives, financial situations or needs and is not intended as a recommendation to you of any particular securities, financial instruments or strategies. Before making any investment or trade, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice. Past performance is no guarantee of future results.

Any information provided by third parties has been obtained from sources believed to be reliable and accurate; however, IB does not warrant its accuracy and assumes no responsibility for any errors or omissions.

Any information posted by employees of IB or an affiliated company is based upon information that is believed to be reliable. However, neither IB nor its affiliates warrant its completeness, accuracy or adequacy. IB does not make any representations or warranties concerning the past or future performance of any financial instrument. By posting material on IB Quant Blog, IB is not representing that any particular financial instrument or trading strategy is appropriate for you.