OBJ Chart

To add comments, please log in or register
Erwann Pannerec
264
Erwann Pannerec  

Hi,

Is the object OBJ_Chart can support objects inside ?

like somes lines or rectangles ?

Thanks !

Erwann.

Marco vd Heijden
Moderator
8176
Marco vd Heijden  
Yes.
Erwann Pannerec
264
Erwann Pannerec  
Marco vd Heijden:
Yes.

Hi,

Thanks for your reply.

Could you provide an exemple of code ? because when I try that didn't work :


int OnInit()

  {


   string name="test";

   int chart_ID=0;

   ObjectCreate(0,name,OBJ_CHART,0,0,0);

   ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,0); 

   ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,0); 

   ObjectSetInteger(chart_ID,name,OBJPROP_XSIZE,300); 

   ObjectSetInteger(chart_ID,name,OBJPROP_YSIZE,300); 

   ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,CORNER_LEFT_UPPER); 

   ObjectSetString(chart_ID,name,OBJPROP_SYMBOL,"EURUSD"); 

   ObjectSetInteger(chart_ID,name,OBJPROP_PERIOD,PERIOD_H1); 

   ObjectSetInteger(chart_ID,name,OBJPROP_CHART_SCALE,2); 

   ObjectSetInteger(chart_ID,name,OBJPROP_DATE_SCALE,false); 

   ObjectSetInteger(chart_ID,name,OBJPROP_PRICE_SCALE,false); 

   ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clrRed); 

   ObjectSetInteger(chart_ID,name,OBJPROP_STYLE,STYLE_SOLID); 

   ObjectSetInteger(chart_ID,name,OBJPROP_WIDTH,1); 

   ObjectSetInteger(chart_ID,name,OBJPROP_BACK,false); 

   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,true); 

   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,true); 

   ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,false); 

   ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,0); 

   


   Sleep(1000);

   // get ChartOBJ id

   first=ChartFirst();

   Print(first);

   first = ChartNext(first);

   Print(first);

   

   // try to insert Hline

   Print(ObjectCreate(first,"test",OBJ_HLINE,0,0,0));

   ObjectSetInteger(first,"test",OBJPROP_COLOR,clrRed); 

   ObjectSetInteger(first,"test",OBJPROP_STYLE,STYLE_SOLID); 

   ObjectSetInteger(first,"test",OBJPROP_WIDTH,2);


   ChartRedraw();


//---

   return(INIT_SUCCEEDED);

  }

Eleni Anna Branou
Moderator
6670
Eleni Anna Branou  

Please use the </> button to insert your code.


To add comments, please log in or register