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

RestSharp access from NinjaTrader startegy

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

    RestSharp access from NinjaTrader startegy

    Hi,

    What is needed to call third party library like
    RestSharp calls from NinjaTrader strategy.
    I have added
    "using RestSharp;"
    line to code +
    Added Reference... to RestSharp.dll
    AND able to compile the code which contains those RestSharp functions but can't run strategy: (this is free translation from local language so about something:
    File or assembly RestSharp, Version=104.4.0.0, Culture=neutral, PublicKeyToken=null or some reference can not be loaded. Defined file not found

    Any ideas?

    I'm not any windows expert.

    #2
    raffu, did you restart NT after adding in the DLL and reference so the file could be loaded at startup?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      raffu, did you restart NT after adding in the DLL and reference so the file could be loaded at startup?

      Yes. no help.


      (This is probably some windows problem, tried to use
      regsrv32 to register the RestSharp.dll and so on without success and no idea should it be needed, but one another example program using RestSharp is working)

      Comment


        #4
        Hello,

        Thank you for the message.

        Is this a library that I could try on my end? I mean is this available for free download?

        It may be that if this was built using a newer version of .net it can not be referenced. NinjaTrader is .net 3.5 so it would need to be this or less.

        If this is something I can test I could try adding the reference and seeing what the error is exactly;.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          Hello,

          Thank you for the message.

          Is this a library that I could try on my end? I mean is this available for free download?

          It may be that if this was built using a newer version of .net it can not be referenced. NinjaTrader is .net 3.5 so it would need to be this or less.

          If this is something I can test I could try adding the reference and seeing what the error is exactly;.

          I look forward to being of further assistance.
          Thanks, actually I was referencing net 4.0 version but version 3.5 available too with same results.

          The whole project is to access ZuluTrade with their API which use
          public RestSharp, so it is available free.


          (ZuluTrade info at http://www.zulutrade.com/restapi-reference but no need to that)

          And now only need access to call some restsharp call and after that the system could be done.

          (independent, without NT, standalone example program runs ok)

          Comment


            #6
            Hello,

            If you are referencing the 3.5 version this should be correct. Are you getting any different output than previously?

            It looks like it was File or assembly RestSharp, Version=104.4.0.0, Culture=neutral. does the version of the assembly change after changing the reference to the 3.5 assembly?

            it may be that it is still referencing an old version, you may need to exit the platform and clear the assembly cache in the Documents\NinjaTrader 7\cache folder.

            After doing this re compile and try the script again.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Jesse View Post
              Hello,

              If you are referencing the 3.5 version this should be correct. Are you getting any different output than previously?

              It looks like it was File or assembly RestSharp, Version=104.4.0.0, Culture=neutral. does the version of the assembly change after changing the reference to the 3.5 assembly?

              it may be that it is still referencing an old version, you may need to exit the platform and clear the assembly cache in the Documents\NinjaTrader 7\cache folder.

              After doing this re compile and try the script again.

              I look forward to being of further assistance.
              Same output, no change, I have doubts that it does not point or try to load the correct (can't even be sure what it is as not any windows expert) dll at all..
              but interesting that compilation goes ok so at that time it is referencing at right way.

              (FYI, I changed, with Visual studio 2013 express, the RestSharp to newer version so not exatly the same output but version from the new one ( Version=105.0.1.0, Culture=neutral, PublicKeyToken=null ))

              Comment


                #8
                Hello,

                Yes this should be something to do with the dll file that is being built from that project.
                NinjaTrader is recognizing the file and trying to load it in the references but it is throwing the error you are getting because it can not load the code it contains correctly. The compile will work when you reference the DLL initially but may not be able to complete without logging the error about it not loading because it did not load.

                I have not seen this assembly used before so I am unsure if there are any additional steps you would need to complete in the project when you build this.

                You may look in their documentation or online for forum posts about this assembly to see if anyone has had problems referencing this assembly and what the solutions were it may point you in a better direction on this.

                If you are able to get any other output that may be helpful please post it and I would be happy to take a look.

                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment


                  #9
                  Resolution:

                  Copied the net35 version netsharpsigned105.0.1 RestSharp.dll to
                  .\Documents\NinjaTrader 7\bin\Custom directory
                  (initial version was elsewhere and maybe that was the problem!?)
                  and cleared tmp and cache directory. (recompile)

                  Everything OK!

                  Anyway now implementing the ZuluTrade API interface if someone is interested..

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by GussJ, 03-04-2020, 03:11 PM
                  11 responses
                  3,227 views
                  0 likes
                  Last Post xiinteractive  
                  Started by andrewtrades, Today, 04:57 PM
                  1 response
                  13 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by chbruno, Today, 04:10 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post chbruno
                  by chbruno
                   
                  Started by josh18955, 03-25-2023, 11:16 AM
                  6 responses
                  440 views
                  0 likes
                  Last Post Delerium  
                  Started by FAQtrader, Today, 03:35 PM
                  0 responses
                  12 views
                  0 likes
                  Last Post FAQtrader  
                  Working...
                  X