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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        90 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        135 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        119 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        69 views
        0 likes
        Last Post PaulMohn  
        Working...
        X