Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
ML.NET project addition
Collapse
X
-
ML.NET project addition
I have created a machine learning project in Visual Studio using ML.NET. The project uses the Microsoft.ML nuget package which has various other dependencies. I would like to get this into Ninjatrader for use in a trading strategy. Is it possible to add the required project to the Ninjatrader solution file and reference the necessary classes this way? Or is it preferable to decompose all the nuget packages into their source dll's and place these into the appropriate Ninjatrader directory?Tags: None
- Likes 1
-
Hello mballagan,
Or is it preferable to decompose all the nuget packages into their source dll's and place these into the appropriate Ninjatrader directory?- Create a new visual studio .net 4.8 desktop WPF application on your desktop
- Add the nuget package
- build the solution
- Open the Bin/debug folder and collect whatever dll's or resources are required
- Place those files in the Documents\NinjaTrader 8\bin\Custom folder
- Use the NinjaScript editor to add references and check if the platform can compile
- Try using the references in a script
I look forward to being of further assistance.JesseNinjaTrader Customer Service
- Likes 1
-
I have carried out the steps as you have advised. I get the following compilation error. Any suggestions?
The type 'System.Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
Comment
-
Hello mballagan,
Is that from within NinjaTrader or visual studio?
The reference to netstandard would not be able to be used, if the library is not designed to be used with .net framework directly and requires other items like netstandard or netcore it wont be able to be referenced.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Comment
-
Hello mballagan,
Thank you for that detail. Yes it sounds like you completed the process correctly however if the reference utilizes any other frameworks outside of .net desktop 4.8 or lower that would be outside of the scope that we could help with getting referenced. You can try to search online what may be required to utilize that library or its underlying frameworks with .NET framework 4.8 desktop but I would not have any suggestions on that.
If you make some kind of external application which utilizes the framework you can always look at other means of calling that and providing data. You could for example make use of a stream writer to write data out of the platform and use other C# means like calling an external process. These are more of general C# tasks so not necessarily something our support could directly help with. You can search online for C# means of writing data or communicating between C# applications for more ideas.
I look forward to being of further assistance.
JesseNinjaTrader Customer Service
Comment
-
Jesse, Thanks for your response. I have managed to get it working but had to create a Web API project that wrappers around the ML.NET model. This is then deployed to Azure (it can be hosted in local IIS but I had some trouble getting this going) and the necessary API to connect to the service created using Postman which generates the necessary C# code to connect. So its not exactly the original goal of a self contained block which could reside inside the Ninjtrader directories but it works.
Comment
-
Originally posted by mballagan View PostJesse, Thanks for your response. I have managed to get it working but had to create a Web API project that wrappers around the ML.NET model. This is then deployed to Azure (it can be hosted in local IIS but I had some trouble getting this going) and the necessary API to connect to the service created using Postman which generates the necessary C# code to connect. So its not exactly the original goal of a self contained block which could reside inside the Ninjtrader directories but it works.Last edited by NinjaTrader_Jesse; 02-11-2021, 12:18 PM. Reason: no emails on the forum please use Private messages
- Likes 1
Comment
-
Hi,
If you're interested, we developed a machine learning add-on for NinjaTrader that uses ML.Net. There's a free trial available to try it out.
Cheers,
Eric
Comment
-
We didn't compile the source for AutoML.Net but did use nuget to get the compiled versions. You'll need to reference and register the dlls to use them.
Cheers,
Eric
Comment
-
Thanks for all the input on this subject. I've been experimenting with ml.net's automl and not sure if I'm building the projects correctly for use with NT. Here are the steps I take:
1. Open Visual Studio 2022 and Create new Project
2. Choose Class Library (.NET Framework)
3. Configure with Project name (ClassLibrary) and Solution name (ClassLibrary), choose .NET Framework 4.8 from dropdown menu and Create
4. View>Solution Explorer. Right click on project and Add>Machine Learning Model, name the model (ClassLibrary).
5. For now I just train the model with an uploaded CSV file built from exported chart indicator data
6. Build the project (ClassLibrary)
7. Locate the ClassLibrary.dll, Microsoft.ML.dll, files in the bin/debug folder, copy and paste into NT8/bin/custom folder
8. Right click in Ninjascript Editor, References, add the path to the dll files.
At this point the type or namespaces for the referenced dlls in the indicator script don't exist. What am I missing?
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by usazencort, Today, 01:16 AM
|
0 responses
1 view
0 likes
|
Last Post
by usazencort
Today, 01:16 AM
|
||
Started by kaywai, 09-01-2023, 08:44 PM
|
5 responses
603 views
0 likes
|
Last Post Today, 12:32 AM | ||
Started by xiinteractive, 04-09-2024, 08:08 AM
|
6 responses
23 views
0 likes
|
Last Post Today, 12:31 AM | ||
Started by Pattontje, Yesterday, 02:10 PM
|
2 responses
22 views
0 likes
|
Last Post
by Pattontje
Yesterday, 11:49 PM
|
||
Started by flybuzz, 04-21-2024, 04:07 PM
|
17 responses
230 views
0 likes
|
Last Post
by TradingLoss
Yesterday, 11:45 PM
|
Comment