I'm having trouble transitioning a successful project into an Alpha because I cannot get it to give out any Insights during backtesting.
I just want the Alpha to emit insights exactly when the algorithm places trades, but I can't get that to work because Insights need to come from Update method, and my algorithm places trades in the OnSecuritiesChanged method. I've tried copy and pasting the trade process into the Update method, but it doesn't work because I then can't use the loop "for security in changes.AddedSecurities:" because "changes" does not work in the Update method.
Can someone help me out with this? How exactly can I get Insights to copy the algorithm when the algorithm is in "OnSecuritiesChanged" but the Insights have to come from "Update"?
And as for the feature request tag, shouldn't there be a way to have the algorithm emit insights whenever it is programmed to placed a trade with just a simple command?
Vladimir
Ethan Wertlieb
The best way to get help fast --> post the algorithm you're having trouble with.
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.
Ethan Wertlieb
class MyAlphaModel: def OnSecuritiesChanged(self, changes, algorithm): for security in changes.RemovedSecurities: algorithm.Liquidate(security.Symbol) for security in changes.AddedSecurities: if security is not algorithm.IsWarmingUp: FsymbolP = security.Price if FsymbolP > self.Fsmol.Current.Value: algorithm.SetHoldings(security.Symbol, .3) if FsymbolP > self.Fsmol.Current.Value and self.Fmedium.Current.Value: algorithm.SetHoldings(security.Symbol, .35) if FsymbolP > self.Fsmol.Current.Value and self.Fmedium.Current.Value and self.Flawge.Current.Value: algorithm.SetHoldings(security.Symbol, .4) if FsymbolP < self.Fsmol.Current.Value and self.Fmedium.Current.Value and self.Flawge.Current.Value: algorithm.Liquidate(security.Symbol)
Thank you for the quick response.
How do I get each of these trade signals to emit an Insight the same way they SetHoldings?
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.
Ethan Wertlieb
I solved the problem. In Documentation there was a "self.EmitInsights" value, and I used this along with deleting the "MyAlphaModel" set up in Initialize, because this way It doesnt require an Update method. Now I just have to figure out why my regular algorithm with the exact same code is returning a better value than the alpha is...
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.
Jack Simonson
Hi Stephane,
To activate it, you need to hit CTRL+Space and then autocomplete will pop up for the current code you are writing. If this doesn't work for you, try emptying the browser cache and doing a hard refresh. This should enable autocomplete for you, and if not please let us know!
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.
Flame
Hi Jack
Do you know how this works on mac? I can't seem to get it to work.
Thanks
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.
Jack Simonson
It should work the same on a Mac. Try a hard refresh, emptying the cache in your browser, and making sure the LEAN engine running in the cloud is the most recent version. If this still doesn't work, let us know and we'll try to pinpoint the issue!
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.
Bjorn
Anyone got this to work on Mac?
I cleared the browser-cache but "CTRL + Space" is not triggering an In-Browser Python Autocomplete (Firefox 64.0.2 (64-Bit) + Chome Version 73.0.3683.103).
Am i missing something?
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.
Flame
I haven’t been able to get it to work
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.
Link Liang
Hi Mac users,
Autocomplete in python is now available on MacOS! Please try it out by CTRL+Space and give us more feedback!
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.
Barry LAM
Autocomplete in Python available now??
I tried clean my browser cache and the autocomplete does not work.
Browser : chrome (Version 74.0.3729.157 (Official Build) (64-bit))
OS :Window 7 pro
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.
Link Liang
Hi Barry,
Could you try to type "self." in a python algorithm and then hit CTRL+SPACE? There should be a list of methods pop up. If it still does not work for you, please let us know and we will be happy to assist you.
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.
Barry LAM
Hi Link,
I found out the reason. As my company have more than one input language, when i press "CTRL+SPACE", the function is to change the keyboard input language. So, the autocomplete does not work.
For the people have this problem, you can change the "hot key for input language' in "Advanced key setting"
Thanks for your help.
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.
Sergei Laptenok
I'm using Mac, Chrome Version 76.0.3809.132 (Official Build) (64-bit). Autocomplete is painfully inconsistent. Sometimes it works, sometimes it doesn't, couldn't find any apparent pattern yet. Also, 1) when it does, it doesn't show all possible choices, 2) API hint looks to be C#
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.
Sergei Laptenok
Looks like I found the pattern: autocompete works only when the algorithm is built. So the steps are:
1) type "self."
2) wait a couple of seconds until it builds
3) hit CTRL+space
4) wait a second
5) see the list of options
Very inconvenient as is, but also the list is incomplete, as I said. E.g. I want to type self.UniverseSettings.Resolution, this is what I get (see screenshot):
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.
Martin Molinero
Hi Sergei Laptenok,
Once the build process is triggered, autocomplete is started in parallel. The autocomplete suggestions of self. do not include self.UniverseSe∈gs because we are limiting the number of suggestions for performance reasons. Triggering autocomplete on self.U will present UniverseSe∈gs as an option.
Step 2)waitacoup≤ofsecondsuntilitbuilds should not be required because the Terminal will not build until you hit CTRL+space or the build button.
We've just pushed some backend improvements with the objective of making autocomplete suggestions available faster.
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.
Sergei Laptenok
Thank you, Martin!
I might be missing something, but whenever I type anything, the Build button greys out and changes to "Building...". While it does, autocomplete doesn't respond.
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.
Jared Broad
debug if its something specific to your strategy
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.
Sergei Laptenok
I'm using a free account for now, trying to figure out if the platfrm is suitable for me, so ticket support is not an option. I did create a new algrithm (default template) and the behaviour is the same: build triggers every time I type anything new.
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.
Sherry Yang
Hi Sergei,
Thanks for trying out QuantConnect!
You can definitely keep sharing your questions without purchasing a paid tier. Keep sending your thoughts to the forum and our Quant team and community members can support. You are correct that build triggers every time new code is written. Can you share a bit more about what you’d like to see in the terminal in a new thread?
Thanks!
Sherry
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.
Derek Melchin
Hi Aadarsh,
Autocomplete should work for all of the objects in our API. Follow these instructions to get it setup.
Best,
Derek Melchin
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.
Alberto Esteban
Hello,
Autocomplete in python is not working. I tried all of the above:
tried different browsers: Edge, Chrome and Brave.
tried a different laptop, all three browsers
tried clear cache and cookies. still not working.
Im just getting started, and if autocomplete doesnt work, I woun't be able to get much done. At all.
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.
Dirk Steyn
Hi autocomplete also not working for me (on Crome)
follow all the instruction above.
Please help,
Dirk
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.
Pierre Guilet
Hi,
I have the same problem with python. CTRL+space launch the build but no popup. It does not work in firefox and edge without any adblock. And nothing is attributed tro ctrl+space. And option is activated. I have set up autocomplete in my local environment but it would be nice to have it in browser too.
Regards
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 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!