string txt;
bool SoundAlert = false, VisualAlert=False;
int cnt = OrdersTotal();
bool HaveSell= false, HaveBuy = false;
for(int i = 0; i < cnt; i++)
{
if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) continue;
if(Symbol()!= OrderSymbol()) continue;
if(OrderType() == OP_BUY) HaveBuy = True;
if(OrderType() == OP_SELL) HaveSell = True;
}
if (uitog1 > 50 && uitog2 > 50 && uitog3 > 50)
{txt = "Неплохой момент для открытия позиции BUY";if (HaveSell == True) {SoundAlert = true;VisualAlert = true;} }
else
{txt = "Не рекомендуется открывать позизии. ЖДИТЕ.";}
if (ditog1 > 50 && ditog2 > 50 && ditog3 > 50)
{txt = "Неплохой момент для открытия позиции SELL"; if (HaveBuy == True) {SoundAlert = true;VisualAlert = true;} }
if (uitog1 >= 75 && uitog2 >= 75 && uitog3 >= 75)
{txt = "УДАЧНЫЙ момент для открытия позиции BUY"; SoundAlert = true; if (HaveSell == True) VisualAlert = true;}
if (ditog1 >= 75 && ditog2 >= 75 && ditog3 >= 75)
{txt = "УДАЧНЫЙ момент для открытия позиции SELL";SoundAlert = true; if (HaveBuy == True) VisualAlert = true;}
if (SoundAlert == true) PlaySound("alert.wav");
if (VisualAlert == true) Alert("Не пора бы зафиксировать прибыль по открытым позициям? ;)");
ObjectCreate("txt", OBJ_LABEL, WindowFind(short_name), 0, 0);
В общем изменения такие сделал -делайте замечания...
Вставлять догадаетесь сами куда - первая и последняя строчка
как в оригинале (искать в самом конце...