Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Virtual trades NT8

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

    Virtual trades NT8

    Hello traders, i have some questione about two account( for example sim 101 in real trade and sim 102 only virtual trade)in the same strategy:
    -can i place the order in sim101 and in the sim102 for exalmple?
    - if not, how can i add the number of trades of the secondo account into the first??

    #2
    Hello bergimax,

    One way you can have a strategy submit to both the Sim101 and Sim102 account is by running two instances of the strategy at the same time with each different account selected when setting up your strategy to run on a chart, the Strategies tab, etc.

    Alternatively, if you wish to programmatically access different accounts on a single instance of a strategy, please take a look at this specific post: http://ninjatrader.com/support/forum...php?p=410327#2

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      thank's for the replay NinjaTrader_ZacharyG.

      I would like to use one istance of the strategy. I have same question:

      - If i use " SystemPerformance.AllTrades.TradesPerformance.Curr ency.CumProfit " i have the cumProfit of Sim101 + Sim102 or only for one of this?

      - when i use " SystemPerformance.AllTrades.Count" i have total trades of all account or only for one?

      Thank's for the assistance!

      Comment


        #4
        Hello bergimax,

        Testing on my end, it looks like that the strategy is only taking account of those trades placed to the account the strategy is assigned to.

        Here is a test script that demonstrates this behavior.

        Please, let us know if we may be of further assistance.
        Attached Files
        Zachary G.NinjaTrader Customer Service

        Comment


          #5
          Thank's for the replay NinjaTrader_ZacharyG.

          Do you know if there is some code to know the number of trades on the second account?

          Thank's!

          Comment


            #6
            Hello bergimax,

            I would suggest taking a look at the documentation related to the Account class for further information about what can be pulled from an Account object: http://ninjatrader.com/support/helpG...ount_class.htm

            It doesn't look like you can directly pull the number of trades made on the account, but you could pull the number of Order objects generated for the specified account: http://ninjatrader.com/support/helpG...rs_account.htm

            With this, you could produce some logic to keep track of your entries and exits and keep track of trades made.

            Please, let us know if we may be of further assistance.
            Zachary G.NinjaTrader Customer Service

            Comment


              #7
              I have another question.

              If i use unmanaged order in my normal account, how can i use the unmanaged order in the second account? Because if i use the equal code it doesn't work.

              Thank's!

              Comment


                #8
                Hello bergimax,

                You are unable to use the unmanaged order methods (SubmitOrderUnmanaged(), ChangeOrder(), CancelOrder()) on the second account. The order methods you would need to utilize for the second account would be account.Submit(), account.Change(), and account.Cancel().

                account.Submit(): http://ninjatrader.com/support/helpG...us/?submit.htm
                account.Change(): http://ninjatrader.com/support/helpG...us/?change.htm
                account.Cancel(): http://ninjatrader.com/support/helpG...us/?cancel.htm

                Please take a look at the Account class page for methods you can utilize with the Account class: http://ninjatrader.com/support/helpG...ount_class.htm
                Zachary G.NinjaTrader Customer Service

                Comment


                  #9
                  Thank's for the quick replay ZacharyG!

                  I use this methods. When i submit an order in the second account troughts "account.Submit():" , when this order is executed i would like to place the target and the stop order in "OnExecutionUpdates" troughts the "account.Submit():" too. But when the entry order is executed, my strategy can't place the target and stop order.
                  Thank's in advance for the replay!

                  Comment


                    #10
                    Hello bergimax,

                    Filled orders on a different account will not call OnExecutionUpdate(),

                    Orders placed to a different account will not be managed by your strategy; you would need to manually manage those positions.

                    Please take a look at this specific post in regards to introducing orders via the Account class: http://ninjatrader.com/support/forum...php?p=410327#5
                    Zachary G.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_ZacharyG View Post
                      Hello bergimax,

                      [...]
                      Please take a look at this specific post in regards to introducing orders via the Account class: http://ninjatrader.com/support/forum...php?p=410327#5
                      in this link i look this: "When you introduce orders via this Account class, you're now dealing with a 3rd layer which we consider a "Core Order"-> it's completely up to the developer to manage."

                      But in your last answer you write:
                      Originally posted by NinjaTrader_ZacharyG View Post
                      " Orders placed to a different account will not be managed by your strategy; you would need to manually manage those positions." http://ninjatrader.com/support/forum...php?p=410327#5
                      Sorry but now i'm confused.

                      Here http://ninjatrader.com/support/helpG...tionupdate.htm i see the OnExecutionUpdate under the account class.
                      My question is: when i place the order with account.submit how and where can i recall this OnExecutionUpdate? is it possible?

                      Comment


                        #12
                        Hello bergimax,

                        It looks like you will be able to utilize the AddOn code you have provided from the help guide in your strategy to print executions on the second account.

                        I have tested this on my end and I have attached a sample script that demonstrates this.
                        Attached Files
                        Zachary G.NinjaTrader Customer Service

                        Comment


                          #13
                          Hi @ZacharyG, i need some assistance white the trade performance on the second account. How can i know my cumulative profit in the second account?

                          Thank's for the assistance.
                          Bergimax

                          Comment


                            #14
                            Hello bergimax,

                            You would be able to utilize AccountItemUpdate: http://ninjatrader.com/support/helpG...itemupdate.htm
                            Zachary G.NinjaTrader Customer Service

                            Comment


                              #15
                              Hi @ZacharyG, and thank's for the fast replay.

                              In the AccountItem collection we have a series of option, such as realized and unrealized, but not the cumulative profit of the strategy. The Realized of the account is the sum of all strategy..

                              How can i get the cumulative profit?

                              Thank's!

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by GussJ, 03-04-2020, 03:11 PM
                              16 responses
                              3,281 views
                              0 likes
                              Last Post Leafcutter  
                              Started by WHICKED, Today, 12:45 PM
                              2 responses
                              19 views
                              0 likes
                              Last Post WHICKED
                              by WHICKED
                               
                              Started by Tim-c, Today, 02:10 PM
                              1 response
                              9 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by Taddypole, Today, 02:47 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post Taddypole  
                              Started by chbruno, 04-24-2024, 04:10 PM
                              4 responses
                              53 views
                              0 likes
                              Last Post chbruno
                              by chbruno
                               
                              Working...
                              X