Login Page - Create Account

Support Board


Date/Time: Sun, 15 Jun 2025 16:30:57 +0000



Post From: ACSIL: Issue Setting Volume By Price Study Start Date/Time (Mode 5) Programmatically

[2025-05-30 09:08:16]
User431178 - Posts: 711

Using Graph Period Type 5 (From Start Date-Time To End), I have two parameters to set: Start Date AND Start Time. When attempting to configure these, I was getting completely unexpected anchor points for the target VbP Study.

Before setting date or time with sc.SetChartStudyInputFloat:
1) Time value - you need to make sure that the date part is zeroed
2) Date value - you need to make sure that the time part is zeroed.

Using input values:

// time with no date component
const auto time = SCDateTime(0, sc.Input[0].GetTime());
// date with no time component
const auto date = SCDateTime(sc.Input[1].GetDate(), 0);

Or if you are setting from a bar date/time value:


// get current bar datetime and zero the date part
auto time = sc.BaseDateTimeIn[sc.Index];
time.SetDate(0);

// get current bar datetime and zero the time part
auto date = sc.BaseDateTimeIn[sc.Index];
date.SetTime(0);