I'd like to create a indicator that show me when both bar , 1 minute and 2 minute are positive.
I compiled this code but it dosn't work .
Where is the error ?
CODE :
protected override void Initialize()
{
CalculateOnBarClose = false;
Add(PeriodType.Minute, 2);
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
if (CurrentBars[0] <= 1 || CurrentBars[1] <= 1)
return;
if ((BarsInProgress == 0)&&(Close[0] > Open[0]))
{
if ((BarsInProgress == 1)&&(Close[0] > Open[0]))
{
CandleOutlineColor = Color.Green;
}
}
Comment