Back

R Connectivity and Data Artifacts, Particularly if using the online servers?

Hey,

I'm currently investigating QuantConnect for use as a production platform. I have a research stack developed in R and want to know if any interfacing capability exists when using LEAN via the QuantConnect servers. (I know in "open-source" mode I can use R.NET - but then as I understand it I won't be able to access QuantConnect's tick data.)

In similar vein, what is the policy on generating data artifacts and/or data export? I have a two stage process where I generate a number of factors; these factors need to be stored somewhere and referenced in order to do actual trading. Is there space on the online servers that I can dump the factors, or if not, can I connect to an external SQL server to dump/pull these factors from within the online servers?

Regards,

Vince
Update Backtest








Hey Vincent,

R.NET is a great tool, but we had to remove it temporarily because it was decreasing the stability of the cloud nodes. This was a while ago, so we'd be happy to re-evaluate the stability issues we were seeing. We have some big features we're currently working to get into the users' hands (hourly/daily data, backtest/live warmup) so this may not be at the top of our stack.

I'll check out the newest version and verify its stability on our cloud. If all goes well we can get that reference added for you. I'll check back here with how I make out.
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.


PS: Re: Data import/export: Its a tricky balance -- I'm sure you understand we have to respect the data providers wishes which prohibits raw price or "derived" data (e.g. moving averages) from being exported from QuantConnect. They allow up to 10kb export of non-price data.

You can definitely import data using QuantConnect custom data support, you just need to format it as a CSV with a Time and Value. You could also use WebClient class (inside "using System.Net") and download from your server/FTP directly into algorithm memory.
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.


Hi Michael,

Did you get a chance to check out the stability of R?

If it proves to be unstable might it be possible instead to allow us to output to named files in our own "name space" that we can't download but can use as input to an R process we can interact with? They could run in processes that are separate to Live and Backtesting processes.

That would be pretty helpful for debugging.  At the moment I log a very limited subset and import part of the log into R to visualise it.  The process is tedious but I don't know a better way.

Cheers for the great work.

Regards,

Kyle

0

Hi Kyle Howland-Rose, after this thread activity stopped in 2015, we have opted for RDotNet to enable R connectivity.
Please checkout this example: CallingRFromCSharp.cs.

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.


Thank you for the example Alexandre.  About this line...

engine.Evaluate("print('This is from R command.')");

Should I be able to see "This is from R command." in the plots or the log or somewhere?  

Also is there some way to use the R plot function and view the output?

Thanks again.

0


Hi Kyle Howland-Rose, for printing and plotting you will need to use Lean/QuantConnect API.
Basically, you will only be able to use R for calculations (which is the main reason to use it, right?).

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