I am trying to develop an indicator that colors the bars depending on the parameters that I use for my Entries.
I would like to know how can I count how many times this parameters have been met during the current day. I have 3 Entries depending in some parameters (Long or Short Entry) and 3 diferent colors for each Entry.
How can I count how many bars have met this parameters during the current day and draw the counting in the chart?
Please take in to account that I have 2 more entries. should I make an indicator for each one or one indicator for all would be okey?
For Example, one of my Entries:
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 1)
return;
// Set 1 - Long Entry
if ((Close[0] > SMA1[0])
&& (CrossAbove(EMA1, EMA2, 1))
&& (EMA2[0] > SMA1[0]))
{
BarBrush = Brushes.Yellow;
TextFixed MyDrawText = Draw.TextFixed(this, "tag1", "SEC ALC = " + Count, TextPosition.TopLeft);
MyDrawText.Alignment = TextAlignment.Left;
}
// Set 2 - Short Entry
if ((Close[0] < SMA1[0])
&& (CrossBelow(EMA1, EMA2, 1))
&& (EMA2[0] < SMA1[0]))
{
BarBrush = Brushes.Yellow;
TextFixed MyDrawText = Draw.TextFixed(this, "tag2", " SEC BAJ = " + Count, TextPosition.TopLeft);
MyDrawText.Alignment = TextAlignment.Left;
}
Thanks!

Comment