Back

Also new to QuantConnect, getting a bit lost...

Just saw a few posts from other people new to QuantConnect, so I guess that makes feel less lonely about fighting the platform, but still...
I'm trying to play with the platform and implement something to try it out, but so far I'm running into road block after road block, even for extremely simple things that are (or should be) covered in the documentation. It feels to me like either the documentation is missing some important points, or it's just out of date entirely.

Anyway, I hope someone can help on these:
- I can't get the Debug() function to work. Whatever I try, I'm getting errors saying it's not found. Using it alone doesn't work. Adding a 'using QuantConnect.Logging' doesn't work. I can't find a way to have this one working, and since it's the only way to actually debug...
- Implementing a custom indicator is a real pain. I've been fighting with that for hours, and I'm still trying to have the first block of it work (considering there are 5 or 6 of them, it will take a damn week). This feels like something pretty standard. How about a bit of documentation on that? Or a complex example to showcase that? So far, I'm trying to compute a TypicalPrice to start up on this, and I only get a flat line of 0's...
- The online Terminal is getting me crazy so far:
• Using it on Safari on a small MacBookAir screen, the 'Results' button was not showing up. So I switched to Chrome.
• Now, the build errors are showing up while I type, but when I stop typing, I have to manually build the project to have them update with the source code I just finished typing.
• Half of the time, when I start a backtest, it's showing up as 'Queuing' and won't update. I have to restart from the home page, get back to the project, to see the results showing up.
- For the next step, I'll probably want to switch from a Daily timeframe to a 4H, and after having read a few things about it, I'm starting to be afraid. It seems like I'm going to have to implement every single detail of handling 4-hours bars by myself, piece by piece. With regards to the custom indicator I'm trying to add, I just dread the moment when I'll have to make it work on an hourly timeframe. Don't you feel handling different timeframes is pretty basic? Will you add that at some point?

Are you guys aware of these, and are these really normal? I didn't really find anyone being annoyed by all that, so it feels like I'm a bit alone on that, and everyone else would be happy with the way it work.
Update Backtest








Hey Fred! Sorry about the issues you are having, I'm afraid most of them sound like your internet connection, or no javascript permissions. Everything is working well (debug, backtesting, building). Safari had issues for a while which we fixed a few weeks ago. We can't support older versions of Safari. Intraday charting hasn't been done yet but its definitely on the list :)

Indicators are trickier to use: I'd recommend starting with the open source documentation (https://lean.quantconnect.com/docs#topic14.html). If you have any suggestions to make them easier we'd welcome them! Its requires implementing 2 methods (IsReady, ComputeNextValue). There are many 20+ examples of indicators here: https://github.com/QuantConnect/Lean/tree/master/Indicators
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.


Try to also clearing browser's cache as if you use long periods with minimal resolutions, browser would slow down considerably (even Chrome).
0

Wow, fast replies... I didn't really expect anything today ;)

A few notes on both replies:

The site was feeling a bit sluggish this morning, so that may be related. I'd be surprised if it was just a matter of clearing the cache or using the latest version of Safari. I now switched to Chrome, so this is the latest version, brand new with no prior data. Anyway, I'll try on another connection as soon as possible, clearing all previous data from the browser, just in case...

On the matter of different timeframes, I wasn't really talking about charting (even if that helps debugging, and visualizing, of course), but at the very least for backtesting. Right now it looks like one has to implement a 'consolidator' to create the bars at the desired timeframe, and I have no idea whatsoever how indicators would work in this case.

But indeed, the open source documentation seems to be a bit more complete on some matters. I'll try going on with that from now on.
However, still no clue on to how to make the Debug method work...

Thanks for the help!
0

We pre-consolidated data into ticks, seconds and minutes. Any further you'd need to do yourself but its fairly simple. Its a class called "Consolidator" which you create and update. When its ready it fires an event with the consolidated bar. I'll ask Michael to post an example today - he built this system.

The Debug is working well, just clone the basic template to test. If you're not seeing debug messages it probably because that part of your code isn't running. If you send multiple identical messages the system ignores them to prevent you crashing your web browser.
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.


Yeah, I saw the consolidator code, but I was wondering how it was behaving with regards to the registering of indicators where you have to specify a resolution. Obviously custom resolutions wouldn't exist there.

I managed to get the debug logging working, but only from the QCAlgorithm subclass. Apparently, it will refuse to work from any Indicator subclass, which would be most helpful when trying to implement an indicator.
0

Hey Fred!

There's a lot of things going on here so I'll try to respond to each one. I was curious as to your C# experience level. This will help in future posts so I can point you to relevant resources.

Debug function

You mention errors getting the 'Debug' function work and saying you're getting errors that it is 'not found'. Does your code compile? If it doesn't compile I imagine you're trying to call the Debug function from a place that doesn't have the Debug function. The Debug function is defined on the QCAlgorithm class, so you have to call it on that class. See the MSDN documentation for more information on method invocation.

Custom indicator implementation


This would be easier to help you with if you were able to share some code. We have a tutorial in the documentation on how to create your own indicator. As Jared stated, you should only need to derive from the base class and implement a couple functions. Indicators are never concerned with the resolution of data they receive (by design) so you shouldn't need to update your indicator when you want to change your resolution, you would just send different data to it. I also suggest looking at the many implementations that are a part of the core product.

If you have trouble creating an indicator, please share your algorithm and I'll help you get it working. That's what I'm here for!!

Online terminal

It sounds like a spotty connection, but if the online IDE isn't ideal for you, then I would recommend coding your algorithms in Visual Studio C# Express Edition. It's free and awesome. You can fork the github repository and run locally, debugger step through and everything! Then when you have something working, copy the files into QC and run on more data.

Changing resolutions

This should be easy if you design your algorithm with this in mind. Take a peak at this example I recently posted. It gives a pattern for creating lots of indicators against lots of symbols. It may be a little more advanced (I'm not sure of your C# level), but I think it showcases that changing the resolution of data for a consolidator is as simple as changing the value of a single field (in this case BarPeriod).

Indicators with consolidators


Consolidators are a wonderful way to provide automatic updates for your various indicators. Have a look at the documentation for consolidators. In short, we allow for consolidators to be registered through a call to the SubscriptionManager.AddConsolidator. This registers the consolidator to receive automatic updates for the requested symbol. The consolidator fires events to let listeners know that it has consolidated a new piece of data. We can wire these events up to update our indicator. This is how the helper functions cause automatic updates for indicators.

I'd recommend browsing around the examples in the github repository and trying to edit them.

If you have problems trying to accomplish something, please share your algorithm and I'll be more than happy to help you get it working!

Let me know if there's any other questions I can answer for you.
0

Thanks for the reply to the different questions. I'll investigate consolidators and timeframes more thoroughly a bit later, and also grab the code for the indicator and post it here to have your opinion on it. I finally managed to get it to work, but I'm not sure this is the right way to go, and I found quite a few weird things in the process.

However, a few notes on the points you mention:
- I have no experience in C#, but I'm an experienced Obj-C developer, so switching between languages is usually not a problem
- Nice to know the 'Debug' method is defined in QCAlgorithm. I finally figured that out by trial and error. But this would be an important thing to state in the documentation. The documentation just described it as a "helper function" and gives its prototype. Usually a helper function is something that is defined globally. The documentation should state that this is part of QCAlgorithm.
- And unfortunately, the online terminal is the only solution for me, as I won't be running Visual Studio anytime soon on OS X...
0

Actually,. I'm also started to get such strange errors of backtest window not appearing (status also not updating). Cache clearing doesn't help here.
0

@Tadas - In the results view, you can see the "Waiting Time" -- 99.9% of the time this should be 0-minutes. You won't ever have to wait to run a backtest. But if people are sending too many they queue up and you might need to wait a little. This morning there was someone issued lots of parallel, 2+ hour backtests which chewed up the whole cloud :)
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.


Yes, I mean it doesn't load when actually it is already done or with runtime error. Backtest is shown "in queue" for very long, then I just refresh window and it's sitting there (results or error). But I think it's all caused by overload, so I can just wait.
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