Login Page - Create Account

Support Board


Date/Time: Thu, 25 Apr 2024 02:09:09 +0000



unexpected change of persistent variables

View Count: 965

[2017-11-25 18:57:05]
User436155 - Posts: 16
hello,

during the development of study i encountered a strange behaviour of my script. index of array stored in persistent variable changed its value to incorrect value unexpectedly. so i could not delete all graphic objects because the index was wrong and some objects remained on chart.

i could not replicate it because i did not know what the trigger is. until yesterday. for sake of simplicity i created an example of code which causes the issue. please see attached picture for explanation.

i think this behaviour affects all persistent variables and changes their values. is this a feature or some kind of bug?

thank you very much anf have a nice day
Jan

example code:

#include "sierrachart.h"

SCDLLName("Persistence Test");

SCSFExport scsf_p_test(SCStudyGraphRef sc)
{
  // set default settings
  if (sc.SetDefaults)
  {
    sc.GraphName = "Persistence Test";
    
    // During development set this flag to 1, so the DLL can be rebuilt without restarting Sierra Chart.
    // When development is completed, set it to 0 to improve performance. The default is 1.
    sc.FreeDLL = 1;

    // auto looping is disabled
    sc.AutoLoop = 0;

    // draw into the main price graph area
    sc.GraphRegion = 0;
    
    return;
  }
  
  SCDateTime & next_request = sc.GetPersistentSCDateTime(1); // get next request time from persistent variable
  
  // real-time check
  SCDateTime time_now = sc.CurrentSystemDateTime;
  
  // creating log
  SCString log_info;
  
  log_info.Format("next request call @ %s", sc.FormatDateTime(next_request).GetChars());
  sc.AddMessageToLog(log_info, 0);

  
  // time for next request? -> process outgoing data
  if (next_request < time_now)
  {
    sc.AddMessageToLog("NEXT REQUEST.. ", 0);
    
    next_request = time_now + 6 * SECONDS;  // set time of next request
  }
  
  return;
}

imagep_test_img.png / V - Attached On 2017-11-25 18:54:39 UTC - Size: 215.27 KB - 345 views
[2017-11-25 21:44:01]
Sierra Chart Engineering - Posts: 104368
We understand the nature of the problem. This is involved to resolve but we will see if we can get it done today.

Hopefully there are no unintended consequences with the solution.
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-11-25 21:44:08
[2017-11-26 02:56:10]
Sierra Chart Engineering - Posts: 104368
This is now confirmed to be resolved. We will have a new release out later today.
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