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 rhyminkevin, Today, 04:58 PM
                      0 responses
                      16 views
                      0 likes
                      Last Post rhyminkevin  
                      Started by lightsun47, Today, 03:51 PM
                      0 responses
                      6 views
                      0 likes
                      Last Post lightsun47  
                      Started by 00nevest, Today, 02:27 PM
                      1 response
                      14 views
                      0 likes
                      Last Post 00nevest  
                      Started by futtrader, 04-21-2024, 01:50 AM
                      4 responses
                      49 views
                      0 likes
                      Last Post futtrader  
                      Started by Option Whisperer, Today, 09:55 AM
                      1 response
                      15 views
                      0 likes
                      Last Post bltdavid  
                      Working...
                      X