Back

Contributing code: Code dependencies question

Hi,

I am currently coding a Standard Deviation and a Bollinger Bands object.

As both of those indicators make use of the simple moving average, I would like to re-use some of the code in the code library, and introduce a dependency on the SimpleMovingAverage object.

However, when someone imports my code, they will not automatically import the dependent object.

Is there a way to manage this?
Update Backtest








Very good question! At the moment there isn't a way to solve this. Perhaps a better way to organize the library would be to setup a folder of the QCAlgorithm base class? This way we can start integrating and properly commenting popular indicators?

I've made a folder and laid out the first interface for this in GitHub -- if you agree this is the best way to solve it I'd love your help in creating a class library!

Feedback welcome on the initial Interface I defined as well -- hopefully indicators should be as easy as possible for the user, with ground work done by designer.

I know there are many technical analysis libraries out there but they are so poorly designed. It would be nice to have naitive C# online-implementations of the popular indicators which maximize backtest speed.

I'm trying to convince investors open-sourcing is the best path -- if the community helps build this indicator library it would be a great way to help convince them :) Thank you for your initiative Mathieu
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 will let you know when the code is done. Open source is indeed the way to go!
0

Surely the library TA-LIB should be implemented rather than developing a suite of indicators independently? Or do you consider this to be a badly written library?

I'm interested in your views...
0

My first impressions of it weren't that great Andrew - its been ported from other languages, and wasn't always designed for streaming data. Sometimes it was ported automatically making the code a mess to read. There's only about 100 popular indicators and if we build them ourselves we can deeply integrate them into the IDE - e.g. making the indicator accept Tick and TradeBar objects directly..

I know reinventing the wheel is a bad idea :) Perhaps we can experiment with wrapping TA with a QC interface which accepts Tick/TradeBars? We are super flexible at this point so open to feedback.

e.g in TA Lib: Slow batch, offline function

TicTacTec.TA.Library.Core.RetCode retCode = Core.Sma(0, closePrice.Length - 1, closePrice, PERIODS_AVERAGE, out begin, out length, output);

if (retCode == TicTacTec.TA.Library.Core.RetCode.Success)
{ output[i] }


vs QuantConnect: Fast streaming, online function.

var sma = new SimpleMovingAverage(10);
sma.Update(price);
sma.Value
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.


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