## Algorithm Examples

Hi QC Community Members,

We would like to demonstrate more algorithms to help you get familiar with the QuantConnect API. Please leave comments in this thread about your need. We will collect those ideas and try to make examples to show the LEAN usage.

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.

https://www.quantopian.com/posts/stocks-on-the-move-by-andreas-clenowhttps://www.quantopian.com/posts/an-implementation-of-the-robust-asset-allocation-strategy-from-alpha-architectshttps://www.quantopian.com/posts/comparing-olps-algorithms-olmar-up-et-al-dot-on-etfs

Iã€€would like  these algorithm could migration on quantconnect.

0

Hi this is a great and timely initiative Jing,

To stay up to date with the "Big data" challenge and adress memory constraints that all users are deemed to face if they use second or tick level data, I would like to see in Python a "Monte carlo like" algo to help adress the issue with the current hardware, for instance:

- Step 1: Pull1 Month of second level data -> Compute second/second Change using diff() in Pandas -> Get unique value of Diff -> Get table showing count for each uniques value from diff(), get sharp raito for this time period for identified optimum entry and exit point

- Step 2: Reiterate above on Month 2 Data..

- Step N: Reiterate above on Month N

- Last Step: Recombine all N tables into one, Get distribution of sharp ratios to understand stability

1

Lastly there is some growing evidence around the superiority of Agent Based algos, the enclosed paper was designed in Python, do you think it would be owrth implementing, happy to work with you in this if it is of interest?

https://arxiv.org/pdf/1707.07338.pdf
1

short term mean revision or morningstar in action

maybe a strategy using a few indicators with sharpe around 1.5

0

Most of the strategies on QC are daily based, would be good to see something faster, intraday and HFT, if possible.

I was thinking about these strategies ...

1. Leader - Follower, find two dependent assets, the first one initiates the trend, the second one repeats this action with delay, on Forex it usually happens between EURUSD and GBPUSD. On the Stock Market, I presume some main stock, like Amazon, moves and some ETF or index fund, like QQQ, goes after, https://alphaarchitect.com/2013/09/10/follow-the-leader-in-the-stock-market-it-works/

2. Closing gaps or continuation of a breakout on pre-market, e.g. if usually price of some stock is going up, but at some day on pre-market if falls down or goes up about 5%, then traders are tend to catch the spike and revert the price to compensate at least 2.5% of this move,

3. Anything volume-based, if leve II and Order Book is not available, then would be good to see analysis of the market orders volume, e.g. find average volume for all stocks, detect volume spike, on the next day, detect where price keeps moving, catch the trend, I think this is how it should work, but there is no common opinion on how to analyse a turnover volume,

2

I wouldn't mind seeing a simple Iron Condor strategy like the one described here:

Where options are selected from the standard monthly series with a minimum 30 days to expiration, and the short and long legs are selected based on delta rather than the strike price.

0

Can we have complete Algorithm Framework script just combining the existing examples of Alpha, Portfolio, Execution and Risk? I would like to see how we approach to the common things in these modules such as OnSecuritiesChanged, Class SymbolData. Should we define a SymbolData class for each module separately; is one OnSecuritiesChanged function enough etc.?

we can use for example

https://github.com/QuantConnect/Lean/blob/master/Algorithm.Framework/Alphas/HistoricalReturnsAlphaModel.pyhttps://github.com/QuantConnect/Lean/blob/master/Algorithm.Framework/Execution/StandardDeviationExecutionModel.pyhttps://github.com/QuantConnect/Lean/blob/master/Algorithm.Framework/Portfolio/EqualWeightingPortfolioConstructionModel.py

https://github.com/QuantConnect/Lean/blob/master/Algorithm.Framework/Risk/MaximumDrawdownPercentPerSecurity.py
0

Ata Kut, we have full framework algorithm examples in the open-source project.
Please look for algorithms with FrameworkAlgorithm in the file names.

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.