Support Board
Date/Time: Tue, 04 Nov 2025 09:59:02 +0000
Post From: reseting calculation every day
|   [2021-02-23 20:12:43]     |  
| User30743 - Posts: 366 | 
| 
                no, i dont hold any persist vars. i keep track of a candlestick pattern, for simplicity lets say it is a pattern where each bar has higher high then previous sc.High[sc.Index] > sc.High[sc.Index - 1] && sc.High[sc.Index - 1] > sc.High[sc.Index - 2] 
i start trading at 8:30 so I don't want the consider the bars just before the start obviously. how do i do it? i believed something like this, but it does not work.. if (StartIndex  == sc.Index) sc.Index = 0; 
here is a simple study applied on the chart, marking the rising bars and showing the problem - https://prnt.sc/1051rev - the first two bars after 8:30 should not be blue of course this is the code for it SCDateTime TradingDayStartDateTime = sc.GetTradingDayStartDateTimeOfBar(sc.BaseDateTimeIn[sc.IndexOfLastVisibleBar]); SCString s = sc.FormatDateTime(TradingDayStartDateTime).GetChars(); auto StartIndex = sc.GetFirstIndexForDate(sc.ChartNumber, TradingDayStartDateTime.GetDate()); if (StartIndex == sc.Index) sc.Index = 0; if (sc.High[sc.Index] > sc.High[sc.Index - 1] && sc.High[sc.Index - 1] > sc.High[sc.Index - 2]){ Subgraph_IB[sc.Index] = sc.Index; Subgraph_IB[sc.Index-1] = sc.Index; Subgraph_IB[sc.Index-2] = sc.Index; } Date Time Of Last Edit: 2021-02-23 20:20:34  
             | 
        
