LEAN is the open source
algorithmic trading engine powering QuantConnect. Founded in 2013 LEAN has been built by a
global community of 80+ engineers and powers more than a dozen hedge funds today.
Alpha League Competition: $1,000 Weekly Prize Pool
Qualifying Alpha Streams Reentered Weekly Learn
more
We've created a new algorithm creation wizard for laying the groundwork for your algorithm. This wizard lets us pull in assorted modules and quickly assemble them into auto-coded scaffolding.
We've added a dozen or so Alphas over the last 2 days and we'll keep adding more and more so you'll have an enormous pool of template code to work from to seed your ideas. You'll still need to code though as these modules will just lay a foundation by importing the data needed and creating alpha models.
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.
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.
Send it through to support@quantconnect.com and we'll debug
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.
The wizzard is awesome! I'd suggest to add module templates, which creates files containing the basic code for each of the module types: alpha template module, universe template module, etc.
Thanks but was team effort! All Gustavo, Halldor, Jave, & Jack =)
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.
You can quickly switch between Python and C# by clicking the C#/Py icon on the bottom-right of the IDE window. When you switch between the two, there is no need to reload the page and you can immediately build new algorithms!
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.
Would be extremly useful to add a framework reference library to the Editor,
Rather than having to specify the specific components at the onset of algorithm creation, it would enable viewing the available Pallete of Alpha/Universe/Portfolio/Risk/Execution models to choose from.
All you really need(want) is enough to see what is available, the reference instantiation snippet (copy paste) and possibly and configuration documentation...
Further would be nice if this included privately defined and licensed alphas...
Thanks for your suggestions! We will definitely consider those cool ideas and add them to our roadmap.
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.
I am new to using LEAN. I built my first test usind "Algorithm Creator" to do the following: Implement and understand how RSI strategy works for "SPY". I used default plug and play components from "Algorithm Creator" and added a few graphs to undertsand how it works. (see attached backtest for code and graphs)
I am trying to figure out how to modify the code to undretsand the following things:
1. Why I see "SPY" baught and sold on the same day, in most of the trades.
2.Why I do not see any Insignts generated (I use Daily resolution to reduce backtest time).
3. Why S&P500 Benchmark shown as a straight line ?
4. How to show indiators and buy/sell signals on "Strategy equity graph"?
1) The short answer is: the resolution is too low. Here is the real answer: Since we are using daily resolution, the time of daily bar arrives is out of market hour. Therefore, every order is placed when the market is closed, and filled on the next day.
An example would be: On 2018-06-26, the closing price triggers risk management model and submitted an order to liquidate. However, that order is filled on 2018-06-27 with the new closing price on that day. And as it is filled, self.Portfolio.Invested becomes false again and another buy order is placed (and filled immediately). Moreover, although those two orders are filled, the portfolio values (unrealized profit, absolute holding cost) which are involved in the risk management calculation are not updated immediately. In fact, the new values will be effective when the next bar arrives (tomorrow). However, the closing price of 2018-06-27 still triggers risk management and another Liquidate() takes place. This is why you saw both buy and sell on 2018-06-27.
To avoid this: use minute resolution or higher. You would see what you expected: sell when risk management is triggered, and buy back when next bar arrives.
2) The reason is there was no insight triggered. I would recommand to user higher resolution or reduce the period (currently 60). To reduce backtest running time, besides using low resolution, we could also set end date to use less data. For example:
self.SetEndDate(2018, 12, 1)
3) It is a legacy issue and we will fix it soon. Meanwhile, you could use
self.SetBenchmark("SPY")
or select S&P500 benchmark by this:
4) In order to plot the values, I attached the RsiAlphaModel below the original code, and added the plot statement in Update() method. "Strategy equity graph" is our default chart and it's better not to modify it. We could always create a new chart for our own use. Please check for the last session in initialize() for my implementation, and here is our documentation page regarding charting.
Hope it helps.
1
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.
To manage your subscription, you could go to subscription page. Thanks for your support!
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.
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.
Loading...
To unlock posting to the community forums please complete at least 30% of Boot Camp. You can
continue your Boot Camp training progress from the
terminal. We hope to see you in the community soon!
You do not have enough QC Credit to send this award, get a QC Credit Pack
here.
Award Sent Successfully
Thank you for giving back to the community.
Processing...
Choose a Credit Pack
Payment Confirmation
QuantConnect Credit (QCC) can be applied to your cloud-invoices or
gifted to others in the community with Community Awards in recognition of their contributions.
Community Awards highlight the awesome work your fellow community members are doing and inspires
high quality algorithm contributions to the community. Select an option below to add
QuantConnect Credit to your account:
$5
500 Credit Points
 
$10
1,000 Credit Points
 
$18
2,000 Credit Points
10% bonus
$45
5,000 Credit Points
10% bonus
03/23XXXX XXXX XXXX 0592
We will charge your default organization credit card on file, click
here to update.