Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MonitorAccount - Sim101 and LIVE Trading differences

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

    MonitorAccount - Sim101 and LIVE Trading differences

    Hi,
    i have developed a strategy which is running perfect for a Simulation Account but its not working with a LIVE Account.

    The Strategy takes 1 Parameter as String, the AccountName must be entered. Like "Sim101", which is working all the time. This are my lines of code to get the MonitorAccount:


    private Account MonitorAccount = null;

    .....

    if (State == State.Configure)
    {
    lock (Account.All)
    MonitorAccount = Account.All.FirstOrDefault(a => a.Name == AccountName);

    }

    Is there maybe something else iam missing?, thx

    #2
    Hello,

    Thank you for the post.

    Without being able to see both the input name printed along with each of the names listed in the account collection, I wouldn't be able to say why there was no match.

    A simple approach would be for you to Print the values here to see why this was not true.

    Before the line where you assign the account:

    Code:
    MonitorAccount = Account.All.FirstOrDefault(a => a.Name == AccountName);
    Add in a Print and a for loop:
    Code:
    for(int i = 0; i < Account.All.Count; i++)
    {
    	Account acc = Account.All[i];
    	Print("user selected account: " + AccountName + " account in NinjaTrader Account.All: " + acc.Name);
    }
    user selected account: Sim101 account in NinjaTrader Account.All: Backtest
    user selected account: Sim101 account in NinjaTrader Account.All: Playback101
    user selected account: Sim101 account in NinjaTrader Account.All: Sim101
    This would output the string name of what you had entered and what is in the accounts collection. If there is no match, you should be able to see why.

    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    44 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    124 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    65 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X