Answer the question
In order to leave comments, you need to log in
Where can I find or how to make a ruler, percentage scale indicator for MT4?
Good afternoon. I needed a very simple indicator of a ruler or a percentage scale for metatrader 4. It is necessary that next to the prices on the chart a rectangle or a line be shown in the entire length of the trading chart. The line is drawn from 0 to 100% in both directions. those. from bottom to top from 0-100% and from top to bottom from 0-100%. Maybe someone has met a similar indicator or can tell you how to make it yourself?
Answer the question
In order to leave comments, you need to log in
This is how the percentage is calculated on a vertical scale, a price scale
int InpPrice1=95;//%
//--- размер массива price
int accuracy=1000;
//--- массив для хранения значений цен, которые будут использованы
//--- для установки и изменения координаты точки привязки линии
double price[];
//--- выделение памяти
ArrayResize(price,accuracy);
//--- заполним массив цен
//--- найдем максимальное и минимальное значение графика
double max_price=ChartGetDouble(0,CHART_PRICE_MAX);
double min_price=ChartGetDouble(0,CHART_PRICE_MIN);
//--- определим шаг изменения цены и заполним массив
double step=(max_price-min_price)/accuracy;
for(int i=0;i<accuracy;i++)
price[i]=min_price+i*step;
//--- определим точки для рисования линии
int p=InpPrice*(accuracy-1)/100;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question