• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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
              Patrick H.NinjaTrader Customer Service

              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
                Patrick H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Atilla, Today, 04:05 PM
                0 responses
                9 views
                0 likes
                Last Post Atilla
                by Atilla
                 
                Started by Displacer, Today, 02:57 PM
                2 responses
                13 views
                0 likes
                Last Post Displacer  
                Started by SAILIKITY, 05-22-2019, 05:41 PM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_PaulH  
                Started by rmillar, 01-09-2019, 06:02 PM
                6 responses
                71 views
                1 like
                Last Post eDanny
                by eDanny
                 
                Started by mlarocco, Today, 11:39 AM
                4 responses
                23 views
                0 likes
                Last Post mlarocco  
                Working...
                X