Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Accounts using Esignal efs

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

    Multiple Accounts using Esignal efs

    Hello,

    I have an efs script running in Esignal that communicates fine with Ninja Trader using the default account input of "" in the command statement.

    NTCommand("Place", "", "Sell", Size, "StopLimit", EnterShort.toFixed(2), EnterShort.toFixed(2), "", "", "CurOrderID", "", "");

    I am looking to go live, but want to specify the account as I will have 2 accounts running within Ninja, 1 for manual testing and 1 for automated trading.

    Assuming the "Sim101" account I am currently testing, I adjusted the code as follows:

    NTCommand("Place", "Sim101", "Sell", Size, "StopLimit", EnterShort.toFixed(2), EnterShort.toFixed(2), "", "", "CurOrderID", "", "");

    No error is generated or order placed. It hangs on processing......

    Please help...

    Thanks in advance.

    #2
    What exactly do you mean by "hanging"? Is eSignal no longer responsive? Did you have to shut it down by task manager?

    Also: What's in NT's logs?

    Comment


      #3
      Sorry, should have been more specific.

      Esignal and Ninja are both still running withou issue. Perhaps "hanging" was the wrong term. I will give log examples.

      Here is the log without a specified account:

      1|1|AT, 'Place;;CL Q8;Sell;1;StopLimit;141.34;141.34;;;CurOrderID;;' processing
      |1|32|Submitting order without strategy...
      1|32|Order='f4dac16c81884110bc488e94c607802e/Sim101' Name='' New State=PendingSubmit Instrument='CL 08-08' Action=Sell Limit price=141.34 Stop price=141.34 Quantity=1 Type=StopLimit Filled=0 Fill price=0 Error=NoError Native error=''
      |1|32|Order='f4dac16c81884110bc488e94c607802e/Sim101' Name='' New State=Accepted Instrument='CL 08-08' Action=Sell Limit price=141.34 Stop price=141.34 Quantity=1 Type=StopLimit Filled=0 Fill price=0 Error=NoError Native error=''
      6

      Here is the log with a specified account:
      1|1|AT, 'Place;Sim101;CL Q8;Sell;1;StopLimit;140.91;140.91;;;CurOrderID;;' processing

      The order doesn't progress beyond processing, like it did above. No orders show up under the orders tab on the control center. It doesn't prevent anything else from functioning, just doesn't place the order.

      Thanks.

      Comment


        #4
        Please check the NTCommand() function itself in that its not passing in empty string as the account. From your log, it looks as if this is happening since I do not see the account value printed out.
        RayNinjaTrader Customer Service

        Comment


          #5
          Ray,

          Thanks for the response. I looked at the function as you had suggested, but nothing sticks out as wrong to me.

          Here is the NTCommand () function:

          // Submits a NinjaTrader command.
          function NTCommand(command, account, action, quantity, orderType, limitPrice, stopPrice, timeInForce, oco, orderId, template, strategy) {
          return dll.call("Command", command, account, getSymbol(), action, quantity, orderType, limitPrice, stopPrice, timeInForce, oco, orderId, template, strategy);

          Here also is the section of code from the premain:

          dll.addFunction("Command", DLL.INT, DLL.STDCALL, "Command", DLL.STRING, DLL.STRING, DLL.STRING, DLL.STRING, DLL.INT, DLL.STRING, DLL.DOUBLE, DLL.DOUBLE, DLL.STRING, DLL.STRING, DLL.STRING, DLL.STRING, DLL.STRING);

          Thanks in advance for any light you can shed on this.

          Comment


            #6
            Maybe try filling in the various blank strings with something as per this article? http://www.ninjatrader-support.com/H...mandParameters
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Also: Please make sure you are on latest 6.5.1000.4

              Comment


                #8
                I have verified the Ninja version.

                I have tested various strings within the NTCommand () function, and have come to the conclusion that it is accepting "Sim101" as a valid account, but stops the order entry process for some reason at processing..... in the log. No order is placed.

                NTCommand("Place", "", "Sell", Size, "StopLimit", EnterShort.toFixed(2), EnterShort.toFixed(2), "", "", "CurOrderID", "", "");

                function NTCommand(command, account, action, quantity, orderType, limitPrice, stopPrice, timeInForce, oco, orderId, template, strategy) {
                return dll.call("Command", command, account, getSymbol(), action, quantity, orderType, limitPrice, stopPrice, timeInForce, oco, orderId, template, strategy);


                for account:
                If I use "", it works fine.

                If I use "Sim101", it stops at processing.....

                if I use "test101", it errors and says account does not exist 'test101'

                The error tells me that it is reading Sim101 as the account ??

                Is there anyone out there that is using Esignal, Ninja and multiple accounts? Or, does anyone have any other suggestions?

                Any input would be much appreciated.

                Further info for consideration. I have installed the free version of Ninja and am using a free licence key. I am not trying to be cheap, I fully plan to purchase Ninja, love the software. Just want to get everything working as it should prior to connecting to a live account.

                Comment


                  #9
                  You can't trade a live account (even through ATI) with a sim/free key. You need to purchase a regular license.

                  Comment


                    #10
                    Dierk,

                    I understand that, thanks.

                    I am trying to test trade a sim account with a free key. Again, not trying to be cheap, I am trying to get everything working before I go live. Once live I will simply replace "Sim101" in my code with the live account info.

                    Are you saying that specifying an account in the NTCommand () will not work, unless you are using a purchased a licence key?

                    Thanks.

                    Comment


                      #11
                      You can create and trade as many sim accounts as you like by creating new sim accounts at Tools->Options->Simulator->Accounts.

                      Comment


                        #12
                        Dierk,

                        Thank You, you solved the problem.....

                        I created a new sim account, AutoAccount and placed that into the NTCommand () as "AutoAccount" and it worked.

                        But, for some reason "Sim101", which is the default account, doesn't work. If "" is used, orders are routed to the Sim101 account.

                        I also tried to set the AutoAccount as the default account and then switched back to "" to see if it would place an order into the AutoAccount account; that didn't work.

                        So, "" only works if Sim101 is the default account.

                        Thanks for the help. I will do further research, as I want to have an exact knowlege of how this works.

                        Comment


                          #13
                          >> So, "" only works if Sim101 is the default account.
                          Right, since Sim101 is the ATI default account. Tools->Options->ATI

                          Please consult the docs for details on configuring the ATI.

                          Comment


                            #14
                            Dierk,

                            I tested changing the default account to AutoAccount and then changing the text in the NTCommand () from "AutoAccount" to "" and it doesn't work. It stops at processing.... again.

                            Why would the "" ONLY work if the default account is ONLY Sim101?

                            Also, a new twist on this multiple account issue:

                            this command works -

                            NTCommand("Place", TradeAccount, "Sell", Size, "StopLimit", EnterShort.toFixed(2), EnterShort.toFixed(2), "", "", "CurOrderID", "", "");

                            this command doesn't -

                            NTCommand("Change", TradeAccount, "Sell", Size, "StopLimit", EnterShort.toFixed(2), EnterShort.toFixed(2), "", "", "CurOrderID", "", "");

                            I receive and error that 'CurOrderID' is in a terminated state and can't be changed; that is correct in the Sim101 account, but in the AutoAccount the state is accepted.

                            In Ninja's documentation:



                            For change and cancel, it shows that the account section of the command in the NTCommand () is not required or optional. How else would you change or cancel an order?

                            Thanks.

                            Comment


                              #15
                              Dierk,

                              I should have mentioned that I have declared a variable:

                              var TradeAccount = "AutoAccount";

                              Sorry.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by junkone, Today, 11:37 AM
                              0 responses
                              0 views
                              0 likes
                              Last Post junkone
                              by junkone
                               
                              Started by quantismo, 04-17-2024, 05:13 PM
                              5 responses
                              32 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by proptrade13, Today, 11:06 AM
                              1 response
                              5 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by love2code2trade, 04-17-2024, 01:45 PM
                              4 responses
                              34 views
                              0 likes
                              Last Post love2code2trade  
                              Started by cls71, Today, 04:45 AM
                              2 responses
                              10 views
                              0 likes
                              Last Post eDanny
                              by eDanny
                               
                              Working...
                              X