Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Serialize Account and ATM Strategy
Collapse
X
-
Serialize Account and ATM Strategy
I've created an indicator that is adding an AccountSelector and an AtmStrategySelector to my chart. Any time I reload the indicator, the selected values in these controls are being reset. I've tried adding parameters to serialize the selected values and reset them at run time, but I am not able to get it working as expected. Are there any examples of how this can be done?Tags: None
-
Hello SystemTrading,
Thanks for your post.
I've attached an example indicator that does nothing but provides the UI for account and ATM selection.
Once selected and the workspace is saved, when restored the selections should remain.
ExampleAccountandATMselector.zip
-
The ATM Selector code seems to work properly, but I'm having an issue with the Account Selector. It serializes properly with the Sim accounts, but fails with a live/demo account. I've included a brief video below.
Video Here
I'm assuming this has something to do with the account name. The account name displayed in the Account Selector is:
DEMONT26557!Ninjademo!TSNT26557
However, the account name being saved is:
TSNT26557
So, it seems to fail when I try to set:
accountSelector.DesiredAccount = TSNT26557
How do we properly serialize live/demo accounts?Attached Files
Comment
-
Hello SystemTrading,
Thanks for your reply.
In the case of the live data demo name, the account name really is TSNT26557. You can verify this in the account tab by right-mouse click and selecting "Properties" and then check to enable the "Name" field.
You will have to assign an account object to the account TSNT26557 and from that you can pull the Display name of the account.
Something like:
lock (Account.All)
accountSelector.DesiredAccount = Account.All.FirstOrDefault(a => a.Name == SelectedAccountName).DisplayName;
- Likes 1
Comment
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
77 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
40 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
63 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
63 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
53 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment