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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        47 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        23 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        33 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        50 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Working...
        X