Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting account capital on a simulation

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

    Getting account capital on a simulation

    Hi,

    Simulating a strategy I would like to calculate the risk according to a % of the account capital, but if I check the capital, it always tells me $10,000.

    Code:
    double cashBalance = Account.Get(AccountItem.CashValue, Currency.UsDollar);
    I need to know this to calculate the risk based on compound interest (if the account goes up, I risk more and vice versa)
    How can I check the account capital in a simulation, updated with the operations?

    Thanks

    #2
    Hello Powerbucker,

    Thank you for your post.

    What account are you running this on? If you are using the Sim101 account, you can edit the account's cash balance from the Control Center > Accounts tab by right clicking on the account and selecting 'Edit Account'.

    You can change this to match your live account's cash balance or any other value.
    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      I'm executing a simulation of strategy, not in real time

      Thanks

      Comment


        #4
        Hello Powerbucker,

        I'm not clear on what you mean. Are you running on the Sim101 account, Strategy Analyzer, or Playback?
        Gaby V.NinjaTrader Customer Service

        Comment


          #5
          strategy analyzer

          Comment


            #6
            Hello,

            Backtest orders are virtual and are not actually submitted to an account, so account values will not change as strategies are backtested.

            For backtesting purposes, you would need to instead implement internal calculations in your strategy to calculate and track your own custom values for the desired account values.

            Please let us know if you have any further questions. ​
            Gaby V.NinjaTrader Customer Service

            Comment


              #7
              Ok, I've developed a customized balance account management.

              What's this does mean?

              Code:
              Strategy 'Strategy_TEST/-1': An order has been ignored since the stop price ‘2301’ near the bar stamped ‘03/11/2024 03:35:00’ is invalid based on the price range of the bar. This is an invalid order and subsequent orders may also be ignored
              Thanks

              Comment


                #8
                Hello Powerbucker,

                Please create a new thread for this inquiry as it is unrelated to the original post. This way when users search for information on the forum, threads don't contain non-relevant information to the topic they're searching for.

                Create a new thread instead of a reply when you have a new question that is unrelated to a previous inquiry. This will allow us to properly track each issue.

                We appreciate your cooperation in this regard.
                Gaby V.NinjaTrader Customer Service

                Comment


                  #9
                  Done. I've created a new thread.

                  Thanks

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by natngk, 02-21-2019, 06:27 AM
                  21 responses
                  1,291 views
                  1 like
                  Last Post FMtrader  
                  Started by richt3, Yesterday, 10:28 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post richt3
                  by richt3
                   
                  Started by Atychiphobia66, Yesterday, 10:22 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post Atychiphobia66  
                  Started by Scalper1969, Yesterday, 09:24 PM
                  0 responses
                  13 views
                  0 likes
                  Last Post Scalper1969  
                  Started by RISKYBUSINEZZ, 12-12-2023, 05:11 PM
                  3 responses
                  127 views
                  0 likes
                  Last Post judysamnt7  
                  Working...
                  X