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.

    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?

        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. ​

            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.

                Comment


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

                  Thanks

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  110 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  59 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  37 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  41 views
                  0 likes
                  Last Post TheRealMorford  
                  Started by Mindset, 02-28-2026, 06:16 AM
                  0 responses
                  78 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Working...
                  X