I am developping an indicator that draws dots, diamonds and squares in an indicator panel when certain conditions are met.
The indi runs very well with this condition:
if (MACD(12, 20, 9).Diff[0] < Nul
&& MACD(10, 15, 1)[0] < Nul
&& MACD(5, 8, 1)[0] < Nul
&& MACD(12, 20, 9).Diff[0] < MACD(12, 20, 9).Diff[1]
&& MACD(10, 15, 1)[0] < MACD(10, 15, 1)[1]
&& MACD(5, 8, 1)[0] < MACD(5, 8, 1)[1])
{
DrawDiamond("My diamond2" + CurrentBar, false, 0, 0.5, Color.Red);
}
if (MACD(12, 20, 9).Diff[0] < MACD(12, 20, 9).Diff[1]
&& MACD(10, 15, 1)[0] < MACD(10, 15, 1)[1]
&& MACD(5, 8, 1)[0] < MACD(5, 8, 1)[1]
&& Stochastics(7, 14, 3).K[0] <= P50)
{
DrawDiamond("My diamond3" + CurrentBar, false, 0, 0.7, Color.Red);
}
Where did I go wrong ?

Same with the other lines (I used the opposite statements in the //OPEN LONG section, is that part of the problem perhaps ?)
Comment