I have this simple kind of "if":
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
Plot0.Set(Close[0]);
if (CurrentBar < 26)return;
if (CrossAbove(CCI(14), 5,5)&&XYZ[0]>XYZ[1] )
{
///Do something
DrawArrowUp("Dot"+ CurrentBar , false, 1,High[0]- 8*TickSize, Color.Gold);
}
The problem is that it will draw the arrow below EVERY bar that match the above condition when all what I want ids to draw it only one (first time conditions met)
Help to fix the code will be greatly appreciated.
Comment