Need help - Indicator got removed instantly

 

Hi,

I am pretty new to programming and I worked through some first tutorials and now I thought I'd try out different things and see how far I would get. I want to make some market overview in a tabular style. I borrowed some code pieces from similar projects and now I just want do it step by step (its far from finsihed as you see). So, here is the code - it compiles successfully - but when attaching to a chart in got removed instantly.

What I am thinking the program should do is just print the text "Testtext" at a certain position of screen. And from there on I would try to get on to a complete table with more complex loops.

So any help is appreciated why the indicator gets removed right after I had attached it. Thanks.


extern color Color1 = Aqua;
extern color Color2 = Yellow;
extern int Font_Size = 13;
extern string Font = "Courier";

string x_per_str[] = {"Markets", "%Change", "ADR(5)", "Todays ADR", "ADR consumed"};
string markets[] = {"EURUSD", "GBPUSD", "USDCHF", "USDJPY"};

void create_obj(string obj_name, int x_dist, int y_dist, string dbl_var, int font_size, string font, color color_)
{
ObjectCreate(obj_name,OBJ_LABEL,0,0,0,0,0);
ObjectSet(obj_name,OBJPROP_XDISTANCE,x_dist);
ObjectSet(obj_name,OBJPROP_YDISTANCE,y_dist);
ObjectSetText(obj_name,dbl_var, font_size, font, color_);
}




//---------------------------------------------------------------------
int init()
{
return(0);
}
//---------------------------------------------------------------------
int deinit()
{
ObjectsDeleteAll(0, OBJ_LABEL);
return(0);
}
//----------------------------------------------------------------------
int start()
{

//Here comes the code

int x,y;
for(x=0;x<1;x++)
for( y=0;y<9;y++)
{
create_obj("lc"+x+y, x*80+80, y*20+40, "Testtext", Font_Size, Font, Color1);
}


return(0);
}
Files:
 

Got it. This was missing:

#property indicator_chart_window