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
This will cope with resizing of the window, but it won't really solve the underlying issue.
What we need is a way to determine the number of pixels between each bar so you can resize our "Canvas" or bitmap accordingly when the timeframe is changed or the chart is resized. If we had the correct pixel sizes we could then redraw the "canvas" to cover the new daterange/timespan and leave it attached at the same date/price.
It might be a bit tricky.. but if someone has the time it might be worth the effort. (and would permit some more advanced "inline" graphics on the charts)
Circles might still be ellipses, but that would be expected when the price scale is not fixed
EDIT: On a side note, the following article (in Russian) may also be of interest: https://www.mql5.com/ru/articles/2866
I have considered that one could approximate a simple ellipse outline, using just two buffers, one for the upper hemisphere and one for the lower hemisphere, where each delta change, would represent an arc line segment as in the following example image:
EDIT: On a side note, the following article (in Russian) may also be of interest: https://www.mql5.com/ru/articles/2866
Yes that article is interesting, esp the segment where they do a graph plot using a dynamic in memory canvas/bitmap....
{
//--- create object on chart and dynamic resource
string name="Graphic";
long x=0;
long y=0;
int width=750;
int height=350;
int data[];
ArrayResize(data,width*height);
ZeroMemory(data);
ObjectCreate(0,name,OBJ_BITMAP_LABEL,0,0,0);
ResourceCreate("::"+name,data,width,height,0,0,0,COLOR_FORMAT_XRGB_NOALPHA);
ObjectSetInteger(0,name,OBJPROP_XDISTANCE,x);
ObjectSetInteger(0,name,OBJPROP_YDISTANCE,y);
ObjectSetString(0,name,OBJPROP_BMPFILE,"::"+name);
//--- create x and y array
double arr_x[]={-10,-4,-1,2,3,4,5,6,7,8};
double arr_y[]={-5,4,-10,23,17,18,-9,13,17,4};
//--- plot x and y array
GraphPlot(arr_x,arr_y,CURVE_LINES);
}