I hope someone can give me a hint, cause I'm overlooking something:
My bool function:
---------------------------------------------
public bool GreenBar1Tick(int barsago)
{
if (Close[barsago]>Open[barsago] && Open[barsago] + 1 * TickSize == Close[barsago])
{
return true;
} else return false;
}
---------------------------------------------
Above function works perfect and shows a diamond above every green candle with 1tick body, see below:
---------------------------------------------
protected override void OnBarUpdate()
{
if ( GreenBar1Tick(0) )
{
DrawDiamond(CurrentBar.ToString() + "diamond", true, 0, High[0] + TickSize, Color.Red);
}
}
---------------------------------------------
When I change the Zero in One like this it stops working......
---------------------------------------------
protected override void OnBarUpdate()
{
if ( GreenBar1Tick(1) )
{
DrawDiamond(CurrentBar.ToString() + "diamond", true, 0, High[0] + TickSize, Color.Red);
}
}
---------------------------------------------
Can someone tell me why? Any suggestions? Thx in advance !
(cause my goal was to create an easy way to add new patterns instead of typing it all over again and again. For example: if (RedBar3Tick(2) && GreenBar2Tick(1) && RedBar3Tick(0) ) { ......arrow...... }
Comment