Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Account.Mode

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

    Account.Mode

    Hello

    I'm trying to convert my code from NT7 to NT 8. I'm trying to find a replacement for:

    Account.Mode

    #2
    Bars.MarketData.Connection.Now

    Hello

    I'm trying to convert my code from NT7 to NT 8. I'm trying to find a replacement for:

    Bars.MarketData.Connection.Now

    Comment


      #3
      Account.Connection.Name

      Hello

      I'm trying to convert my code from NT7 to NT 8. I'm trying to find a replacement for:

      Account.Connection.Name

      Comment


        #4
        NinjaTrader.Cbi.Order

        Hello

        I'm trying to convert my code from NT7 to NT 8. I'm trying to find a replacement for:

        NinjaTrader.Cbi.Order

        Comment


          #5
          Order.Error

          Hello

          I'm trying to convert my code from NT7 to NT 8. I'm trying to find a replacement for:

          Order.Error

          Comment


            #6
            OrderState

            Hello

            I'm trying to convert my code from NT7 to NT 8. I'm trying to find a replacement for:

            OrderState.PendingCancel
            OrderState.PendingSubmit
            OrderState.PendingChange

            Comment


              #7
              PositionCollection

              Hello

              I'm trying to convert my code from NT7 to NT 8. I'm trying to find a replacement for:

              NinjaTrader.Cbi.PositionCollection

              Comment


                #8
                Repalce PositionCollection

                Hello

                I'm trying to convert my code from NT7 to NT 8. I'm trying to find a replacement for:

                NinjaTrader.Cbi.PositionCollection

                Comment


                  #9
                  PrintWithTimeStamp

                  Hello

                  I'm trying to convert my code from NT7 to NT 8. I'm trying to find a replacement for:

                  PrintWithTimeStamp

                  Comment


                    #10
                    Cbi.Globals

                    Hello

                    I'm trying to convert my code from NT7 to NT 8. I'm trying to find a replacement for:

                    Cbi.Globals

                    Comment


                      #11
                      Hello kiss987,

                      Thanks for the note.

                      We have merged your questions here to one thread and I will give you the details here in a single post. You can invistigate the undocumented code by using a NinjaScript editor and typing "NinjaTrader.Cbi. " Once you type the dot operator, you will see a list of all avaliable classes and properties at that level.

                      Cbi.Globals -

                      It looks like most of the Items in Globals were moved to NinjaTrader.Cbi.<package name>

                      PrintWithTimeStamp -

                      I am unable to find a method or property named this. If you could provide an example script where it is used I can investigate further.

                      NinjaTrader.Cbi.PositionCollection -

                      I found a Positions array here in the NinjaTrader 8 help guide:





                      OrderState.PendingCancel-
                      OrderState.PendingSubmit-
                      OrderState.PendingChange-
                      Order.Error-


                      All order states and error codes can be found here on the OnOrderUpdate method or the Order object help guide page:



                      NinjaTrader.Cbi.Order -

                      This is the Order object in NinjaTrader, it remained the same between NT7 and NT8.


                      Account.Connection.Name -

                      This has been changed to :
                      Account.Connection.Options.Name

                      Bars.MarketData.Connection.Now-

                      I was able to find Account.Connection.Now which seems to do the same thing. You can also override OnMarketData to get market data events as they come in.



                      Account.Mode-

                      This is unsupported, but I found a similar property which shows the license type running in the installation:

                      NinjaTrader.Cbi.LicenseType

                      Please let me know if I may assist any further.
                      Chris L.NinjaTrader Customer Service

                      Comment


                        #12
                        Account.Connection.Now

                        Thank you for your reply, I some further questions

                        1. Account.Mode
                        What I'm trying to accomplish is to find out if my connection is live / demo / Playback connection

                        2. NinjaTrader.Cbi.Order
                        How can I cancel an order?

                        3. Order.Error
                        How can I know on the OnOrderUpdate event if my order has an error

                        4. Cbi.Globals.Accounts
                        I have faile to find something like NinjaTrader.Cbi.Accounts

                        5. PrintWithTimeStamp
                        Although I couldnt find a documintation for it, it is still available on NT7 - StrategyBase.PrintWithTimeStamp

                        Comment


                          #13
                          Hello kiss987,

                          Thanks for the reply.

                          1. The supported way of doing this would be to check the name of the connection through ConnectionStatusUpdate



                          2. You will use the CancelOrder() method and pass in the order object.


                          3. The ErrorCode parameter in OnOrderUpdate() will be equal to ErrorCode.NoError



                          4. The Account class is the only supported and documented way to pull account data. I was unable to find any collection of Account objects in the documentation.

                          https://ninjatrader.com/support/help...gy_account.htm - Account class

                          5. PrintWithTimeStamp might have been removed from the NinjaTrader 8 code base. I am unable to find the method in the NinjaTader 7 documentation. The solution here would be to make a function that appends a timestamp to whatever is being printed.

                          Please let me know if I may answer any additional questions.
                          Chris L.NinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by trilliantrader, Today, 08:16 AM
                          2 responses
                          6 views
                          0 likes
                          Last Post trilliantrader  
                          Started by samish18, Today, 08:31 AM
                          1 response
                          1 view
                          0 likes
                          Last Post NinjaTrader_Clayton  
                          Started by Creamers, 09-08-2023, 10:26 AM
                          6 responses
                          157 views
                          0 likes
                          Last Post JonyGurt  
                          Started by funk10101, Today, 08:14 AM
                          1 response
                          2 views
                          0 likes
                          Last Post NinjaTrader_Jesse  
                          Started by bill2023, Yesterday, 08:51 AM
                          3 responses
                          22 views
                          0 likes
                          Last Post bltdavid  
                          Working...
                          X