Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

dll and/or COM c++ samples

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

    dll and/or COM c++ samples

    Dear Sirs,

    is there some samples how to use automated trading dll and/or COM interface from c++ programme (visual c++ 6 or 9)?

    thanks,
    Igor

    #2
    Hi Igor,

    Unfortunately this level of programming is not supported on the forums.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick response,
      I already load dll and call Connected() func. I hoped there's some c++ samples but if no, I continue interfaces exploration by myself.

      Regards,
      Igor

      Comment


        #4
        C:\Program Files\NinjaTrader 6.5\bin\AutoTrade\NinjaTraderCSharpSampleApplicati on.zip

        Unfortunately we just cannot provide any support on this. You will have to play with it on your own. Thank you for understanding.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thanks you too.

          Comment


            #6
            I done something via COM interface.
            If somebody interested there is small guide:

            1. I added there to stdafx.h:
            Code:
             
            #import "c:\Program Files\NinjaTrader 6.5\bin\ninjatrader.client.tlb"
            2. There's my sample code:

            Code:
             
            IClientPtr clt;
            if(CoInitialize(NULL)!=S_OK) FatalError("Cant CoInitialize!"); 
            AfxOleInit();
            HRESULT hr = clt.CreateInstance(L"NinjaTrader.Client.Client");
            if( FAILED(hr)) FatalError("Cant CreateInstance IClient!");
            printf( "IClient instantiation successful!\n" );
            
            long ret;
            if(clt->SubscribeMarketData("ES 12-08")==0)
            {
            printf("Last = %f\n",clt->MarketData("ES 12-08",0));
            clt->UnsubscribeMarketData("ES 12-08");
            }
            else if((ret = clt->Connected(0))=-1)
            {
            puts("dll isnt connected to NinjaTrader!");
            }
            else puts("SubscribeMarketData error");
            clt = NULL;
            Tip: you will get 2 files in compile directory after compilation:
            ninjatrader.client.tlh & ninjatrader.client.tli
            Check them for more info about NinjaTraderClient interfaces.

            Comment


              #7
              Hello again,

              I'm interested also is there any func in API to catch exact trade event?

              Thanks,
              Igor

              Comment


                #8
                Unfortunately we can only support NinjaScript related programming questions. From NinjaScript you can catch trade events either via the OnOrderUpdate() or OnExecution() methods.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Igor,

                  Did you find anything in the DLL that makes it possible to externally program strategy analysis/backtests...?

                  Comment


                    #10
                    Originally posted by NinjaTrader_Josh View Post
                    Unfortunately we can only support NinjaScript related programming questions. From NinjaScript you can catch trade events either via the OnOrderUpdate() or OnExecution() methods.
                    Josh, i thought about Ticks handling. Something like NinjaScript's OnMarketData() method...

                    Can you say me please is it possibly to call external dll from within NinjaScript and put params to dll func?

                    Can you say also is it possible to get Ninja C++ interface support somewhere else?
                    Last edited by igorvlassov; 11-26-2008, 05:28 AM.

                    Comment


                      #11
                      igorvlassov,

                      Both of these are beyond the level of support we can offer on the forums. The information available is in the Help Guide over here: http://www.ninjatrader-support.com/H...heConcept.html
                      Josh P.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Mindset, 04-21-2026, 06:46 AM
                      0 responses
                      115 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by M4ndoo, 04-20-2026, 05:21 PM
                      0 responses
                      161 views
                      0 likes
                      Last Post M4ndoo
                      by M4ndoo
                       
                      Started by M4ndoo, 04-19-2026, 05:54 PM
                      0 responses
                      83 views
                      0 likes
                      Last Post M4ndoo
                      by M4ndoo
                       
                      Started by cmoran13, 04-16-2026, 01:02 PM
                      0 responses
                      127 views
                      0 likes
                      Last Post cmoran13  
                      Started by PaulMohn, 04-10-2026, 11:11 AM
                      0 responses
                      87 views
                      0 likes
                      Last Post PaulMohn  
                      Working...
                      X