Support Board
Date/Time: Mon, 24 Feb 2025 00:58:35 +0000
Post From: reseting calculation every day
[2021-02-23 20:12:43] |
User30743 - Posts: 365 |
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
|