Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 21:56:13 +0000



Post From: Possible error with new update

[2019-03-13 15:33:51]
lightbeckons - Posts: 11
I recently updated to the latest version of sierra, and a couple of my custom studies which worked perfectly before are giving me some errors.
1. I was adding a user defined input (integer) which would specify hours after BaseDataIn of a candle, to take a snapshot of the candle i.e the OHLC values. I did not need to account for the date considerations since i was adding the offset in hours. This seems to have developed some bug now. My logic is really simple to indicate a mistake there, and i have thoroughly gone over my code to no avail. I frequently use the concept of taking snaps of data at certain hours after open and this is crucial for me.

2. I think I am encountering some problem with the functioning (i.e getting and setting) and re-assignment of the values of persistent ints and floats in another study of mine, which resets the persistent variable containing current position if stopped out or exit signal generated. This seems to be failing now too, as the processing seems to execute lower parts of the loop but does not process the topmost loop (again uses DateTime variables to set the parameters used in execution).

Specifically there is a problem in this snippet of my code, as far as ive able to narrow it down:

//set the values to snap the poc value at guess time
int offm = Offset.GetInt();
  //offset time in minutes entered by user
  int offh = fix_time.GetInt();
  //offset time in hours from BaseDataIn of daily candle (user-defined)
  SCDateTime rbase = sc.BaseDateTimeIn[Index];
  rbase += offh*HOURS + offm*MINUTES;

SCDateTime curr = sc.LatestDateTimeForLastBar;
  //current time, also time of last record read during replays
curr.RoundDateTimeDownToMinute();
  
  float poc=0;
float vol=0;
  //when current time becomes equal to our snap time
  if(curr == rbase)
  {
//save study values here
}


Any help in this regard would be greatly appreciated. I will upload the chartbook pics or anything else that you may need to understand the problem, as soon as you let me know.
Thanks in advance.