Python Library To Run Quantopian Algorithm In Live

Quantopian — The Online Algo Trading Platform

Quantopian is one of the most popular online algo trading platforms and communities today. It provides the great backtesting environment where you can experiment with your idea, build algorithms and even participate in the contest, as well as share the idea and discuss it with smart people there.

 Photo by  Rodion Kutsaev  on  Unsplash

One of the things many people have asked Alpaca during the beta program is how to run the algorithms that they built in Quantopian platform for their own purpose, not just for the contest. While Quantopian has built so much in the platform, they are so great to share the internal framework as open source zipline.

The Newest Open Source Libraries for Quantopian Users

Today, I wanted to share our newest open source libraries for Quantopian users; pylivetrader and pipeline-live.

alpacahq/pylivetrader
Python live trade execution library with zipline interface. - alpacahq/pylivetradergithub.com

alpacahq/pipeline-live
Pipeline Extension for Live Trading. Contribute to alpacahq/pipeline-live development by creating an account on GitHub.github.com

pylivetrader is a zipline API compatible trading framework in python which again focuses on live trading, with much less overhead and dependency problems. It is written from the ground up for live trading use cases, so it removes a lot of heavy lifting that zipline had to do such as price adjustment etc.

This means, you don’t need to build your data bundle to kick off your algorithm in live, but instead you can just start your live trading from the Quantopian algorithm source right away.

At the moment, the supported backend is only Alpaca, but we are happy to connect to IB etc. if someone contributes the code.

Pipeline API — the Core Piece of Quantopian Framework

Pipeline API is the core piece of Quantopian algorithm framework that allows easy stock selection based on the different metrics, much in a pythonic way, and this differentiates the platform from others. I found Pipeline is providing a tremendous value when it comes to trading wide range of universe. Unfortunately, it is not so easy for most people to use this great feature outside of the Quantopian platform.

pipeline-live is a python tool that allows you to do something similar anywhere so that you can do your research somewhere else as well as use it with existing python trading framework such as zipline-live or backtrader, including pylivetrader which I am introducing below. pipeline-live primarily uses IEX public API for pricing and basic fundamental information.

As you know, IEX provides market-wide volume data for daily OHLCV which makes it a perfect choice for pipeline usage. Since pipeline-live focuses on live trading use cases, it does not provide historical view unlike inside Quantopian, but the upside is it is fairly independent and easy to use. It is also very extensible so you can hook up with other paid data sources if you would find useful.

How to Convert Your Quantopian Algorithms to Run in Live Trading

We also put some practices together about how you could convert your Quantopian algorithms to run in live trading. You may want to take a look at these documents if you are interested in.

https://github.com/alpacahq/pipeline-live/blob/master/migration.md
https://github.com/alpacahq/pylivetrader/blob/master/migration.md

I also posted in Quantopian forum with the real example, and you may take a look at it, too.

Long-only non-day trading algorithm for live
This is a modified version of the algorithm presented in…www.quantopian.com

Feel free to give me any feedback/questions/criticism. Happy to help you get started with live trading with these tools too.

And here is the example code migrated from the post above.


/

Algo Trading News Headlines 9/18/2018

5 Reasons Why Cryptocurrency Trading Bots Are So Popular

(www.cryptodisrupt.com)

“Have you been considering using cryptocurrency trading bots or are looking for a way to get involved with crypto trading on exchanges? Many people are thinking the same as you. Here are five reasons why trading bots are so popular.”

 Photo by  Fancycrave  on  Unsplash

Photo by Fancycrave on Unsplash

Why Robots Are Bad Financial Advisors

(www.nasdaq.com)

“In an age of rapidly advancing technology, more investors are opting for DIY financial planning and investment management platforms. These trading platforms, retirement calculators, and auto-rebalancers are increasingly sophisticated, but many investors will learn in the next major market meltdown that there is a human element that cannot be replicated by even the most advanced of these tools.”

Can Computers Time The Market?

(www.seekingalpha.com)

“With my background in software, I decided to design, develop, and test out various quantitative models, and leveraged AI to determine the optimal values for each model or “strategy.” Though some excellent quant platforms like Quantopian exist, I opted to develop this simulator from the bottom up.”

10 Years Later, Many Deep Scars From the Financial Crisis Remain

(www.247wallst.com)

“24/7 Wall St. has evaluated those scars. Admittedly, this has more of an American focus than an international focus. Also worth noting is that an indefinite number of additional scars will remain in place for years and are the aftermath of the Great Recession and financial crisis of the past decade. There is also no way to categorize which scar is the most prevalent because that varies from person to person and from group to group.”

/

Algo Trading News Headlines 9/17/2018

The who, how and why of high-frequency crypto trading

(www.bravenewcoin.com)

According to the Financial Times, several leading high-frequency trading houses, including DRW, Jump Trading, DV Trading, and Hehmeyer Trading have entered the crypto asset markets last year. Several newly-launched crypto hedge funds are also using algorithmic trading strategies to generate a return on investment for their investors.

Dutch high-frequency trading house, Flow Traders BV, also recently made a move into the crypto markets, according to Bloomberg. The Amsterdam-based company is making markets in exchange-traded notes linked to bitcoin and ether due to strong investor demand for crypto investments.

 Photo by  Marc Szeglat  on  Unsplash

JP Morgan Says Severe Crisis to Arrive in 2020

(www.nasdaq.com)

The consensus is that there will be a major “liquidity crisis” with huge selloffs in major asset classes, and no one to step in to buy. The losses will be exacerbated by the shift to passive management and the rise of algorithmic trading. JP Morgan says that the Fed and other central banks may even need to directly buy stocks, and there could even be negative income taxes. The bank thinks the crisis will hit sometime after the first half of 2019, most likely in 2020.

Billionaire who once built robots to trade goes to war with them

(www.economictimes.com)

Thomas Peterffy helped launch the electronic-trading revolution that transformed the US stock market. And while the billionaire hasn’t soured on automation, he’s taking a lead role fighting back against the speediest traders. 

Interactive Brokers Group Inc. announced Wednesday that it will list its shares on an exchange run by IEXNSE 0.06 %Group Inc., which was made famous by Michael Lewis in “Flash Boys.” The 2014 book documented the market’s efforts to use a 350-microsecond speed bump to eliminate advantages IEX believed the fastest traders had in US stocks. When shares of Interactive Brokers move over from Nasdaq Inc., it will be IEX’s first win in its delayed plan to list corporations.

Quant Strategy in Emerging-Market FX Posts Best Run in Six Years

(www.bloomberg.com)

A Nomura index that mimics a trend-following strategy by chasing momentum in 10 EM currencies against the dollar has outperformed the JPMorgan Emerging Market Index by nearly 20 percentage points so far this year.

/

Algo Trading News Headlines 9/12/2018

Waters Rankings 2018: Best Algorithmic Trading Provider — Wolverine Execution Services

(www.waterstechnology.com)

Early forms of automated order entry provided the catalyst for what would become the foundational trading method of modern markets, but the development of algorithmic trading itself has been fascinating — and at times, controversial — evolution in listed markets. Wolverine Execution Services (WEX) has been at the forefront of broker-supplied algo.

Millennium Shuts Down Pioneering Quant Hedge Fund

(www.bloomberg.com)

The closing of Prediction Company, which Millennium bought in 2013, came as a surprise to employees because the firm was profitable, according to a person familiar with the matter. The hedge fund was started by Doyne Farmer and Norm Packard, who are known for their seminal work in developing chaos theory, and managed about $4 billion at its peak.

Comparing 3 Different Types of Neural Network Architectures in Finance

(alpaca.markets)

When working on a machine learning task, the network architecture and the training method are the two key factors to turning a set of data-points into a functional model. But where should different training methods be applied? How do they work? And which is “best”? In this post, we list up three types of training methods and make comparisons among Supervised, Unsupervised and Reinforcement Learning.

/

Algo Trading News Headlines 9/11/2018

Quant Investing: What are the dangers of the Black Box?

(www.jdsupra.com)

The strong industry consensus is that computers caused that Monday afternoon “flash crash.” Algorithmic trading, where computers automatically pick stocks based on complex pre-programmed instructions, “definitely had an impact” on the market swing that day, according to U.S. Treasury Secretary, Steve Mnuchin.

 Photo by  Esther Jiao  on  Unsplash

Photo by Esther Jiao on Unsplash

Rethinking the Order Book: The March Towards Automated Markets

(www.tradersmagazine.com)

Even as the digitization of trading has evolved and blockchain changes the financial landscape, existing market models have been unimaginatively carried over to electronic asset exchanges and now crypto markets. As a result, technology gaps between traders remain economically significant while the current market design perpetuates (and in some cases exacerbates) problematic features of the former system.

Citi hires derivatives duo from rival Goldman Sachs

(www.fnlondon.com)

Citigroup has made three appointments within its electronic trading business, including two hires from rival Goldman Sachs, amid a surge in futures trading this year.

/

Algo Trading News Headlines 9/10/2018

Is a Slang programming job at Goldman Sachs a technology career-killer?

(www.efinancialcareers.com)

If you work for Goldman Sachs, Slang is more than just the signifier of an informal word or phrase: it’s the bank’s very own programming language,devised by some of its most brilliant strats over two decades ago. However, depending upon who you speak to, Slang (short for Securities Language) is also a reason why working for the firm is a) incredibly interesting or b) a very quick way of ensuring you will never work anywhere but GS ever again.

 Photo by  Jennifer Burk  on  Unsplash

Machine earning: how tech is shaking up bank market-making

(www.risk.net)

This requires human traders to tell quants and technologists how they do their job, which is a tense balancing act. “Clearly, there is going to be the feeling of, ‘Well, you’re just automating everything I’m doing, so what’s in it for me?’” says Ezra Nahum at Goldman Sachs.

You want a machine learning job in finance? They might be less exciting than you think

(www.efinancialcareers.com)

For starters it isn’t actually clear what machine learning actually is. The term conjures up images of artificially intelligent cyborgs poring over streams of financial data, coming up with novel trading strategies which they then test and modify — all without any human supervision.

What Can The Crypto Robots Offer Us?

(www.fragland.net)

Cryptos trading robots utilize our free time and let us think on a passive income that is quite rewarding for a good future. On the contrary, when we are too busy with our own work, it can free up our time and invest on our behalf.

JP Morgan’s top quant warns next crisis to have flash crashes and social unrest not seen in 50 years

(www.cnbc.com)

The trillion-dollar shift to passive investments, computerized trading strategies and electronic trading desks will exacerbate sudden, severe stock drops, Kolanovic said.

/

Algo Trading News Headlines 8/31/2018

A Junior Analyst Created a Faulty Quant Model. The Penalty? $97.6 Million

(www.institutionalinvestor.com)

Investors placed billions of dollars into mutual funds and strategies that used models developed solely by an inexperienced analyst at Transamerica affiliate Aegon USA Investment Management, the SEC said in a statement Monday. The models contained numerous errors and did not work as promised, the regulator alleged.

 Photo by  chuttersnap  on  Unsplash

Photo by chuttersnap on Unsplash

Quant house AQR hires UBS robo architect for top tech role

(www.fnlondon.com)

The firm has recruited Shane Williams — who helped create UBS SmartWealth, the Swiss bank’s robo-advisory business — as its new head of client technologies, according to an email Williams sent to friends and colleagues on August 27. He joined AQR in August and will be based in the US.

Finance: How to Make the Most of Machine Learning

(www.globalbankingandfinance.com)

As a subset of data science, machine learning uses specific algorithms and chosen datasets to train mathematical models to find patterns, make predictions, segmentation, and more.

Best Starting Kits for Algo Trading with C#

(alpaca.markets)

When it comes to algo trading and automated investment, Python is one of the biggest players in the space, but many experts also use .NET/C# for its high performance and robustness. As we did some research on toolset you might look at to start your algo trading, we wanted to share this list for you.

LUCRE automated trading system encourages crypto traders to Not HODL their cryptocurrency

(MENAFN.com)

LUCRE is a project with the ability to generate revenues in all kinds of market conditions through buying and selling with every good opportunity. Even in a current scenario of not so profitable crypto market, Lucre attempts to make a profit by making short-term trades through its Lucre trading Algo that runs on a Metatrader trading platform.

/

Best Starting Kits for Algo Trading with C#

Today, the world is transforming towards automated fashion, including manufacture, cars, marketing and logistics. Personal investment is no exception. At Alpaca, we are pushing this boundary forward so everyone can enjoy the automated investment world.

 Photo by  Nikhil Mitra  on  Unsplash

List of .NET/C# Algo Trading Systems

When it comes to algo trading and automated investment, Python is one of the biggest players in the space, but many experts also use .NET/C# for its high performance and robustness. As we did some research on toolset you might look at to start your algo trading, we wanted to share this list for you.

Overall, the ecosystem has grown so much lately, and many open sources and tools are available for you at low cost, without much equipment.

  • QuantConnect

QuantConnect is one of the most popular online backtesting and live trading services, where you can learn and experiment your trading strategy to run with the real time market. The platform has been engineered in C# mainly, with additional language coverage such as python.

  • WealthLab

WealthLab is another C# platform where you can get the real time price and run your algorithm, if you have a Fidelity account.

  • NinjaTrader and MultiCharts

NinjaTrader and MultiCharts are also popular choices for different kind of assets with various broker options.

  • OpenSource Projects

In addition to these, StockSharp is an interesting open source project which is tailor for .NET algo traders and broker integrations.

You should also check out Lean which is an open source library developed by QuantConnect, who also uses this library for their flagship service, supporting multiple assets such as stocks and cryptocurrencies.

List of Data Library

  • Deedle

Deedle is probably one of the most useful libraries when it comes to algo trading. You would run some calculation using Frame and compare data, to get signals.

  • TALibraryInCSharp

TALibraryInCSharp is a great open source library that bridges TA-lib and .NET world, so that you can calculate common indicators such as moving average and RSI. Combining these libraries, you will get the power of trading tools.

  • IEX

Now the question is data to calculate those signals on, but if you are talking about US equities, you can leverage IEX’s free data API and there are libraries like IEXTradingApi that makes your life easy for getting the data instantly. 

  • Others

There are quite a bit of .NET libraries out there for proprietary data sources (e.g. for Quandl) too, so you should check it out.

Announcing Alpaca’s Official .NET Client SDK

Don’t forget about Alpaca! We are committed to providing the best experiences for many algo traders, and today we are happy to announce that our official .NET client SDK for Alpaca Trade API has been released.

Following our Python SDK, .NET SDK takes advantage of its robustness and high performance, as well as wide coverage of platforms. It is an open source project hosted in GitHub and the prebuilt package is up in NuGet. All the classes and methods are documented for IntelliSense so you can get the references right in your IDE.

Here is a snippet of how easily you can place a buy order of a share of Apple.

Alpaca Trade API covers not only retrieving account information and submitting orders, but also allows one to retrieve price and fundamentals information easily. For more details of API, please read our online documents.

Happy algo trading!

/

Algo Trading News Headlines 8/29/2018

Brazilian crypto trading platform hacked, over 264000 user data leaked

(www.coingeek.com)

Portal do Bitcoin reported that the hack was initially brought to light through a YouTube video posted by Investimentos Digitais. A total of 14,500 accounts containing a total of 5,813 BTC, currently worth about $40 million, were reportedly affected by the security breach.

 Photo by  Pedro Menezes  on  Unsplash

Photo by Pedro Menezes on Unsplash

Forecasting Market Movements Using Tensorflow

(alpaca.markets)

In this post we’ll be looking at a simple model using Tensorflow to create a framework for testing and development, along with some preliminary results and suggested improvements.

$6 Billion Daily Crypto Volume is Being Faked, How Can it be Combated?

(www.ccn.com)

Earlier this week, the Blockchain Transparency Institute (BTI) published a report claiming that the global crypto exchange market is faking $6 billion of its daily volume. The researchers at BTI evaluated the user activity and traffic of the market’s biggest crypto exchanges, comparing their projected trading volume to other metrics.

Empower Sebi to crack down on erring CAs, says panel

(http://www.asianage.com/)

New Delhi: The fair market committee report submitted to securities market regulator Sebi has many more unpleasant surprises for various market-connected entities. For instance, it opens a pandora’s box on whether Sebi has jurisdiction over errant chartered accountants or not.

/

Algo Trading News Headlines 8/27/2018

Trading Places — Lines Blurred Between Traders And Programmers

(seekingalpha.com)

The recent WSJ article focused upon details from Adam Korn, a 16-year veteran at Goldman. He stated that success today depends less on trusting one’s gut, rather much of a trader’s job is embedded in the computer code or algorithms, which do much of the work now.

What is the real story though, what has all this computerized algorithmic trading truly done, how much value has it truly created? One question I would like to ask, is there a correlation between the explosion of our debt levels and this newly digitized financial age?

 Photo by  Phil Botha  on  Unsplash

Photo by Phil Botha on Unsplash

Major Russian Airline Tests Blockchain in Bid to Track Fuel Payments

(www.coindesk.com)

According to S7, the application shares data about fuel demand on a shared ledger, a copy of which is managed by each of the three parties. Further, payments for the fuel can be conducted on the network, with digital invoices created via smart contract during each transaction.

Python Notebook Research to Replicate ETF Using Free Data

(alpaca.markets)

ETF is one of the great investment products in the last decade, and it has allowed so many people to gain the exposure to the wide range of assets easily at low cost. It is easy to buy a share of ETF without knowing what’s in there, but as a tech-savvy guy yourself, you may wonder how it works. By reconstructing the fund yourself, you may even come up with something better.

Trading Lesson: Don’t Touch That Dial. More to Come, Hedge Your Bets

(www.moneyshow.com)

In my 30 years as a trader, I’ve never seen a market like this. If the bots remain faithful to their programs, we are still likely to see higher stock prices over the next few weeks to months.

STEROID Launches New Automated Cryptocurrency Trading Algorithm

(www.bitcoinexchangeguide.com)

Algorithms run our online world, for the most part, a majority of everything done online is associated with an algorithm in one way or another. It only makes sense therefore that they would be used in the financial world as well. That is why STEROID has been developed, to create a functioning opportunity for traders on crypto exchanges.

Here’s how artificial intelligence can be used to beat the market

(www.cnbc.com)

CNBC’s Bob Pisani is joined by Sam Masucci, ETF Managers Group CEO, to discuss how he’s using an AI program to pick stocks.

/