The Sultonov system indicator - page 25

 
Maxim Kuznetsov:

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.

Расчет коэффициентов
Расчет коэффициентов
  • 2019.02.28
  • www.mql5.com
Нужно погонать коэффициенты к 1-7 следующим образом: A1*k1+B1*k2=I1 A2*k1+B2*k2=I2 A3*k1+B3*k2+C3*k3=I3 A4*k1+B4*k2+C4*k3+D4*k4=I4 и так далее...
 

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?
 
Yousufkhodja Sultonov:

Corrected

Take a screenshot of the entire calculated table.

 
forexman77:

Take a screenshot of the entire calculated table.

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.

 
forexman77:

Take a screenshot of the entire calculated table.

Don't worry, the programme is now fully fixed.

 
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.

Yuri, do you also follow online?

 
Yousufkhodja Sultonov:

Yuri, do you also follow online?

Yes, sporadically, but I'm still convinced that it's a dummy, and the outbursts on nothing are the instability of the system itself.
 
Yousufkhodja Sultonov:

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

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_buffers 1
#property indicator_plots   1
//--- plot Soltonov
#property indicator_label1  "Soltonov"
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrMagenta
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1

//--- indicator buffers
double         SoltonovBuffer[]; // это буфер линии индикатора
double         X[];              // это вспомогательный массив для значений цены
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,SoltonovBuffer,INDICATOR_DATA);  
   ArrayResize(X,13);                      // задаем размер динамического массива X - 13
   ArraySetAsSeries(X,true);               // для удобства обучения устанавливаем индексацию массива как в таймсерии
   ArraySetAsSeries(SoltonovBuffer,true);  // для удобства обучения устанавливаем индексацию массива как в таймсерии
   ArrayInitialize(SoltonovBuffer,EMPTY_VALUE); // инициализируем буфер индикатора пустыми значениями

//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const int begin,
                const double &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);
     }
   else if(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.

I think the whole world will help you.

Files:
Soltonov.mq5  8 kb
Reason: