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

Running a Macro/Clicking a Button in Excel

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

    Running a Macro/Clicking a Button in Excel

    Lots of headway has been made this weekend and we're down the last problem.

    What I have done to get around the limits imposed upon us with NT (order handling, pairs trading etc) is to get a work-around where I can run my indicator in NT and have it send triggers and related details to IB's TWSDde.xls api, populate the BASIC ORDER sheet that spreadsheet uses to send orders etc....

    The only thing left, and thus this question, is the "Button" to send the order on the Excel sheet. It runs a macro and it has an accompanying short-cut key CRTL+SHIFT+P

    What can I send, programmatically?, from NT to make excel run the macro?

    I have used "BigMike's" Indicator to gain access to Excel and supposedly can do anything from there that I can using Excel directly..but I am not versed well enough to bridge this final gap.

    Any super-heroes left out there?


    LINK to BigMikeIndicator: http://www.ninjatrader.com/support/f...ad.php?t=36938

    #2
    Hello Steve,

    Just to be clear, you want to send the Ctrl, Shift, P hotkeys through the script is this correct?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Cal View Post
      Hello Steve,

      Just to be clear, you want to send the Ctrl, Shift, P hotkeys through the script is this correct?
      Well, I don't know for sure. What I want to do is run a macro that is attached to a button in excel.

      I'll take any method that does not draw blood or take too long.

      I just noted that the button also has a short-cut of CTRL+SHIFT+P

      I have no idea if anyone can do anything with that but is info just the same, if they can.

      I figure it's just a single line of code, but not being a macro guy at all, I'm never going to get it on my own.

      The BigMike indicator writer-guy said you could pretty much do most anything in his connection of indicator-to-excel that you can right from within excel itself...

      Let's assume you're in the correct Sheet already and all you need is the macro to run...
      Last edited by Steve R; 07-19-2014, 04:16 PM.

      Comment


        #4
        The actual macro name is:
        Sheet2.placeOrder
        in the spreadsheet.

        How to invoke from BigMikeIndictor is the question.

        Comment


          #5
          Steve,

          You can create your own method and add a button to the toolbar. With this button you can have it call the method which will contain your logic.

          I have attached a sample that will show this. Please note that this is unsupported programming and thus no documentation on it.
          Attached Files
          Cal H.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_Cal View Post
            Steve,

            You can create your own method and add a button to the toolbar. With this button you can have it call the method which will contain your logic.

            I have attached a sample that will show this. Please note that this is unsupported programming and thus no documentation on it.
            Cal my friend. listen to what i am saying.

            I want it AUTOMATIC - IE Programmed. I can already click a button if i am there. I want automation - IE me NOT there.

            all i need is the code to do so,

            I can't be much clearer. I need the NT CODE/C#/Excel command that can call/run a macro since I am already writing what i need into TwsDde.xlsm...........where the macro/button is located.

            Please don't give me solutions to problems i either do not have or didn't ask to solve.

            You did follow the link to BigMikeExcelIndicator to see where i have to write the code (NT indicator) and then see where it's going (TwsDde.xlsm), correct?
            Last edited by Steve R; 07-19-2014, 06:51 PM.

            Comment


              #7
              Hello Steve,

              Thank you for your response.

              Unfortunately, this is unsupported. I am not familiar with the functions and methods that can be called from Interop.Microsoft.Office.Interop.Excel.dll, or if these include the ability to call the button's click event in Excel. I would suggest asking the community on the Forum Thread as these users are very familiar with this process: http://www.ninjatrader.com/support/f...ad.php?t=36938

              Comment


                #8
                Hello Steve R,

                In addition, just wanted to clarify here that I understand you are asking for how to call the function that starts the macro in Excel and not looking for the actual button click event to trigger it as you mentioned you can already do that manually.

                You can also look into the following: http://stackoverflow.com/questions/1...ook-on-another

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by funk10101, Today, 09:43 PM
                0 responses
                3 views
                0 likes
                Last Post funk10101  
                Started by pkefal, 04-11-2024, 07:39 AM
                11 responses
                36 views
                0 likes
                Last Post jeronymite  
                Started by bill2023, Yesterday, 08:51 AM
                8 responses
                44 views
                0 likes
                Last Post bill2023  
                Started by yertle, Today, 08:38 AM
                6 responses
                26 views
                0 likes
                Last Post ryjoga
                by ryjoga
                 
                Started by algospoke, Yesterday, 06:40 PM
                2 responses
                24 views
                0 likes
                Last Post algospoke  
                Working...
                X