Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 793

 
ponochka:
Onitit and ontick have been added! No change

you can get in trouble for ontick requests ;-) that is, get banned and blacklisted

Print diagnostics at return(false) - it will be clearer what's wrong.

 
Maxim Kuznetsov:

You can get in trouble for OnTick requests ;-) that is, get into bans and blacklists.

Print the diagnostics for return(false) - it will make it clearer what is wrong.

What should I write in Print to figure out what's wrong? 0_o

if you write Print(response); it gives out: 13369448

 
ponochka:

What should I write in Print to figure out what's wrong? 0_o

if you write Print(response); it gives out: 13369448

if (response == 0) {

   Print("Что-то пошло не так");

  // потом уже добавите диагностику из WinAPI

   return false;

}

and before the normal return, print the result too

Print(" всё хорошо, результат:" toStr);

return toStr;

and run the whole code in a timer, e.g. once a minute. Practice on a resource that is sure not to get banned and gives different but predictable times, so you can check.

----
telepathically - if there really is a problem,
either the initialization is wrong (I don't remember if WinSOCK should be initialized for InternetOpenW or not)
Or some resource is not being freed.

 
Artyom Trishkin:

Examine the contents of the Include folder

So it's all there? I opened it up and looked at the calculations, which are quite complicated for me.

 
Seric29:

So it's all there? I opened it up and looked at the calculations, which are quite complicated for me.

I would like to do better :)

Forum for trading, automated trading systems & strategy testing

Any questions from newbies on MQL4, help and discussion on algorithms and codes

Seric29, 2019.03.26 23:32

How can I see the source code/libraries of the functions that come with MQL4? I'd like to look at their properties and make similar or better, who knows what on this subject?

 
How can I use ArrayResize to change the size of a multidimensional array? Just standard examples on one-dimensional arrays only
 
Alexandr Sokolov:
How can I use ArrayResize to change the size of a multidimensional array? It's just that the standard examples only use one-dimensional arrays.

You can only change the size of the first dimension of a multidimensional array. This is exactly the same as for a one-dimensional array.

The array must be dynamic in this case.

 
Artyom Trishkin:

You can only change the size of the first dimension of a multidimensional array. It's exactly the same as for a one-dimensional array.

The array must be dynamic in this case.

Thank you!

 

Good day to you all!

I wasted two hours, but could not find anything.

Please tell me how in mq4, in the EA, intelligently

build one indicator on another using built-in functions

and it should be displayed in tests in the subwindow as it should be,

for example MA on RSI data?

 
Northwest:

e.g. MA on RSI data ?

#property copyright "IgorM"
#property link      "https://www.mql5.com/ru/users/igorm"
#property version   "1.00"
#property strict
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_plots   2
//--- plot line1
#property indicator_label1  "RSI"
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrRed
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1

#property indicator_label2  "MA"
#property indicator_type2   DRAW_LINE
#property indicator_color2  clrYellow
#property indicator_style2  STYLE_SOLID
#property indicator_width2  1
//--- input parameters
input int      PeriodRSI   =  10;
input int      PeriodMA    =  12;
//--- indicator buffers
double         rsiBuffer[],maBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,rsiBuffer);
   SetIndexBuffer(1,maBuffer);
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
   int i,limit;
   if(prev_calculated==0) limit=rates_total-1; else limit=rates_total-prev_calculated+1;
   for(i=limit; i>=0; i--)
     {
      rsiBuffer[i]=iRSI(NULL,0,PeriodRSI,PRICE_CLOSE,i);
     }
   for(i=limit; i>=0; i--)
     {
      maBuffer[i]=iMAOnArray(rsiBuffer,0,PeriodMA,0,MODE_SMA,i);
     }
  
   return(rates_total);
  }
//+------------------------------------------------------------------+
Reason: