I tried to just write something that draws a red arrow if the current bar is red and closed below the immediately prior red bar low if that was red.
I also wanted a green arrow if the current green bar closed higher than the immediately prior green bar's high if that bar was green.
The red work and if I only have it look for all green bars that works too but the green won't give any arrows once I include the prior bar requirement. The red stay working.
I tried breaking it into two indicators but same thing, the green only works if I code to look at all green. I thought there used to be a way to do condition 1 and then run for condition 2 etc... but I don't remember how.
I cannibalized this from another indicator with arrows.
Any ideas why it won't work on green?
[/QUOTE]
/// <summary>
/// This method is used to configure the indicator and is called once before any bar data is loaded.
/// </summary>
protected override void Initialize()
{
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1 LONG type #2
if (
Close[0]> Open[0]//green
&& Close[0]>High[1] // closed higher than prior high
&& Close[1] > Open[1]//green
)
{
DrawArrowUp(" up" + CurrentBar, false, 0, Low[0]- (TickSize*dist), Color.Lime);
}
//***********************************
//Condition set 2 SHORT type 2
if (
Close[0]< Open[0]//red
&& Close[0]<Low[1] // closed lower than prior low
&& Close[1] < Open[1]//red
//&& Close[-2] > Open[-2]//green
)
{
DrawArrowDown(" down" + CurrentBar, false, 0, High[0]+(TickSize*dist) , Color.White);
}
}[QUOTE]
Comment