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

Python.RunTime in ninjatrader 8

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

    Python.RunTime in ninjatrader 8

    Does anyone know how to embed Python script using pythonnet and use its functions inside ninjatrader 8 strategy? if so please share the code snippet.

    #2
    Hello Nyman,

    I am not aware of a specific way to use python in NinjaScript that would work. There are external C# libraries that utilize python that you could try however that is outside of what our support can assist with. You would need to search in external C# websites for how to use python in C# in general and then use what you learned to test in NinjaScript.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Jesse, thanks for the suggestions. I'm doing exactly that.

      Comment


        #4
        Is there any update on this? Has anyone accomplished this yet? I've been wanting to attempt this as well but haven't given it a go yet. One way to achieve this is by using Python.NET (pythonnet), a package that lets you call .NET code from Python and vice versa.

        Here is a high-level overview of how you could make it work (according to ChatGPT): Steps to Integrate Python.NET:
        1. Installation: Install Python.NET in your Python environment.
        2. Importing .NET Libraries in Python: After installing Python.NET, you can import .NET assemblies into Python.​
        3. Calling .NET Methods: Once the DLL is referenced, you can instantiate .NET classes and call methods.
        4. Embedding Python Code in NinjaTrader C# Scripts: You can also use Python.NET to call Python code from within NinjaTrader’s C# scripts.​


        Comment


          #5
          Ymcapital I ran into a lot of problems many months ago with Python.Net, but I don't recall exactly what they were. I think it was too limited in it's support of data structures, and maybe there was a problem with the library being compiled against a different .net version than NT. I really don't remember it well. That said, I did get a python integration up and working well over sockets using the post below as a rough reference. It was a lot easier in the end. Check it out if you are stuck.

          Hello all, I have become increasingly more interested in the prospect of implementing machine learning into my trading, there is one article in particular that piqued my interest. https://inovancetech.com/how-to-trade-rsi.html He/She uses a support vector machine to find optimal values for trading the RSI. I found the

          Comment


            #6
            I appreciate that. I'll give it a look right now. It has been extremely tough trying to figure out how to integrate.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by fx.practic, 10-15-2013, 12:53 AM
            5 responses
            5,404 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by Shai Samuel, 07-02-2022, 02:46 PM
            4 responses
            95 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by DJ888, Yesterday, 10:57 PM
            0 responses
            8 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by MacDad, 02-25-2024, 11:48 PM
            7 responses
            159 views
            0 likes
            Last Post loganjarosz123  
            Started by Belfortbucks, Yesterday, 09:29 PM
            0 responses
            8 views
            0 likes
            Last Post Belfortbucks  
            Working...
            X