Login Page - Create Account

Support Board


Date/Time: Wed, 15 Jan 2025 17:36:56 +0000



Post From: Persist Variables

[2017-06-29 17:59:12]
Sierra Chart Engineering - Posts: 104368
You must be doing something wrong from your side.

If you reset your persistent variables you are using back to 0 using code like this, then they will be set to zero for sure.
if (sc.Index == 0)
{

// When there is a full recalculation of the study,
// reset the persistent variables we are using
sc.PersistVars->Integers[0] = 0;
sc.PersistVars->Integers[1] = 0;

sc.PersistVars->Integers[2] = 0;
sc.PersistVars->Integers[3] = 0;
}


My two persistent variables are Trade_PosL and Trade_PosS and they are NEVER set to 0 to begin with. They always stay as 1086121984 throughout the running of the whole program and because of this problem, my program is not sending any trades.
As long as you are displaying the values properly using the proper formatting function and formatting specification, persistent variables even without expressly resetting them in a study function, are at 0 when a study is applied to a chart or the Chartbook containing the chart which contains the study, is opened.
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: 2017-06-29 18:01:38