Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATI Specified argument was out of the range

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

    ATI Specified argument was out of the range

    I am testing the latest NinjaTrader version (5.2.1000.1) on an IB Paper Trading account (TWS Build 858.6) with a NeoTicker strategy that submits orders via the ATI DLL. Can you tell me what the following error message implies and how to remedy?

    Code:
    11:10:48:000 ERROR: IB.Globals.MessageLoop msg='12': Specified argument was out of the range of valid values.
    Parameter name: Index was out of range. Must be non-negative and less than the size of the collection.
    
    11:10:50:718 ERROR: IB.Globals.MessageLoop msg='12': Specified argument was out of the range of valid values.
    Parameter name: Index was out of range. Must be non-negative and less than the size of the collection.
    
    11:11:25:140 ERROR: IB.Globals.MessageLoop msg='12': Specified argument was out of the range of valid values.
    Parameter name: Index was out of range. Must be non-negative and less than the size of the collection.

    Thanks

    Regards,

    Whitmark

    whitmark
    NinjaTrader Ecosystem Vendor - Whitmark Development

    #2
    imported post

    While I have not resolved the problem listedbelow, I am able to connect Ninja to the IB paper trading account and can place trades off the Ninja DOM. However, I am not able to return a connection status of 0 (connected) from the connected(1) DLL function when calling it from a NeoTicker strategy to place automated trades. I haveAutomated Tradingselected.

    Has anything changed in the last couple of Ninja versions that require modifications on my end to enable myDLL calls to work with thecurrent version?

    Regards,

    Whitmark


    whitmark
    NinjaTrader Ecosystem Vendor - Whitmark Development

    Comment


      #3
      imported post

      Attached is the connection error I receive when I bring up my NeoTicker strategy even though Ninja is up and running and connected to an IB paper trading account.
      Attached Files
      whitmark
      NinjaTrader Ecosystem Vendor - Whitmark Development

      Comment


        #4
        imported post

        We did not make any changes. Can you try a reboot and see, the IB socket communication could be out of sync.
        RayNinjaTrader Customer Service

        Comment


          #5
          imported post

          Ninja Support,

          Any thoughts as to what causes the error message I attached in my previous posts. Its the connection error I receivewhen I load the NeoTicker strategy that calls the DLLeven though Ninja is up and running regardlessif I am connected to IB, an external data stream, ornotat all.

          Thanks,

          Whitmark
          whitmark
          NinjaTrader Ecosystem Vendor - Whitmark Development

          Comment


            #6
            imported post

            Could you disable any firewalls and try?
            RayNinjaTrader Customer Service

            Comment


              #7
              imported post

              No luck on taking down the firewall. Where should the ntdirect.dll be located? I see it in the c:\program files\ninjatrader 5\bin\ subdirectory and I have it in the c:\windows\system32\ subdirectory too.

              Any other thoughts why I can't connect or how to diagnose? Thanks.

              Regards,

              Whitmark
              whitmark
              NinjaTrader Ecosystem Vendor - Whitmark Development

              Comment


                #8
                imported post

                Should be in both. Try copying over the one from the NT installation folder into the system folder.
                RayNinjaTrader Customer Service

                Comment


                  #9
                  imported post

                  I pulled togetheratest dll to test the connection betweenNeoTicker and Ninjathat plots the connection status and market postion as follows:

                  Code:
                  LIBRARY W_Test_Ninja_Connection;
                  
                  uses
                   ShareMem, SysUtils, Math, Classes, Graphics, NeoTicker_TLB, StrUtils, Variants;
                  
                  {$R *.RES}
                  //------------------------------------------------------------------------------
                  // Ninja DLL Calls
                  //------------------------------------------------------------------------------
                  FUNCTION Connected ( ShowMessage : integer ) : integer; stdcall; external 'NtDirect.dll';
                  FUNCTION MarketPosition ( Instrument: string; Account: string ) : integer; stdcall; external 'NtDirect.dll';
                  
                  //------------------------------------------------------------------------------
                  // NeoTicker IDL Call
                  //------------------------------------------------------------------------------
                  FUNCTION idlcallex(NTIndicatorObjects : INTIndicatorObjects) : double; stdcall;
                  BEGIN
                   NTIndicatorObjects.ItSelf.Plot[1] := Connected ( 1 ) ;
                   NTIndicatorObjects.ItSelf.Plot[2] := MarketPosition ('ER2 09-06', 'Sim101');
                  END;
                  
                  EXPORTS
                   idlcallex;
                  BEGIN
                  END.
                  I am getting thesame error (attached) when is Ninja up, connected, andautomated trading selected.

                  I've already tried your suggestion regarding the NtDirect.dlls andthey have the same date time stamp. I noticed that earlier versions of my code that worked didNOT have an argument for connected( )but now I see in help that a showmessage argumentis needed. Was that a change?

                  Any other thoughts or ways to diagnose would be appreciated.

                  Regards,

                  Whitmark
                  Attached Files
                  whitmark
                  NinjaTrader Ecosystem Vendor - Whitmark Development

                  Comment


                    #10
                    imported post

                    Tool->Options->ATI tab->ATI server port should be 36973.

                    Comment


                      #11
                      imported post

                      I believe that change was quite some time ago.
                      RayNinjaTrader Customer Service

                      Comment


                        #12
                        imported post

                        Thanks guys, that did the trick. Perhaps additional information on that error message would be helpful.

                        Regards,

                        Whitmark
                        whitmark
                        NinjaTrader Ecosystem Vendor - Whitmark Development

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by argusthome, 03-08-2026, 10:06 AM
                        0 responses
                        69 views
                        0 likes
                        Last Post argusthome  
                        Started by NabilKhattabi, 03-06-2026, 11:18 AM
                        0 responses
                        42 views
                        0 likes
                        Last Post NabilKhattabi  
                        Started by Deep42, 03-06-2026, 12:28 AM
                        0 responses
                        24 views
                        0 likes
                        Last Post Deep42
                        by Deep42
                         
                        Started by TheRealMorford, 03-05-2026, 06:15 PM
                        0 responses
                        27 views
                        0 likes
                        Last Post TheRealMorford  
                        Started by Mindset, 02-28-2026, 06:16 AM
                        0 responses
                        54 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Working...
                        X