Execute Algorithmic trades with higher confidence.

Leverage historical data for backtesting the MACD trading strategy for ANY ticker using Toucan and Python.

Photo by Jorge C on Unsplash
  • Moving Averages Convergence Divergence (MACD) is a widely used trading signal for detecting trend reversals.
  • By design, moving averages lag the underlying time series. As a result, the triggers from trading strategies purely based on Simple Moving Averages are often delayed resulting in missed opportunities or even losses.
  • MACD signal overcomes this drawback to some extent. The MACD signal is defined by three components -

The MACD Crossover Trading Strategy :

  • The MACD crossover…

Multi-Label Classification

A survey of evaluation metrics for training a multi-label classifier in python

  • In a traditional classification problem formulation, classes are mutually exclusive. In other words, under the condition of mutual exclusivity, each training example can belong only to one class.
  • In such cases, the classification errors occur due to overlapping classes in the feature space.
  • However, often we encounter tasks where a data point can belong to multiple classes.
  • In such cases, we pivot the traditional classification problem formulation to a MultiLabel Classification framework where we assume each label to be a Bernoulli random variable representing a different classification task.
  1. We use the sigmoid activation function in…

Algorithmic Trading Using Python

Leverage historical data for backtesting the MA crossover trading strategy.

  • Imagine a computer program continuously monitoring markets and executing profitable trades on your behalf without any manual intervention. Sounds exciting but way riskier, doesn’t it?
  • The idea sounds risky because of the uncertainty associated with automated decision-making.
  • The goal of this blog post is to demystify algorithmic trading by piggybacking on historical data to help us make an informed decision.
  • Algorithmic Trading is the use of predefined conditions for entering and exiting trades when the markets are in session. These predefined conditions are also known as trading strategies.
  • A strategy can be defined using an IFTTT (If This Then That)…

Autoselect Dream11 Fantasy Teams using Data Science

Leveraging Integer Linear Programming for selecting an optimal fantasy team on Dream11.

  • Sports have played a pivotal role in our society for ages. It has been an active medium for entertainment and a means for uniting people.
  • Sports have given us legends who are followed, loved, and worshipped across the globe.
  • Over the last few years, the emergence of fantasy sports platforms has allowed fans to connect with sports on a deeper level.
  • According to a recent report published by Businesswire, North American Fantasy Sports Markets are expected to grow at a staggering CAGR of 10.7% over the next five years.
  • The story is no different in India, Asia. The fantasy sports…

Product Pricing Using Reinforcement Learning.

Leveraging Explore Exploit strategy for determining the optimal price for a product.

  • The COVID-19 pandemic hit us hard in 2020 and forced us to seek safe havens by practically giving up on socializing. The pandemic also severely affected business and economic growth across industries and nations.
  • It also changed the way we have been conducting businesses until now. The lockdown and physical distancing measures presented a unique challenge to the brick and mortar retail stores that rely heavily on foot traffic for moving their products.
  • The pandemic has forced people to adopt online shopping more comprehensively for their daily needs.
  • The whole shift in paradigm has prompted businesses to start building an…

Demystifying Convex Functions

Testing the conditions for proving the convexity of mean squared error (MSE) function used in the context of Linear Regression.

  • The previous blog — The Curious Case of Convex Functions, focused on laying the foundation for testing the convexity of a function. It enumerates different ways to test/prove the convexity of a function.
  • In this article, we shall put that knowledge to use by proving the convexity of the Mean Squared Error loss function used in the context of Linear Regression.
  1. The MSE loss for a Regression Algorithm.
  2. Conditions for checking Convexity.

MSE Loss Function -

Testing Convexity of a function

In-depth understanding of convex functions and ways to test convexity.

  • Most of the online literature on introduction to machine learning kicks off by covering the Linear Regression algorithm.
  • Typically, the Linear Regression algorithm is detailed out by using Mean Squared Error (MSE) as the loss function.
  • MSE is a convex function. The convexity property unlocks a crucial advantage where the local minima is also the global minima.
  • This ensures that a model can be trained such that the loss function is minimized to its globally minimum value.
  • However, proving the convexity of MSE (or any other loss function) is typically out of scope.
  • In this blog post, we shall work…

Pritish Jadhav

Data Science Engineer, Perpetua

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store