Simple help

 

Hello all,

I've read some the tuts on here, and attempted to create a simple indicator. What I am trying to acheive, is to create a gray rectangle that will be placed at the top right hand side of the chart, very simple. I got the rectangle on the chart, but it's not placed at the top and also, it seems to move with time rather than being static.

Can anyone help/advise me, where I have gone wrong and how to correct it.

Thankyou
Pharox




//+------------------------------------------------------------------+
//| My first attempt |
//+------------------------------------------------------------------+
#property copyright "Pharox"

#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{

ObjectCreate("rbox", OBJ_RECTANGLE,0,Time[50],Low[50],Time[0],High[0]);
ObjectSet("rbox", OBJPROP_COLOR,Gray);
ObjectSet("rbox", OBJPROP_XDISTANCE,1);
ObjectSet("rbox", OBJPROP_YDISTANCE,1);

return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
ObjectsDeleteAll();

return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
return(0);
}