Login Page - Create Account

Support Board


Date/Time: Thu, 06 Mar 2025 09:35:49 +0000



Post From: Inaccurate OHLC data in custom study

[2022-01-26 19:50:58]
User907968 - Posts: 834
DataString.Format("current bar: Open:%f High:%f Low:%f Close:%f", sc.FormatDateTime(sc.BaseDateTimeIn[sc.Index]).GetChars(), sc.Open[sc.Index], sc.High[sc.Index], sc.Low[sc.Index], sc.Close[sc.Index]);

The problem is 'sc.FormatDateTime(sc.BaseDateTimeIn[sc.Index]).GetChars()' - you are missing the %s after 'current bar:', so instead the const char* value is trying to be read as a float.