Forum on trading, automated trading systems and testing trading strategies
How to add Bitmap to the chart
Vladimir Karputov, 2021.04.22 05:50
Include the image in the * .ex5 file using the resource.
Forum on trading, automated trading systems and testing trading strategies
How to add Bitmap to the chart
Vladimir Karputov, 2021.04.22 19:22
Read the help carefully. No need to come up with non-existent commands - use the example from the help.
//+------------------------------------------------------------------+ //| LOGO TEST.mq5 | //| Copyright 2020, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2020, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "2.00" #resource "\\Images\\MYLOGO.bmp" //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- LOGO(); //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- } //+------------------------------------------------------------------+ //| ChartEvent function | //+------------------------------------------------------------------+ void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) { //--- } //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void LOGO() { ObjectCreate(0,"LOGO",OBJ_BITMAP_LABEL,0,0,0); ObjectSetString(0,"LOGO",OBJPROP_BMPFILE,0, "::Images\\MYLOGO.bmp"); ObjectSetInteger(0,"LOGO",OBJPROP_XDISTANCE,0,36); ObjectSetInteger(0,"LOGO",OBJPROP_YDISTANCE,0,27); //--- } //+------------------------------------------------------------------+
Run:
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi, I used OBJ_BITMAP_LABEL to show an image on chart it works ok until I distributed program to my client and he said there is no image !!!
I tried ex5 on another broker on my pc and I noticed bmp files that I used are not packed with compiled file!😢
So I read document I Think maybe using Resources will do the trick.🤔
So here is my two question you professionals may help me by answering them:😘
1- Using #Resource pack bmp image along compiled program?
2. when I try to use #resource I got this error! " unsupported image format 'C:\Users\user\AppData\Roaming\MetaQuotes\Terminal\B2973C469D24\MQL5\Indicators\myind\arrdown.bmp' Panel.mqh 12 1 "
In addition, I tried 16color , 256 color , mono color and 24bit color .bmp format and i got same error
I have seen indicators that embedded image and ...
Thanks in advance.🌹❤