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 CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        476 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        317 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        254 views
        1 like
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        340 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        305 views
        0 likes
        Last Post CarlTrading  
        Working...
        X