Login Page - Create Account

Support Board


Date/Time: Thu, 28 Mar 2024 14:58:49 +0000



[Programming Help] - Abnormal Behavior when assigning trade account using sc.SelectedTradeAccount ASCIL Member

View Count: 527

[2020-06-30 13:20:41]
rahul - Posts: 160
Hello, when assigning a trade account via ACSIL using "sc.SelectedTradeAccount" member, the chart header goes into a infinite loop (start flickering) and also I cannot then manually change the Trade Account.

I have tried putting the following code in sc.SetDefaults code block and also when sc.Index == 0 code block (1st iteration of the study). In the sc.SetDefaults code block, the trade account doesn't change (the code has no effect). When outside this code block, the abnormal behavior starts to happen as mentioned above.

SCString TA = "Sim2";
sc.SelectedTradeAccount  = TA;

Please look into this. I can create a video recording this behavior.

Currently using: Sierra Chart Version 2120.
Date Time Of Last Edit: 2020-06-30 13:22:05
[2020-06-30 18:50:28]
Sierra Chart Engineering - Posts: 104368
We will put in a patch for this, but you must avoid setting the account repetitively. Once you set it, do not keep setting it.

There is a full recalculation of the study when the trade account changes.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2020-06-30 18:51:06
[2020-06-30 18:53:45]
rahul - Posts: 160
Thank you. I don't plan on setting the account repetitively. I just want the account to be set based on the chart number when the study gets loaded as I have multiple accounts. You might want enable this option in sc.SetDefaults code block, as currently it doesn't set the study there.
[2020-07-02 11:55:25]
rahul - Posts: 160
I loaded Sierra Chart Version 2130 and don't seem to notice the issue anymore when I run the code in the same code block I use to reset persistent variables.
Was something fixed in the backend when I moved from Version 2120 to Version 2130?

if (sc.IsFullRecalculation && sc.Index == 0)//This indicates a study is being recalculated.
{

// When there is a full recalculation of the study,
// reset the persistent variables we are using
sc.GetPersistentInt(0) = 0;
sc.GetPersistentInt(1) = 0;
sc.GetPersistentInt(2) = 0;
sc.GetPersistentInt(3) = 0;

sc.SelectedTradeAccount = "Sim2";
}

Date Time Of Last Edit: 2020-07-05 19:11:52

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account