Support Board
Date/Time: Mon, 03 Feb 2025 10:19:47 +0000
Post From: CurrentDate Time Trouble
[2019-11-02 17:03:03] |
User312841 - Posts: 26 |
Seems like this should be an easy answer for a real programmer, I have not been able to find the answer. I want to put a marker (horizontal line in this case) at the same time each day. But it only displays on the chart in the most recent day. I tried persistent variables and in this example a global variable. Graph shows it working for the current day, what is the code to make it display in previous days. Thanks // Data processing sc.DataStartIndex = 0; SCDateTime TimeToCheckFor; //The first step is to get the current date. int CurrentDate = sc.BaseDateTimeIn[sc.ArraySize - 1].GetDate(); //Apply the time. For this example we will use 12 PM TimeToCheckFor.SetDate(CurrentDate); TimeToCheckFor.SetTimeHMS(12, 0, 0); //float LineVal = sc.Input[0].GetFloat(); // get integer value from Input 0 // TimeToCheckFor is contained within the current bar. if (sc.IsDateTimeContainedInBarIndex(TimeToCheckFor, sc.Index)) { g_highNoon = sc.RoundToTickSize(sc.BaseDataIn[SC_HIGH][sc.Index]+.00,0.01); } sc.Subgraph[0][sc.Index] = g_highNoon; } http://www.sierrachart.com/image.php?Image=1572713613953.png |