- ago
I need to write some statistical data about performance metrics and the equity curve state to a MongoDB database. There's a MongoDB .NET Driver. The NuGet package is quite extensive. How can I integrate this NuGet Package into Wealth-Lab so that I can write the data out of C# into MongoDB?

0
773
11 Replies

Reply

Bookmark

Sort
Glitch8
 ( 12.10% )
- ago
#1
I’d suggest writing a middleware executable that can write to Mongo DB. It would read the data from a text file that is output from the WL Strategy.

I think this would be far less painful and avoid any DLL hell versioning issues.
1
- ago
#2
The Mongo DB isn't a stat package. If you want to run statistics, why not write your data directly to R? You can even use R.NET to do it. The downside is that both applications have to be running together to use R.NET. See https://www.wealth-lab.com/Discussion/Using-the-R-statistics-program-with-WL-7247
0
- ago
#3
QUOTE:
I’d suggest writing a middleware executable that can write to Mongo DB. It would read the data from a text file that is output from the WL Strategy.

That could be plan C. Plan B would be to develop a custom C# library that supports MongoDB updates within Welath-Lab. I did the same to transfer trading signals to WhatsApp via the Twilio-API.

QUOTE:
The Mongo DB isn't a stat package. If you want to run statistics, why not write your data directly to R?

I don't need to run statistics to analyze the data any further. The only purpose to transfer the data to MongoDB is to use them in a Next.js 13 fullstack application.
0
- ago
#4
What about executing the CRUD operations via REST?
https://www.mongodb.com/blog/post/introducing-mongodb-atlas-data-api-now-available-preview
0
- ago
#5
REST operations under native C# are too crappy. With RestSharp or Flurl it would be usable with very little boilerplate code, but a 3rd party library is needed as well.
0
- ago
#6
Basically it would be quite simple. The MongoDB.Net Driver is just a DLL and an XML file. Therefore it is ok to copy the two files into the directory C:\Program Files\Quantacula, LLC\WealthLab 8. However, WL does not recognize the assembly, neither under the Assembly References nor in the Code Editor.

Is there another way "to marry" such a 3rd party assembly with WL?
0
Cone8
 ( 6.32% )
- ago
#7
QUOTE:
Therefore it is ok to copy the two files into the directory C:\Program Files\Quantacula, LLC\WealthLab 8.
Should be enough.

I don't see any "red squigglies" in the script. Did WealthLab complain about the compile?
0
Glitch8
 ( 12.10% )
- ago
#8
Did you also copy all of the various DLLs required?
0
- ago
#9
In fact, there were many more DLL's than first thought. I had to pick them all out of the NuGet package and copy them into the WL directory. Finally, the MongoDB classes are recognized and the collection updates are working with plain-vanilla code, directly out of WL.
0
Glitch8
 ( 12.10% )
- ago
#10
And good thing you didn’t run into a conflict where some of those dlls conflict with ones WL already has but with differing versions. Glad you got it working!
1
- ago
#11
Yes that would have been a no go if there had been a conflict. So I can send all the updates directly out of the SM. With more than a dozen of systems, this is much easier than controlling everything via a piece of middleware.
1

Reply

Bookmark

Sort