Can we customize the color of lines drawn by ObjectCreate() ?

 

Lines that I create by ObjectCreate are always set on Red by default.

I wonder if we can customize the color as expected ?

Thanks for every help.

 
sonthanhthuytu:


Lines that I create by ObjectCreate are always set on Red by default.

I wonder if we can customize the color as expected ?

Thanks for every help.

Dear sonthanhthuytu,

Use your MetaEditor to get the answer. Open your MetaEditor > Navigator window Ctrl + D > dictionary tab > Object Function > ObjectSet and use OBJPROP_COLOR.

 
sonthanhthuytu:


Lines that I create by ObjectCreate are always set on Red by default.

I wonder if we can customize the color as expected ?

Thanks for every help.


Yes, read the Documentation . . . Object functions and more specifically ObjectSet() with OBJPROP_COLOR
 
or see my code (TLine/HLine)
 

For example ...

   ObjectCreate( "regress",OBJ_REGRESSION,0,Time[last],Open[last],Time[first],Open[first]);
   ObjectSet   ( "regress", OBJPROP_COLOR, Yellow);
Reason: