I've code this simple Bullish/bearish Engulfing pattern but the strategy doesnt enable when addding this third Close/open instruction.
Here's my simple code:
//Engulfing pattern
//Bullish
if ( Open[1] > Close[1] && Open[0] <= Close[1] && Close[0] >= Open[1] && (ToTime(Time[0]) >= 93000 && ToTime(Time[0]) <= 155000) )
{
//Draw.ArrowUp(this, @"Bullish Engulfing" + CurrentBars[0].ToString(), true, 0, (Low[0] + (-1 * TickSize)) , Brushes.White);
}
//Bearish
else if ( Open[1] < Close[1] && Open[0] >= Close[1] && Close[0] <= Open[1] && (ToTime(Time[0]) >= 93000 && ToTime(Time[0]) <= 155000) )
{
Draw.ArrowDown(this, @"Bearish Engulfing" + CurrentBars[0].ToString(), true, 0, (High[0] + (1 * TickSize)) , Brushes.White);
}
In this code, I have 3 simple instructions (on each side) related to Open/Close and another instruction related to the time I want the strategy to be active.
If I remove 1 Open/Close instruction on each line, the strategy can be enabled without any problem (but it's no longer a complete engulfing instruction) but not with the 3 'blocks'.
I had the same problem yesterday with another code involving this OHCL problem not accepting more than 2 instructions of this type.
What's the problem here please? Is there a limitation on those OHCL instructions we cant involve more than 2 'blocks' of code in a single line?
Thanks in advance.


Comment