I successfully draw HIGH and LOW lines during the 1st hour of trading, but I desire to make Fib lines, etc. based on the information. However, the DataSeries is somehow modified after the 1st hour. Here is the code...why is it losing values?
// count the bars during the first hour
if ((ToTime(Time[0]) >= 093000) && (ToTime(Time[0]) <= 103100)) {
if(FirstTickOfBar) {
yFirstHourBarCount.Set(yFirstHourBarCount[1] + 1); }
}
// calculate the High and Low; Draw lines
if ((ToTime(Time[0]) >= 093000) && (ToTime(Time[0]) <= 103100)) {
int iBarCount = (int)yFirstHourBarCount[0];
double mHigh = MAX(High,iBarCount)[0];
double mLow = MIN(Low,iBarCount)[0];
yHigh1Hour.Set(mHigh);
yLow1Hour.Set(mLow);
DrawHorizontalLine("firstHourHigh",…); //Works OK
DrawHorizontalLine("firstHourLow",…); // Works OK
}
There are 3 DataSeries here: "yFirstHourBarCount", "yHigh1Hour", and "yLow1Hour." in particular, I think it is a problem with losing the bar count value.
Thanks in advance for your help!
Comment