protected override void OnBarUpdate()
{
if(MACD(12,26,9)[0] > 0 && MACD(12,26,9)[1] < 0)
{
updotbar=CurrentBar;
updot=High[0];
}
if(MACD(12,26,9)[0] > 0 && MACD(12,26,9)[1] < 0)
{
dndotbar=CurrentBar;
dndot=Low[0];
}
if (updotbar !=0 && updot !=0 && dndotbar!=0 && dndot!=0 )
{
DrawLine("MyLine1"+CurrentBar, updotbar, updot, dndotbar, dndot, Color.Blue);
DrawDiamond("MyDiamond1"+CurrentBar,true,dndotbar, dndot, Color.Red);
DrawDiamond("MyDiamond2"+CurrentBar, true,updotbar, updot, Color.Blue);
}
}
Any Idea of what I'm doing wrong will be appreciated.
Regards
Comment