Traders work with Excel. It is like "litmus paper". If he's not familiar with spreadsheets, what the hell kind of trader is he? How does he calculate budgets and money?
And if the programmer is not able to translate an excel sheet into an MQL program, he should still practice :-)
Yusuf is trying to make his points (even with the reasoning of which I disagree in principle), but you are doing an even worse thing - instead of basic help you are forcing him to learn unnecessary things. And at the same time, everyone knows that he will not start programming and will not transfer his formulas to mql. You just mock and take months or even years away from a person.
Hm, yes, I can not imagine how to write directly to an excel sheet - it's sitting by myself and untangle the tangle - the tables are very intricately intertwined - so it will have to spend time to figure it out, and to evaluate the work should also according to TOR.
In addition, again from my experience, when I rewrote the algorithm from Excel, I found logical errors, because I additionally thought about what I was writing - it's often convenient to fantasize in Excel.
And, besides, I recommend attaching the file itself.
So I consider your arguments about forcing learning unnecessary to be unfounded and unsubstantiated.
If you have the skills, why not pick up and help the person by telepathically reading the TOR from his head at a distance?
I'm tired of solving puzzles. Make like I did a screenshot on the first page with explanations https://www.mql5.com/ru/forum/305148. To make the information more digestible, make the calculation on a shallow story, the less the better (it will be much easier to understand you). If you want help, compress your rolls of text, no one will read a big text, much less understand it.
Preferably a zip of the Excel file and ask questions about it. Otherwise this will go on forever. You'll end up torturing Yusuf. Well, he can't do that.
Yuriy Asaulenko: You'd better zip the excel file and ask questions about it. Otherwise this will go on forever. You'll end up torturing Yusuf. Well, he can't do that.
Well persuaded, post a screenshot yourself, contribute to the development. I'll take a look tomorrow.
What kind of answer you get will be the same as a greeting. If you don't have clear information, you won't get any results.
Yuriy Asaulenko: It's better to zip the Excel file and ask questions about it. Otherwise this will go on forever. You'll end up torturing Yusuf. Well, he can't do that.
This dummy is a simple MA indicator for example, but it is tailored to your case with some simplifications that are not optimal in terms of performance, but less stressful for learning.
In order to write your indicator, you simply write the calculation code in the function body
void Soltonov(int pos) // основной расчет индикатора бара pos. В массиве X, размерностью 13 находятся значение цены 13 бар, начиная от позиции pos
at the moment there is a calculation of MA with period 13 in the form of 3 lines.
Why did I take 13 by default? Because you said yourself that you use 13 price values for calculation at the moment.
These 13 values are located in an array X (X[0] to X[12])
You simply perform the calculation of these 13 values in the body of this function and write the value into the indicator buffer SoltonovBuffer[pos]. The whole indicator will be formed automatically.
//+------------------------------------------------------------------+//| Soltunov.mq5 |//| Copyright 2018, MetaQuotes Software Corp. |//| https://www.mql5.com |//+------------------------------------------------------------------+#property copyright"Copyright 2018, MetaQuotes Software Corp."#property link"https://www.mql5.com/ru/users/yosuf"#property version"1.00"#property indicator_chart_window#property indicator_buffers1#property indicator_plots1//--- plot Soltonov#property indicator_label1"Soltonov"#property indicator_type1DRAW_LINE#property indicator_color1clrMagenta#property indicator_style1STYLE_SOLID#property indicator_width11//--- indicator buffersdouble SoltonovBuffer[]; // это буфер линии индикатораdouble X[]; // это вспомогательный массив для значений цены//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+intOnInit()
{
//--- indicator buffers mappingSetIndexBuffer(0,SoltonovBuffer,INDICATOR_DATA);
ArrayResize(X,13); // задаем размер динамического массива X - 13ArraySetAsSeries(X,true); // для удобства обучения устанавливаем индексацию массива как в таймсерииArraySetAsSeries(SoltonovBuffer,true); // для удобства обучения устанавливаем индексацию массива как в таймсерииArrayInitialize(SoltonovBuffer,EMPTY_VALUE); // инициализируем буфер индикатора пустыми значениями//---return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+//| Custom indicator iteration function |//+------------------------------------------------------------------+intOnCalculate(constint rates_total,
constint prev_calculated,
constint begin,
constdouble &price[])
{
int N=rates_total-prev_calculated;
if(N>1 && rates_total>12) // если осуществляем первый вход или была задержка больше времени одного бара, выполняем инициализацию всех баров
{
for(int i=rates_total-1; i>11; i--)
{
ArrayCopy(X,price,0,i-12,13);
Soltonov(rates_total-1-i);
}
ArrayCopy(X,price,0,rates_total-13,13);
return(rates_total);
}
elseif(N==1) ArrayCopy(X,price,0,rates_total-13,13); // если новый барelse X[0]=price[rates_total-1]; // если новый тик без образования нового бара
Soltonov(0);
return(rates_total);
}
//+------------------------------------------------------------------+// Писать код в этой функции!//+------------------------------------------------------------------+void Soltonov(int pos) // основной расчет индикатора бара pos. В массиве X, размерностью 13 находятся значение цены 13 бар, начиная от позиции pos// X[0]- значение цены бара с номером pos// X[1]- значение цены бара с номером pos+1// ....// X[12]- значение цены бара с номером pos+12
{
double Sum=0; // создаем переменную для подсчета суммы баровfor(int i=0;i<13;i++) Sum = Sum+X[i]; // суммируем 13 баров
SoltonovBuffer[pos]=Sum/13; // помещаем в значение индикаторного буфера среднее арифметическое 13 цен
}
//+------------------------------------------------------------------+
From MT5 you press F4 and get to ME (MetaEditor). Here you create a custom indicator (Ctrl+N), specify a name during creation, for example"Soltunov" (mine is the default one). When the code is generated, replace all this code with my dummy.
And start mastering the programming.
I advise you to pre-set the maximum bar in the window in the MT5 settings to not very large (5000 is quite enough).
You do not need to read any books to master the MQL5 language. It is enough to use Help by pressing the F1 key, first clicking on the function or word of interest. Also use the search function in Help.
see the animated gif (click on the picture):
I also strongly recommend to immediately master ME's built-in debugger with interrupt point settings to step through the program with the ability to observe variable changes.
Also see the animated gif.
Good luck, Yusuf! If you have any questions, if the rule of thumb method is not helpful, don't hesitate to ask.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Traders work with Excel. It is like "litmus paper". If he's not familiar with spreadsheets, what the hell kind of trader is he? How does he calculate budgets and money?
And if the programmer is not able to translate an excel sheet into an MQL program, he should still practice :-)
Yusuf is trying to make his points (even with the reasoning of which I disagree in principle), but you are doing an even worse thing - instead of basic help you are forcing him to learn unnecessary things. And at the same time, everyone knows that he will not start programming and will not transfer his formulas to mql. You just mock and take months or even years away from a person.
Hm, yes, I can not imagine how to write directly to an excel sheet - it's sitting by myself and untangle the tangle - the tables are very intricately intertwined - so it will have to spend time to figure it out, and to evaluate the work should also according to TOR.
In addition, again from my experience, when I rewrote the algorithm from Excel, I found logical errors, because I additionally thought about what I was writing - it's often convenient to fantasize in Excel.
And, besides, I recommend attaching the file itself.
So I consider your arguments about forcing learning unnecessary to be unfounded and unsubstantiated.
If you have the skills, why not pick up and help the person by telepathically reading the TOR from his head at a distance?
I'm tired of solving puzzles. Make like I did a screenshot on the first page with explanations https://www.mql5.com/ru/forum/305148. To make the information more digestible, make the calculation on a shallow story, the less the better (it will be much easier to understand you). If you want help, compress your rolls of text, no one will read a big text, much less understand it.
The first values of the shifted series are as follows:
1.1376 1.1377 1.1375 1.1361 1.1358
as you have it:
x1 x2 x3 x4 y
1.1376 1.1376 1.1377 1.1375 1.1361
So x1 and x2 are the same row? What happened to CD5, which starts at1.1358?Corrected
Take a screenshot of the entire calculated table.
Take a screenshot of the entire calculated table.
You'd better zip the excel file and ask questions about it. Otherwise this will go on forever. You'll end up torturing Yusuf. Well, he can't do that.
Well persuaded, post a screenshot yourself, contribute to the development. I'll take a look tomorrow.
What kind of answer you get will be the same as a greeting. If you don't have clear information, you won't get any results.
Take a screenshot of the entire calculated table.
Don't worry, the programme is now fully fixed.
It's better to zip the Excel file and ask questions about it. Otherwise this will go on forever. You'll end up torturing Yusuf. Well, he can't do that.
Yuri, do you also follow online?
Yuri, do you also follow online?
So here is the dummy indicator.
This dummy is a simple MA indicator for example, but it is tailored to your case with some simplifications that are not optimal in terms of performance, but less stressful for learning.
In order to write your indicator, you simply write the calculation code in the function body
at the moment there is a calculation of MA with period 13 in the form of 3 lines.
Why did I take 13 by default? Because you said yourself that you use 13 price values for calculation at the moment.
These 13 values are located in an array X (X[0] to X[12])
You simply perform the calculation of these 13 values in the body of this function and write the value into the indicator buffer SoltonovBuffer[pos]. The whole indicator will be formed automatically.
From MT5 you press F4 and get to ME (MetaEditor). Here you create a custom indicator (Ctrl+N), specify a name during creation, for example"Soltunov" (mine is the default one). When the code is generated, replace all this code with my dummy.
And start mastering the programming.
I advise you to pre-set the maximum bar in the window in the MT5 settings to not very large (5000 is quite enough).
You do not need to read any books to master the MQL5 language. It is enough to use Help by pressing the F1 key, first clicking on the function or word of interest. Also use the search function in Help.
see the animated gif (click on the picture):
I also strongly recommend to immediately master ME's built-in debugger with interrupt point settings to step through the program with the ability to observe variable changes.
Also see the animated gif.
Good luck, Yusuf!
If you have any questions, if the rule of thumb method is not helpful, don't hesitate to ask.
I think the whole world will help you.