Back

Error in simulation request: Could not find the algorithm DLL in uploaded files.

How to solve this error since I have no custom dlls, just files present:

Error in simulation request: Could not find the algorithm DLL in uploaded files. If uploading a custom DLL please ensure it inherits class QCAlgorithm to match the interface.
Update Backtest








Hey @Quant -- I think that could happen if the QCAlgorithm class wasn't public, or it couldn't be instantiated. I ran the tests again and the servers seem fine. I'd recommend trying to create a new project and copy across the source line by line. You'll find the bug faster that way.
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,

I followed your advice. I copied everything twice to new projects. I tried changing namespaces, another algorithm...no luck today. Please could you give me some help?

J.
0

Hey J -- Do you mind if I open up your project? It will make debugging a lot faster.
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 Jared,

Thank you for the input. I wrote a small program to initiate the Loader.CS and to check what is going in. You are partially right: indead I have multiple QAlgorithm, for which only 1 could be loaded. However, in my project I use an interface class. It seems that the software is not 100% monkey proof on that. I would suggest next two things.

1. Add t.BaseType != null && so that classes without inheritance are allowed:

public static List GetExtendedTypeNames(Assembly assembly, string baseClassName) {
return (from t in assembly.GetTypes()
where t.BaseType != null && t.BaseType.Name == baseClassName && t.Name != baseClassName && t.GetConstructor(Type.EmptyTypes) != null
select t.FullName).ToList();
}


2. Add more logic to inform users - like me - that they cannot create multiple algorithms in 1 dll since the interface can only initiate one.


if (lTypes.Count == 0 || lTypes.Count > 1) {
Log.Error("QC.Loader.CreateInstance(): " + string.format("We found {0} classes which inherit from QCAlgorithm. I can only initiate one at a time. So please provide only the algorithm you want to run", lType.Count));
return false;
} else {
algorithmInstance = (T)assembly.CreateInstance(lTypes[0], true);
}
} catch (ReflectionTypeLoadException err) {
Log.Error("QC.Loader.CreateInstance(): " + err.Message);



I will try if this will fix my problem.

J.
0

hm.. in my project offline I have multiple, online I have only 1. It is related to the null in bullet 1. I removed the interface class I used in my algorithm. It does not inherit anything. I also put the other algorithms to 'none' as action in the file properties. So they won't compile and be in the dll.
0

For other readers reference we worked offline and will improve the loader code sometime in January with the next major release of the backend.
========

I have a hunch it is failing because it cannot create an instance of your DLL -- or in this case my DLL (since I copied your code). I cannot see why. The DLL arrives well formed and is on the server, but the compiler doesn't think it matches the IAlgorithm interface. Maybe having two public classes is confusing the launcher? Maybe the Type[0] in the code is referring to your "MovingAverage" class instead of the algorithm.
https://github.com/QuantConnect/QCAlgorithm/blob/master/QuantConnect.Common/Loader.cs

Try making the other classes private, or making them a sub-class and it might solve it and I'll make the "Loader.cs" code better in the future,

Best,

Jared
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.


Any idea when the new version is to be released?
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