[CODE title="Уровни"]extern double Level1 = 80; // zone- mladen's laguerre
extern double Level2 = 50; // if zero - no level(zone)
extern double Level3 = 20;
extern bool ShowLevels = true;
extern color Level1Color = C'0,0,72';
extern color Level2Color = C'33,56,56';
extern color Level3Color = C'72,0,0';
extern bool BeckGr = true;
string ShortName;
ShortName =
IndicatorShortName(ShortName);
DeleteBounds();
void DeleteBounds()
{
ObjectDelete(ShortName+"-1");
ObjectDelete(ShortName+"-2");
ObjectDelete(ShortName+"-3");
}
void UpdateBounds()
{
if (Level1 > 0) SetUpBound(ShortName+"-1", 100 , Level1 , Level1Color);
if (Level2 > 0) SetUpBound(ShortName+"-2", Level2*1.01, Level2*0.99, Level2Color);
if (Level3 > 0) SetUpBound(ShortName+"-3", Level3 , 0.00, Level3Color);
}
void SetUpBound(string name, double up, double down,color theColor)
{
if (ObjectFind(name) == -1)
{
ObjectCreate(name,OBJ_RECTANGLE,WindowFind(ShortName),0,0);
ObjectSet(name,OBJPROP_PRICE1,up);
ObjectSet(name,OBJPROP_PRICE2,down);
ObjectSet(name,OBJPROP_COLOR,theColor);
ObjectSet(name,OBJPROP_BACK,BeckGr);
ObjectSet(name,OBJPROP_TIME1,iTime(NULL,0,Bars-1));
}
if (ObjectGet(name,OBJPROP_TIME2) != iTime(NULL,0,0))
ObjectSet(name,OBJPROP_TIME2, iTime(NULL,0,0));
}
[/CODE]