Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Connecting to NT Brokerage (Mirus) throws error for strategies

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

    Connecting to NT Brokerage (Mirus) throws error for strategies

    When I connect any strategy to my NinjaTrader Continuum it throws the following error.

    World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


    I created the following strategy that I use for verifying workflow of events.

    Code:
    namespace NinjaTrader.NinjaScript.Strategies
    {
    	public class WorkflowStrategy : Strategy
    	{
    		bool realTimeAccount = false;
    		protected override void OnStateChange()
    		{
    			if (State == State.SetDefaults)
    			{
    				Description					= @"Overview of what events fire and items set";
    				Name						= "Workflow";
    				Print("OnStateChange: SetDefaults");
    			}
    			else if (State == State.Configure)
    			{
    				Print("OnStateChange: Configure");
    				CheckAccount();
    			}
    			else if (State == State.Realtime)
    			{
    				Print("OnStateChange: Realtime");
    				realTimeAccount = true;
    				CheckAccount();
    			}
    			else if (State == State.Historical)
    			{
    				Print("OnStateChange: Historical");
    				CheckAccount();
    			}
    			else if (State == State.Active)
    			{
    				Print("OnStateChange: Active");
    				realTimeAccount = true;
    				CheckAccount();
    			}
    			else if (State == State.Transition)
    			{
    				Print("OnStateChange: Transition");
    				CheckAccount();
    			}
    			else if (State == State.DataLoaded)
    			{
    				Print("OnStateChange: DataLoaded");
    				CheckAccount();
    			}
    			else if (State == State.Terminated)
    			{
    				Print("OnStateChange: Terminated");
    				CheckAccount();
    			}
    		}
    
    		protected override void OnBarUpdate()
    		{
    			if (realTimeAccount) CheckAccount();
    		}
    				private void CheckAccount() 
    		{ 
    			if (Account == null) {
    				Print("CheckAccount: null account");
    			} else {
    				Print("CheckAccount: CashValue:" + Account.GetAccountItem(AccountItem.CashValue, Currency.UsDollar).Value);
    				Print("CheckAccount: GrossRealizedProfitLoss" + Account.GetAccountItem(AccountItem.GrossRealizedProfitLoss, Currency.UsDollar).Value);
    				Print("CheckAccount: Commission" + Account.GetAccountItem(AccountItem.Commission, Currency.UsDollar).Value);
    				Print("CheckAccount: TotalCashBalance" + Account.GetAccountItem(AccountItem.TotalCashBalance, Currency.UsDollar).Value);
    				Print("CheckAccount: BuyingPower" + Account.GetAccountItem(AccountItem.BuyingPower, Currency.UsDollar).Value);
    				Print("CheckAccount: InitialMargin" + Account.GetAccountItem(AccountItem.InitialMargin, Currency.UsDollar).Value);
    				Print("CheckAccount: IntradayMargin" + Account.GetAccountItem(AccountItem.IntradayMargin, Currency.UsDollar).Value);
    				Print("CheckAccount: RealizedProfitLoss" + Account.GetAccountItem(AccountItem.RealizedProfitLoss, Currency.UsDollar).Value);
    				Print("CheckAccount: PositionMargin" + Account.GetAccountItem(AccountItem.PositionMargin, Currency.UsDollar).Value);
    			}
    		}	
    	}
    }
    Modified the script some - to try and identify where account info may be reported instead of always presenting ****

    EDIT - the **** appears to not show the actual .value in the ToString(). Wish it did for debugging purpose.
    Last edited by MarketAlly; 08-25-2015, 02:33 AM.

    #2
    I confirmed IB account is not throwing the error but NTC is
    Last edited by MarketAlly; 08-25-2015, 01:56 AM.

    Comment


      #3
      World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.

      Comment


        #4
        I would like to trade with my NinjaTrader Continuum account - can you advise how to resolve this?

        This was in my Trace log

        Code:
        ERROR [2015-08-21 13:36:12,695] - ASLU: Execution of GetVersion:27e3feb8-2803-4a62-8159-c856676893bb (attempt: 1) at HTTPS://CQGINQWC022I.CQGNET.COM/AUTHENTICATIONWEBSERVICE/AUTHSERVICE.ASMX returned an error:
        System.Net.WebException: There was an error downloading 'https://cqginqwc022i.cqgnet.com/AUTHENTICATIONWEBSERVICE/AUTHSERVICE.ASMX'. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 208.48.16.245:443
           at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
           at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
           --- End of inner exception stack trace ---
           at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
           at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
           at System.Web.Services.Discovery.DiscoveryClientProtocol.Download(String& url, String& contentType)
           --- End of inner exception stack trace ---
           at System.Web.Services.Discovery.DiscoveryClientProtocol.Download(String& url, String& contentType)
           at System.Web.Services.Discovery.DiscoveryReference.Resolve()
           at System.Web.Services.Discovery.DiscoveryDocumentReference.get_Document()
           at System.Web.Services.Protocols.SoapHttpClientProtocol.Discover()
           at CQG.Trader.DataAccess.SessionManager.LoginServices.AuthService.AuthServiceAsyncCommand`1.ExecuteCommand()
         WARN [2015-08-21 13:36:12,697] - ASLU: Login System will failover in 22 seconds.
        Last edited by MarketAlly; 08-26-2015, 07:05 AM.

        Comment


          #5
          Looks that configuration missing

          I was reviewing the Trace log and it appears that a configuration is missing. I tried removing and adding the connection and it still results in the same issue.

          Code:
          ERROR [2015-08-26 13:16:01,259] - Unable to read 'C:\Users\DaveF\AppData\Local\CQG\CQGTrader\NetsConfiguration.ini' file because Could not find a part of the path 'C:\Users\DaveF\AppData\Local\CQG\CQGTrader\NetsConfiguration.ini'.
          System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\DaveF\AppData\Local\CQG\CQGTrader\NetsConfiguration.ini'.
             at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
             at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
             at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
             at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
             at CQG.Trader.DataAccess.Utility.IniFileParser.Read(Func`3 singleLineParseCallback)
           INFO [2015-08-26 13:16:01,402] - QPAdapter: Registering injected packets parser.

          Comment


            #6
            Hello MarketAlly,

            Thank you for your information.

            Can you advise if this occurs with your strategy on the Sim101 account?
            Does this occur with the SampleMaCrossOver for any of your live accounts?

            In addition, can you attach the full .cs file you are testing to your response?

            Comment


              #7
              I see the issue - NT8 likes to keep settings even after I remove the account. When I removed the old account - it left the Account labels to be selected rather than removing them even though I removed Connection.

              I have a video showing the old ones remaining.

              World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


              It appears after I re-added the connection - the new values work.

              I also noticed that if you type in a wrong value in the historical data Instrument dropdown - it will always stay in the list even if not pinned. Not sure how to clean up the list in the dropdown.

              Comment


                #8
                Hello MarketAlly,

                Thank you for your patience.

                Please go to the Accounts tab > right click on any accounts listed that should not be listed > select Remove Account.

                For the instruments, hover over the instrument and press Delete on the keyboard.

                Please let me know if you have any questions.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                683 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                386 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                111 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                584 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                585 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X