Login Page - Create Account

Support Board


Date/Time: Mon, 22 Apr 2019 07:05:55 +0000



Possible error with new update

Support Request:
[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.
[2019-03-13 16:56:27]
Sierra Chart Engineering - Posts: 71060
1. You need to debug this issue. We have no idea what the problem is other than to say it is not due to any problem or change in a new version. That would not make any sense. The only change related to SCDateTime variables is you can no longer directly access the internal double value of the SCDateTime type. But that would only generate a compiler error if you were doing that.

2. Once again you need to debug what the problem is. We have no idea whatsoever what the issue is. We simply cannot help with something like this. We simply do not provide programming help.
Sierra Chart Support - Engineering Level

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

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2019-03-13 16:57:24
[2019-03-13 17:10:05]
lightbeckons - Posts: 11
No problem. Thank you. I was just wondering if there were any recent changes to the internal calculation relating to the operations performed on SCDateTime variables.

I'd take it from here, just please confirm a small doubt. If I add 8 hours to a SCDateTime variable at say 03-12-19 23:00, would the date part automatically roll-over?
As seen in the code above, im assuming that happens.

Also, if im not able to access the double value directly, would the rounding off to minute, and equality operators work the same way or do i check the date_part and time_part individually?
Date Time Of Last Edit: 2019-03-13 17:28:44
[2019-03-13 17:42:07]
Sierra Chart Engineering - Posts: 71060
Yes and you can verify that just by looking at the value of that SCDateTime variable using the function SCDateTime::GetAsDouble().

The documentation explains here the internal value of that type:
https://www.sierrachart.com/index.php?page=doc/SCDateTime.html

would the rounding off to minute, and equality operators work the same way
Yes.
Sierra Chart Support - Engineering Level

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

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2019-03-13 17:44:40

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

Login


Login Page - Create Account