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!
See more
See less

Partner 728x90

Collapse

Trying to add HtmlAgilityPack, run into number of errors

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Trying to add HtmlAgilityPack, run into number of errors

    Hi,

    I have been using HtmlAgilityPack with NT7 some years ago, and later migrated it to the early versions of NT8. I tried adding HtmlAgilityPack (added the dll&xml, and added reference) to my NT8 project, which raised a list of errors. See attached file error-without-netstandard.csv

    I then added netstandard (added the dll&xml, and added reference), and then got even more error. See attached file error-with-netstandard.csv

    Could you help please?



    Attached Files

    #2
    Hello Shai Samuel,

    You would need to find a .net framework version of that library, not the .net standard version. NinjaScript in NT8 is C# 4.8 .net framework. If there is only a .net standard version I would not suggest using that library with NinjaTrader.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you for the kind reply Jesse. It appears there is no .net framework version of it, as the future of .net framework is not clear.

      Anyway, I am looking for a xml and html parser. HtmlAgilityPack and XPath allowed me to do both, including extracting data from webpage, for example, reading the expected news hours from fire factory.com. Could you please suggest alternative libraries, that will work well with NT8?

      Comment


        #4
        Hello Shai Samuel,

        This would be a situation where you need to use a search engine to find and compare libraries based on what features you need. I am not familiar with any specific library for the tasks you mentioned. The requirement for the library to work with NinjaScript would be that it needs to be a .net framework library and equal to or less than 4.8 version.

        If that is an open source library you could look at extracting the relevant C# code for what you needed out of that library and then placing that code inside the NinjaScript addons folder. If the library targets another framework like .netstandard or uses newer C# features you will likely need to do some code changes/error correction to get that code to compile. You would also need to reference any needed C# libraries which the types in that code references.

        Another item would be to research if any of the web pages which you want to extract data from have an API, if so you could just do a web request or use whatever means their API is configured to use. A lot of web sites offer public API's when providing data is involved so that would generally be the suggested route for getting external data from a source if available.



        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by WHICKED, Today, 12:56 PM
        2 responses
        15 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Started by Felix Reichert, Today, 02:12 PM
        0 responses
        1 view
        0 likes
        Last Post Felix Reichert  
        Started by Tim-c, Today, 02:10 PM
        0 responses
        1 view
        0 likes
        Last Post Tim-c
        by Tim-c
         
        Started by cre8able, Today, 01:16 PM
        2 responses
        9 views
        0 likes
        Last Post cre8able  
        Started by chbruno, 04-24-2024, 04:10 PM
        3 responses
        49 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X