//+------------------------------------------------------------------+ //| CosmoGround.mq5 | //| Copyright 2012, expforex. | //| http://www.expforex.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2012, expforex." #property link "http://www.expforex.com" #property version "1.00" #property indicator_chart_window input int CountStars=1000; // Number of stars //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { ObjectsDelete(); ChartRedraw(); EventKillTimer(); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void ObjectsDelete() { for(int i=ObjectsTotal(0);i>=0;i--) { if(StringFind(ObjectName(0,i),"Stars")!=-1)ObjectDelete(0,ObjectName(0,i)); } } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int OnInit() { //--- indicator buffers mapping MathSrand(GetTickCount()); StarsCreate(); EventSetTimer(1); return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void StarsActivateLight() { int Size; string name=MathRand()%CountStars; Comment(name); Size=ObjectGetInteger(0,"Stars"+name,OBJPROP_FONTSIZE); int u=MathRand()%2; if(u==1)ObjectSetInteger(0,"Stars"+name,OBJPROP_FONTSIZE,Size+1); else if(u==0)ObjectSetInteger(0,"Stars"+name,OBJPROP_FONTSIZE,Size-1); ChartRedraw(); int Y=ObjectGetInteger(0,"Stars"+name,OBJPROP_YDISTANCE); for(int r=Y;r