Download MetaTrader 5

OBJ_BITMAP, I have problem on create this object.

To add comments, please log in or register
Jiayu Fu
1282
Jiayu Fu  

i compiled this with the aim for show the icon on the chart.

the object is created but i see nothing on the chart. Pliss Help me. sry for my bad english.

void OnInit()
  {
   IconLabel();
  }
void IconLabel(void)
   {
    string obj_icon="IconLabel1";
    ObjectCreate(0,obj_icon,OBJ_BITMAP,0,0,0);
    ObjectSetString(0,obj_icon,OBJPROP_BMPFILE,"logo.bmp");
    ObjectSetInteger(0,obj_icon,OBJPROP_XSIZE,100);
    ObjectSetInteger(0,obj_icon,OBJPROP_YSIZE,100);
    ObjectSetInteger(0,obj_icon,OBJPROP_XOFFSET,1);
    ObjectSetInteger(0,obj_icon,OBJPROP_YOFFSET,1);
    ObjectSetInteger(0,obj_icon,OBJPROP_STYLE,STYLE_SOLID);
    ObjectSetInteger(0,obj_icon,OBJPROP_WIDTH,1);
    ObjectSetInteger(0,obj_icon,OBJPROP_BACK,false);
    ObjectSetInteger(0,obj_icon,OBJPROP_SELECTABLE,true);
    ObjectSetInteger(0,obj_icon,OBJPROP_HIDDEN,false);
    ObjectSetInteger(0,obj_icon,OBJPROP_ZORDER,0);    
   }

 It hasn`t show any errors, the logo is .bmp.

Trinh Dat
38355
Trinh Dat  

about bitmap here https://www.mql5.com/en/docs/constants/objectconstants/enum_object/obj_bitmap

check file name, if file on Images folder, then code:

ObjectSetString(0,obj_icon,OBJPROP_BMPFILE,"\\Images\\logo.bmp");
Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types / OBJ_BITMAP
Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types / OBJ_BITMAP
  • www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Object Types / OBJ_BITMAP - Reference on algorithmic/automated trading language for MetaTrader 5
Jiayu Fu
1282
Jiayu Fu  
Aeither:

i compiled this with the aim for show the icon on the chart.

the object is created but i see nothing on the chart. Pliss Help me. sry for my bad english.

 It hasn`t show any errors, the logo is .bmp.

tuoitrecuoi:

about bitmap here https://www.mql5.com/en/docs/constants/objectconstants/enum_object/obj_bitmap

check file name, if file on Images folder, then code:

I checked file name and i tried also the code but i can't see the image, i also tried with differents .bmp
ObjectSetString(0,obj_icon,OBJPROP_BMPFILE,"\\Images\\logo.bmp");
Vladimir Karputov
Moderator
58577
Vladimir Karputov  
Aeither:
I checked file name and i tried also the code but i can't see the image, i also tried with differents .bmp

Нужно указывать точки привязки: время и цену.

ObjectCreate(chart_ID,name,OBJ_BITMAP,sub_window,time,price))
Jiayu Fu
1282
Jiayu Fu  
barabashkakvn:

Нужно указывать точки привязки: время и цену.

Answer in RUSSIAN hahaha. The Problem was on the time and price. Thank you a lot.
Vladimir Karputov
Moderator
58577
Vladimir Karputov  
Aeither :
Answer in RUSSIAN hahaha. The Problem was on the time and price. Thank you a lot.
Forgot to switch the language. Excuse Me.
To add comments, please log in or register