Support Board
Date/Time: Fri, 24 Jan 2025 05:20:55 +0000
Post From: Inaccurate back tests results
[2018-12-18 11:33:03] |
UserZiltoid - Posts: 57 |
This is the full source code for reproduding the bug in speed of 80X: ----------------------------- #include "sierrachart.h" int persistentLastSecondTest = 0; SCSFExport scsf_testVolumeTImeStudy(SCStudyInterfaceRef sc) { if (sc.SetDefaults) { sc.GraphName = "Test Volume time Study"; sc.AutoLoop = 1; sc.GraphRegion = 0; sc.FreeDLL = 0; } auto currentTime = sc.GetCurrentDateTime(); auto currentSecond = currentTime.GetSecond(); int& lastSecond = sc.GetPersistentInt(persistentLastSecondTest); auto currentVolume = sc.Volume[sc.Index]; if (currentSecond != lastSecond) { SCString test; test.Format("CHEKING | Index[%d], Volume[%f] - %d:%d:%d", sc.Index, currentVolume, currentTime.GetHour(), currentTime.GetMinute(), currentSecond); sc.AddMessageToLog(test, 0); lastSecond = currentSecond; } } ----------------------------------- For example - bug result: Chart: Replay 80X: F.US.EPH19 1 Min #1 | Study: Test Volume time Study | CHEKING | Index[1271], Volume[5119.000000] - 12:41:58 | 2018-12-18 05:29:02 Chart: Replay 80X: F.US.EPH19 1 Min #1 | Study: Test Volume time Study | CHEKING | Index[1271], Volume[5167.000000] - 12:42:3 | 2018-12-18 05:29:02 as you can see there is a new minute, and yet the index didn't change and the volume that appears is relevant to the previous index. later in the next second the index changes and so the volume is now correct: Chart: Replay 80X: F.US.EPH19 1 Min #1 | Study: Test Volume time Study | CHEKING | Index[1272], Volume[109.000000] - 12:42:4 | 2018-12-18 05:29:02 Date Time Of Last Edit: 2018-12-18 12:08:43
|