It is included inside a for loop that proceeds until condition1 exists and is exited with a goto statement. When conditio1 exists, the sw.Write statement is executed. I want the highest and lowest values since the signal triggered. If the low occurs on the bar where condition1 appeared, it returns the lowest value in the bars preceding the condition1 bar, but not the low of the condition1 bar.
Here is the gist of the code.
if(signal[1] == true)
{
signalbar = CurrentBar-1;
for(int i = CurrentBar - signalbar; i <= Count-signalbar ; ++i)//I have tried ++i and i++, but get the same result
{
.
if(condition1 == true)
sw.Write(",CC,"+MAX(High,CurrentBar-signalbar)[0]+","+MIN(Low,CurrentBar-signalbar)[0]);
.
goto exitloop;
}
}
What might I be doing wrong?
Comment