Cartesian Coordinates? - page 2

 
James Cater:

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

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
 
Fernando Carreiro:
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....

void OnStart()
   {
//--- 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);
   }
 
James Cater: Yes that article is interesting, esp the segment where they do a graph plot using a dynamic in memory canvas/bitmap....
We are also forgetting about the standard Chart Graphical Objects for an Ellipse and Fibonacci Arcs which can also be used depending on what is needed.
Reason: