Login Page - Create Account

Support Board


Date/Time: Sat, 20 Apr 2024 12:14:04 +0000



[Programming Help] - Write study Data to file

View Count: 1435

[2018-09-15 08:39:05]
User942837 - Posts: 108
Hi, I have a circumstance where I am using custom session times and exporting the data in csv format to be accessed by another system. The issue I have is that I need access to the bar closing time and not start time. I have no other way to access this data if not from the exported CSV itself. Is there any workaround to this because write study data uses start date only and I couldn't find the code to modify WriteBarAndStudyDataToFile as I would have tried to add sc.BaseDataEndDateTime[sc.Index] to it.

Thank you
Date Time Of Last Edit: 2018-09-15 08:50:21
[2018-09-17 07:43:06]
Flipper - Posts: 65
Why not just write a new study with





BarEndTime[sc.Index] = sc.BaseDataEndDateTime[sc.Index];


[2018-09-17 07:53:46]
Flipper - Posts: 65
Actually, there is a study for this,

Bar End Time
[2018-09-21 07:44:53]
User942837 - Posts: 108
Hi, thanks for your reply. Unfortunately this doesn't work as it does not print time as a string value. Is there a way to do this and use the write values to csv using write bar and study data to file study?

thank you
Date Time Of Last Edit: 2018-09-21 08:09:36
[2018-09-21 08:47:29]
Flipper - Posts: 65
Time representations in SC are -
Within a SCDateTime variable, the Time is represented by the fractional portion of the internal double precision floating-point number. It is a fraction of 1 day. Each second is equivalent to 1/86400.0 or 0.0000115741.
Working with the SCDateTime Variables and Values: Time Values

You could do it by writing a loop in C++ or an array and then saving to txt/csv but it may be easier to just convert it from midnight in whatever program you are using outside of SC.

What are you doing with it once it's saved to a csv?
Date Time Of Last Edit: 2018-09-21 08:49:30
[2018-09-21 09:14:33]
User942837 - Posts: 108
I'm working outside of c++ (in C#) and using dtc protocol.

The values I am getting for the Bar end Time is 1.93.

what do i do to convert this in minutes? This should be 13.5 hrs but can't manage to get it to this value.
Date Time Of Last Edit: 2018-09-21 09:15:22

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

Login

Login Page - Create Account