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

Excel VBA and ATI

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

    Excel VBA and ATI

    Brand new to Excel VBA. I am trying to automate trading strategies via Excel. I created VBA code as below.

    Private Declare PtrSafe Function CashValue Lib "D:\NinjaTrader 8\bin\NinjaTrader.Client.DLL" (ByVal lpAccountName As String) As Double

    Private Sub CommandButton1_Click()
    Dim dbCashValue As Double
    dbCashValue = CashValue("")
    Range("A1").Value = dbCashValue
    End Sub​

    When I click on CommandButton1, it stops on the line "dbCashValue = CashValue(""), and I get an error msg (see attached).

    Any ideas what I'm doing wrong?

    #2
    Hello Elevator2TheTop,

    Thanks for your post.

    Automating NinjaScripts via Excel goes beyond the support we would be able to provide you with in the Support department.

    Note that NinjaScript strategies use the C# programming language version 4.8 for NinjaScript development.

    That said, this forum thread will be open for other community members to share their insights on unsupported code that you may find helpful.

    Let me know if you have further questions.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      NinjaTrader_BrandonH Thanks for the reply Brandon. Can you confirm if the ATI interface is working in NT 8.1.1.3? The ATI is designed to integrate with other tools, so does the Dev team expect the DLL to work with VBA? If not, what dev tools are supported with the DLL? If you tell me that the Dev team expects the DLL to work in VBA, then I will get someone else to help me. If the Dev team says VBA is not supported, then tell me which tools are supported. Thank you!

      Comment


        #4
        Hello Elevator2TheTop,

        Thanks for your note.

        The NTDirect.dll (unmanaged) API is no longer supported for use in NinjaTrader 8.1 and has been discontinued.

        The API is still available with the .NET managed assembly NinjaTrader.Client.dll. Further, the ATI is still available through the Email and Order-Instruction-File approaches.

        Below is a link to a forum post discussion on the API.
        https://ninjatrader.com/support/foru...626#post793626

        ​Support for the API is limited from NinjaTrader Support. We are not able to assist with any code in an application external to NinjaTrader. We are able to detail the usage of any methods available from the API.

        Below I am providing a publicly available link to the help guide that lists the functions available to the API.

        Help Guide NT8 API functions - http://ninjatrader.com/support/helpG..._interface.htm

        On the forum, you can ask other developers in the community if anyone has tips for unsupported external application code.

        Please let us know if we may assist further.​​
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          NinjaTrader_BrandonH Hi Brandon, can you please confirm with the Development team that NinjaTrader.Client.dll is supported in VBA? The question that everyone keeps asking me -- is the DLL supported in VBA. I don't know what to tell them, because I am not familiar with how the DLL was developed. I know you can't help me with the programming, but your development team should be able to answer if it is designed to run in VBA.

          Thank you....

          Comment


            #6
            Hello Elevator2TheTop,

            While no specific application is supported with the API, and the API was not designed for any specific application or language other than C#, we can verify that any .NET 4.8 application should be able to use the API.

            Unfortunately, we would not be able to verify that VBA is specifically able to use the API.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Most likely it should be possible because I believe VBA can use .NET DLLs in general but doing this from VBA sounds like a bad design decision from a reliability standpoint. You would probably be a lot better to do the coding inside of NinjaTrader and maybe pull the information you need out of your Excel file if there's something in there you need. Excel tends to get quite unreliable under pressure.
              Bruce DeVault
              QuantKey Trading Vendor Services
              NinjaTrader Ecosystem Vendor - QuantKey

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by ETFVoyageur, Today, 02:04 PM
              1 response
              6 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by WHICKED, 04-26-2024, 12:45 PM
              4 responses
              46 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by samish18, 04-17-2024, 08:57 AM
              19 responses
              95 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by ezrollin, 02-26-2022, 11:14 PM
              6 responses
              205 views
              0 likes
              Last Post kenz987
              by kenz987
               
              Started by AaronKTradingForum, 04-28-2024, 02:37 PM
              5 responses
              52 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X