Support Board
Date/Time: Thu, 23 Jan 2025 05:49:38 +0000
Post From: "Horizontal Line At Time" Study Not Recognizing Start and Stop Times?
[2018-10-31 00:50:46] |
User612649 - Posts: 40 |
Hello John, Thank you for responding, but unfortunately it didn't work. In backtesting, I tried using what you suggested but the sierra chart application does not acknowledge any end times on any studies. I do not understand why there is a configurable end time on "Horizontal Line at Time" and "High/Low for Time period" but neither study acknowledges the end time. The values just keep consistently changing. I tried your High/Low suggestion and then pointed the "Horizontal Line At Time" to the High at Time study, and they all three (Moving Median, Horizontal Line at Time, and High for Time Period) keep consistently changing. I just want a value at a specific time. There really is not a study that will just return the value at a specific time and do nothing else? I tried to write one as I do not feel that it should be that hard, but do not know how to finish it. // The top of every source code file must include this line #include "sierrachart.h" // This line is required. Change the text within the quote // marks to what you want to name your group of custom studies. SCDLLName("StoreValue") /*============================================================================ Store a value from another study at a specific time. ----------------------------------------------------------------------------*/ SCSFExport scsf_StoreValue(SCStudyInterfaceRef sc) { SCSubgraphRef Subgraph_StoreValue = sc.Subgraph[0]; SCInputRef InputData = sc.Input[0]; SCInputRef TriggerTimeValue = sc.Input[1]; if (sc.SetDefaults) { sc.GraphName = "Store Value"; sc.GraphRegion = 0; sc.AutoLoop = 1; // During development set this flag to 1, so the DLL can be rebuilt without restarting Sierra Chart. When development is completed, set it to 0 to improve performance. sc.FreeDLL = 1; Subgraph_StoreValue.Name = "Line"; Subgraph_StoreValue.DrawStyle = DRAWSTYLE_STAIR_STEP; Subgraph_StoreValue.LineWidth = 1; Subgraph_StoreValue.PrimaryColor = RGB(0, 255, 0); InputData.Name = "Input Data"; InputData.SetInputDataIndex(); TriggerTimeValue.Name = "Trigger Time Value"; TriggerTimeValue.SetTime(HMS_TIME(12, 00, 0)); return; } //SCDateTime variable contains a Date and Time value as a double precision floating-point number. SCDateTime VarTime; //Locally defined SCDateTime variable. VarTime.SetTime(TriggerTimeValue.GetTime()); //Get Trigger Time Value SCDateTime CurrentDateTime; //Locally defined SCDateTime variable. if (sc.IsReplayRunning()) CurrentDateTime = sc.CurrentDateTimeForReplay; else CurrentDateTime = sc.CurrentSystemDateTime; SCDateTime CurrentTime; //Locally defined SCDateTime variable. CurrentTime.SetTime(CurrentDateTime.GetTime()); //Get Current Time from DateTime if (VarTime == CurrentTime) //If VarTime = CurrentTime, execute { float finalvalue = Subgraph_StoreValue[sc.Index]; //Return Value. Will not return value return; } } I have literally wasted 48 working hours on just trying to get this done. Please help. |