Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to tell if the account is a simulation account

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

    How to tell if the account is a simulation account

    I'm using

    Code:
    Print("Account: " + Account.Name);
    Print("Simulation Account: " + Account.SimulationAccountName);
    Print("Simulation Name: " + Account.SimulationName);
    In OnStateChange State == State.Config

    This prints:

    Account: Sim101
    Simulation Account: Sim101
    Simulation Name: _Simulation

    I'd like to know the correct way to determine if the strategy is running on any simulation account or if it's a real account.
    Thank you!

    #2
    Hi Brillo, thanks for posting.

    The best way to find this is to check the Accounts name for a "Sim" prefix or add a simple boolean property where the user can toggle live vs simulation behavior from the properties menu. Unfortunately, there's no built-in property that will tell if the account is live or simulated.

    Kind regards,
    -ChrisL

    Comment


      #3
      All sim accounts will have the "Sim" prefix regardless of what the user names the account? That's fine. It is working to test this way:

      Code:
      [Browsable(false),XmlIgnore]
      protected bool IsSimAccount { get { return Account.Name.ToLower().StartsWith("sim"); } }
      Thanks.

      Comment


        #4
        Hi Brillo,

        Yes, all custom sim accounts will start with "Sim"

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        21 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        120 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        63 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        41 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        45 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X