Back

QuantConnect Python beginner - questions

All,

I'm a quantConnect python beginner and having a hard time to find simple to understand examples as well as quantConnect pyton documentation. The quantConnect documentation is a good introduction but it doesn't really have concerete examples.

I've read here I can find some examples:

github.com/QuantConnect/Lean/tree/master/Algorithm.Python 

Now, I'm looking at this example:

github.com/QuantConnect/Lean/blob/master/Algorithm.Python/DailyAlgorithm.py

could somebody answer the following questions please:

- what is Field.SevenBar? and where can I find an explanation if I had to find an answer by myself?

- what is lastAction? Where do I learn how to use it?

- what does it mean "data.ContainsKey?

I'm quite concerned in regards of the current available documentation. I'm trying to move from quantopian to QC but it doesn't seem that simple...

Thanks,
Andrea

Update Backtest








It isn't simple.  I just made the same transition and had no coding experience prior to quantopian.  The learning curve to transition from quantopian to quantconnect is about the same as when you first learned python on quantopian.  The benifit is that quantconnect is pretty nice and the community is great.  I got a lot of great help from the staff with the "support" button in the lab along with community posts.  Keep it up and work hard and you'll have your previous algos up and running in no time. 

 

Sorry I cant answer your specific questions.  One place you may try is the university and boot camp.  They were a help to get started learning the differences between the 2 formats.

0

I can answer two fo the questions:

II) self.lastAction is a regular internar variable of the algorithm, as any other you can create. You can see that it is initialized in line 44, and it is set in line 60. It contains the time when the last operation was performed.

III) I guess that data.ContainsKey checks if there are quotes available from a given asset. Remember that except the asset is very liquidity, not all assets have quotes on all existent bars.

2

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