Login Page - Create Account

Support Board


Date/Time: Fri, 07 Feb 2025 18:26:14 +0000



Updating study for new version

View Count: 759

[2020-06-06 21:55:35]
anouar6869 - Posts: 13
Hi support,

I need help to update this part of code:

int& PivotIndex = sc.PersistVars->Integers[npi++];    
  int& NextLineNumber = sc.PersistVars->Integers[npi++];  
  int& NextLineIndex = sc.PersistVars->Integers[npi++];  

  
  // Clear persistent data on (re)load
  if (sc.UpdateStartIndex == 0) {
    memset(sc.PersistVars, 0, sizeof(s_PersistentVariables));
  }

thanks
[2020-06-07 01:40:50]
Sierra Chart Engineering - Posts: 104368
Refer to this thread:
Notice: Study Exceptions in New Versions and Code Efficiency

And to this ACSIL function:
sc.ClearAllPersistentData()
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
[2020-06-07 04:33:22]
anouar6869 - Posts: 13
It works only if I put sc.ClearAllPersistentData() right after the default block, is that correct? It works fine.. only to be sure.

Thanks

/////////////////////////////////////

if (sc.SetDefaults)
  {
.............
  return;
  }

// Clear persistent data on (re)load
  if (sc.UpdateStartIndex == 0 ) {
    sc.ClearAllPersistentData();
   )
  // Main processing

  int npi = 0;  
int& PivotIndex = sc.GetPersistentIntFast(npi++);    
  int& NextLineNumber = sc.GetPersistentIntFast(npi++);  
  int& NextLineIndex = sc.GetPersistentIntFast(npi++);
[2020-06-08 01:37:37]
Sierra Chart Engineering - Posts: 104368
It is correct now the way you have it, but we do realize there is a safety problem with sc.ClearAllPersistentData regarding the fast persistent variables. This will be solved in the next release. When this is solved, you can use sc.ClearAllPersistentData anywhere.
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

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

Login

Login Page - Create Account