Discussion of article "Visualize this! MQL5 graphics library similar to 'plot' of R language" - page 2

 
-Aleks-:

Is it possible to make two or more scales on the graph - similar to a ruler, where the divisions are given as centimetres and inches, with the values only given if the point was used to plot the graph?

It will be quite easy to add a new markup in the context of your task using the MarksToAxisAdd method.

#include <Graphics\Graphic.mqh>
//+------------------------------------------------------------------+
//| Script programme start function|
//+------------------------------------------------------------------+
void OnStart()
  {
   double x[]={-11,-11,11,11};
   double y[]={-10,10,-10,10};
//--- graphic
   CGraphic graph;
   graph.HistoryNameWidth(80);
   graph.Create(0,"Graph",0,30,30,830,430);
//--- Points
   CCurve *curve=graph.CurveAdd(x,y,CURVE_LINES);
   graph.CurvePlot(0);
//--- add marks to X-axis
   graph.MarksToAxisAdd(x,8,MARK_INTERNAL,0);
   graph.Update();
   Sleep(1000);
  }‌

P.S. Keep in mind that the MarksToAxisAdd method does not create new objects. I.e. when redrawing the chart using the Redraw method, this markup will be lost.

P.P.S. If you need not only to add new serifs, but also to sign them, it is a more complicated task. It will be necessary to write each serif manually using the TextAdd method.

 
Roman Konopelko:

Adding a new markup in the context of your task will be quite easy using the MarksToAxisAdd method.

#include <Graphics\Graphic.mqh>
//+------------------------------------------------------------------+
//| Script programme start function|
//+------------------------------------------------------------------+
void OnStart()
  {
   double x[]={-11,-11,11,11};
   double y[]={-10,10,-10,10};
//--- graphic
   CGraphic graph;
   graph.HistoryNameWidth(80);
   graph.Create(0,"Graph",0,30,30,830,430);
//--- Points
   CCurve *curve=graph.CurveAdd(x,y,CURVE_LINES);
   graph.CurvePlot(0);
//--- add marks to X-axis
   graph.MarksToAxisAdd(x,8,MARK_INTERNAL,0);
   graph.Update();
   Sleep(1000);
  }‌

P.S. Please note that the MarksToAxisAdd method does not create new objects. I.e. when redrawing the chart using the Redraw method, this markup will be lost.

P.P.S. If you need not only to add new serifs, but also to sign them, it is a more complicated task. It will be necessary to write each serif manually using the TextAdd method.

Thanks for the answer.

It is necessary that the notches were parallel - the goal is to see two values of one point - so we need signatures of points. Are there no plans to make the work with the chart as with the chart - i.e. when pointing in the navigation window to get the chart values by scales?

 
-Aleks-:

Thanks for the answer.

I need the notches to be parallel - the goal is to see two values of one point - so I need the signatures of the points. Are you planning to work with a chart like with a chart - i.e. when pointing in the navigation window, get chart values by scales?

As a part of the Graphics library this functionality is not planned yet. But in the same topic about Graphics library I have already met a custom implementation of the functionality you are talking about).

 
Roman Konopelko:

This functionality was not planned as part of the Graphics library. But in the same Graphics library thread I have already seen a custom implementation of the functionality you are talking about).

Thanks for the link. It's a pity it's not planned - I think it's extremely useful for real work with graphics.

I have a question that you probably know the answer to, as you have spent a lot of time working with charts, and I am afraid that I have invented a bicycle again - is there such a method of plotting a chart as superimposing multilayer data pies in the form of a matrix on each other? Humanly (in physical execution) it looks like this - we take a glass - differentiate it into cells, in each cell dependent index x from y, make normalisation of indicators, and paint depending on the indicator of cells on the glass with a gradient of one colour, then the next indicator with the same matrix, but with other values, also normalise and paint, but with another veet. The result of the analysis will be a palette, which turned out - it is assumed that by the shade of the colour and its ability to transmit light, you can identify patterns of influence of one indicator on another. (if anything, this is my know-how :)) There is something similar in terminal, but there is a graph on extremes, which is not the same, but maybe it inspired my idea.

 
-Aleks-:

Thanks for the link. It is a pity that it is not planned - I think it is extremely useful for real work with graphs.

I have such a question, to which you probably know the answer, as you have spent a lot of time working with charts, and I am afraid that I have invented a bicycle again - is there such a method of building a chart as superimposing multilayer pies of data in the form of a matrix on each other? Humanly (in physical execution) it looks like this - we take a glass - differentiate it into cells, in each cell dependent index x from y, make normalisation of indicators, and paint depending on the indicator of cells on the glass with a gradient of one colour, then the next indicator with the same matrix, but with other values, also normalise and paint, but with a different veet. The result of the analysis will be a palette, which turned out - it is assumed that by the shade of the colour and its ability to transmit light, you can identify patterns of influence of one indicator on another. (if anything, this is my know-how :)) There is something similar in Terminal, but it graphs by extremes, which is not the same thing at all, but it may have inspired my idea.

I probably misunderstood you, but what you are describing to me is most associated with classical clustering methods from machine learning. Especially it looks like something like Kohonen maps.
 
Roman Konopelko:
I probably misunderstood you, but what you are describing to me is most associated with classical clustering methods from machine learning. In particular, it looks like something like Kohonen maps.

Kohonen maps are not exactly like that, it's a different principle... I was just thinking that this approach would help machine learning... Anyway, either I'm thinking in the right direction or it's not there yet and needs to be done to evaluate. Thanks.

 
small request, if not difficult, can you add the possibility to draw candlesticks or bars on OHLC? I like these canvases very much, I would like to be able to build full-fledged charts on them
 
Maxim Dmitrievsky:
small request, if not difficult, can you add the possibility to draw candlesticks or bars on OHLC? I really like these canvases, I would like to be able to plot full-fledged charts on them
Maybe you just need DRAW_COLOR_CANDLES?
 
Rashid Umarov:
Maybe you just need DRAW_COLOR_CANDLES?


No, just that without indicators you could display an additional chart with information on distributions (no problems with that), and it would be nice to be able to display a piece of chart from another TF, say, or other information in the form of bars, through the same graph library. It is just convenient and quick to work with it, of course, you can output all 4 types of prices with lines, but it doesn't look good.

 
Maxim Dmitrievsky:


No, exactly that without indicators it would be possible to display an additional chart with information on distributions (there are no problems with this), and it would be nice to be able to display a piece of chart from another TF, say, or other information in the form of bars, through the same graph library. It is just convenient and quick to work with it, you can of course lines to display all 4 types of prices, but it does not look ace.

Good afternoon!

CustomPlotFunction mode is implemented in the library for similar purposes, the example of using it implements approximately what you are interested in.

P.S. More details about it are written in forum .