Back

I cannot add an algorithm in a comment on Recent tab

Jack Handey asked for an algorithm with multiple signals. I was able to post to the community, but the attached project does not show up on the Recent tab.
Update Backtest






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.



Hey that's great. So I'm not a great programmer, I see you are deriving the QuandlReader class from BaseData(). Does TradeBars also derive from BaseData()? Trying to figure out how the two are related I guess.
0

Thanks Nick, the recent tab is a highlight summary of the most popular and recent shared algorithms. Its too small to serve as a full forum but we just wanted to integrate the community with the IDE.
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.


@Jared Right! I figured as much. I just wanted to get the algorithm up to where people could see it because questions like this come up so often.

@Jack I think QuandlReader is your class. Am I wrong?

TradeBars do not exactly derive from BaseData. TradeBars is a collection derived from DataDictionary. TradeBar (singular) does derive from BaseData. That is to say QuantConnect.MarketData.DataDictionary is an implementation of the IDictionary interface. In C#, the is the Generic for a Type. A C# Dictionary is also known in other languages as a HashSet or a NameValueCollection. It is a collection of System.Types that is indexed by a key, that is often, but not necessarily, a string.

So TradeBars, the parameter to OnData, is a collection of TradeBar objects and is indexed by a Symbol object. So you can refer to a TradeBar by saying


TradeBar spy = data["SPY"]


QuantConnect's Symbol automagically converts the string to a Symbol.

You should look at the source code for TradeBar, TradeBars, DataDictionary, IDictionary, and Symbol in the source code. There you an see the properties and methods. That will give you a better feeling for these basic data types in QuantConnect (or any other algorithmic trading package for that matter).

So if you have a custom data type, you can derive it from BaseData and BaseData will take care of the Time, Symbol and some other stuff for you. Michael has some great code using a custom class for BitCoin data and then getting that data from a custom web call.

You should also be aware that Symbol has lately been revised by adding a SecurityIdentifer property called sid, so make sure you clone the latest Lean version from Github. The geniuses at QC have figured out a way to make that transparent so you can just use a string in place of the Symbol.
0

Update Backtest





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.


Loading...

This discussion is closed