Vladimir, you wrote to service-desk, because it shouldn't be like that, and it can't be, we must be doing something wrong that we need to create under a hundred handles for a simple Expert Advisor.
Itshouldn't be like this, and it can't be, we must be doing something wrong that we need to create under a hundred handles for a simple Expert Advisor.
What's the problem? You know what an array is, don't you? A structure?
Of course, if you create 100 variables, one for each handle... ...that would be a real bummer.
Here, really a structure, but I can't figure out how to put it together quickly, can I?
struct SHandle
{
string symbol;
int handleM1;
int handleM5;
int handleM15;
};
//---- илиstruct SHandle
{
string symbol;
int timeframes[3]; // Не знаю точно, можно ли так написать, если что, через ArrayResize();
};
//---
SHandle _handles[28];
Colleagues, I'm having some trouble understanding it at all
It constantly falls outside the array array out of range. I've investigated and written so many codes that I keep getting the same mistakes. Please advise me if there is a place (a branch, an article) where I can find out how to correctly make loops that won't throw me out of the array. I lose a lot of time finding a bug ... sometimes I do not understand what I've fixed and why it works.
For example, the following code,if (q1[i] > q1[i+1]) q2[i]=1;
on q1[i+1]
in the on unit are
SetIndexBuffer(2,q1,INDICATOR_CALCULATIONS);
ArraySetAsSeries(q1,true);
intOnCalculate(constint rates_total,
constint prev_calculated,
constint begin,
constdouble &price[])
{
int sum,i,a ,start ;
if (prev_calculated ==0) { start =0 ; q1[0]=q1[1];}
else start = prev_calculated;
CopyBuffer(pulse_clear_Handle,0,start,rates_total,q1);
for (i = start ; i < rates_total;i++)
{if (q1[i] > q1[i+1]) q2[i]=1 ;
elseif (q1[i] < q1[i+1]) q2[i]=-1;
elsecontinue ;
Colleagues, I'm having some trouble understanding it at all
It constantly falls outside the array array out of range. I've investigated and written so many codes that I keep getting the same mistakes. Please advise me if there is a place (a branch, an article) where I can find out how to correctly make loops that won't throw me out of the array. I lose a lot of time finding a bug ... sometimes I do not understand what I've fixed and why it works.
For example, the following code,if (q1[i] > q1[i+1]) q2[i]=1;
Стандартная библиотека / Математика / Статистика / Вспомогательные функции / MathSum - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
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.
Whether it's handles or objects of the "Trend.mqh::CiMA" class, you still need to create them all.
How to solve the problem in my case?
How do I solve the problem in my case?
Yes, of course.
Yes. Of course.
Bummer, of course(
Vladimir, you wrote to service-desk, because it shouldn't be like that, and it can't be, we must be doing something wrong that we need to create under a hundred handles for a simple Expert Advisor.Itshouldn't be like this, and it can't be, we must be doing something wrong that we need to create under a hundred handles for a simple Expert Advisor.
What's the problem? You know what an array is, don't you? A structure?
Of course, if you create 100 variables, one for each handle... ...that would be a real bummer.
What's the problem? You know what an array is, don't you? A structure?
Of course, if you create 100 variables, one for each handle... that'd be a real bummer.
Here, a structure indeed, but I can't figure out how to make one quickly, can I?
Here, really a structure, but I can't figure out how to put it together quickly, can I?
It goes something like this...
Colleagues, I'm having some trouble understanding it at all
It constantly falls outside the array array out of range. I've investigated and written so many codes that I keep getting the same mistakes. Please advise me if there is a place (a branch, an article) where I can find out how to correctly make loops that won't throw me out of the array. I lose a lot of time finding a bug ... sometimes I do not understand what I've fixed and why it works.
For example, the following code,if (q1[i] > q1[i+1]) q2[i]=1;
on q1[i+1]
in the on unit are
SetIndexBuffer(2,q1,INDICATOR_CALCULATIONS);
ArraySetAsSeries(q1,true);
Colleagues, I'm having some trouble understanding it at all
It constantly falls outside the array array out of range. I've investigated and written so many codes that I keep getting the same mistakes. Please advise me if there is a place (a branch, an article) where I can find out how to correctly make loops that won't throw me out of the array. I lose a lot of time finding a bug ... sometimes I do not understand what I've fixed and why it works.
For example, the following code,if (q1[i] > q1[i+1]) q2[i]=1;
on q1[i+1]
on unit are
SetIndexBuffer(2,q1,INDICATOR_CALCULATIONS);
ArraySetAsSeries(q1,true);
for (i = start ; i < rates_total-1;i++)Once again, thank you!
Colleagues, MathSum function, description here
https://www.mql5.com/ru/docs/standardlibrary/mathematics/stat/mathsubfunctions/statmathsum
is not recognized in build 1643 . Do I have to tear everything down and update it?