Questions from a "dummy" - page 131

 
GameOver:


forum searches(searching mql5 help for the phrases day_of_week, dayofweek didn't yield anything... )

MQL5 Reference / Standard constants, enumerations and structures / Data structures / Date structure:

  int day_of_week;    // день недели (0-воскресенье, 1-понедельник, ... ,6-суббота)
 
Yedelkin:

Let's try to figure it out. For the CopyRates() function the penultimate parameter

I.e. number of elements to be copied. In your design the number of elements is Unlimited. Roughly speaking, unreal :) And probably, this is what happens during work, constantly redistributing memory, until it is not exhausted. Try to use not TerminalInfoInteger(TERMINAL_MAXBARS), but a more specific value:MQL5 Reference / Access to timeseries and indicators / Bars

Ok, thanks!
I still do not know why I need it, thisTerminalInfoInteger(TERMINAL_MAXBARS);

...to be! ? :-))

What to replace mql4 functions with? Help doesn't even give you a hint where to dig.
Of course, if you know the language by heart - it's easy to find it in the Reference book - then you don't need the Reference book.
But if you don't know it by heart - and/or you switch from mql4 - searching in the reference book is of little help ((

sss. it's harder to get into mql5 than it was from 3 to 4 ;-) no matter who says what.

 
GameOver:

OK, thanks!
It remains unclear why I need this TerminalInfoInteger(TERMINAL_MAXBARS);

..to be! ? :-))

This is, for example, to know to what depth the indicator buffers are calculated. And, to understand if resources are overused because of "uneconomical" program or because of excessive TERMINAL_MAXBARS value. Since TERMINAL_MAXBARS changes only manually for now, you can control its size and, if necessary, inform outside users of your program to lower the bar.

GameOver:


How can I replace mql4 functions? Help doesn't even give you a hint where to look.
Of course, if you know the language by heart, it's easy to find it in the Reference.
But if you don't know it by heart - and/or you switch from mql4 - searching in the reference book is of little help ((

I found it using the search word "day_of_week", actually. Among the 7 links is the one above.

GameOver:


sss. it's harder to get into mql5 than it was from 3 to 4 ;-) no matter who says what.

Can't say anything here.

 
Yedelkin:

This is, for example, to know to what depth the indicator buffers are calculated. And, to understand if resources are being overspent because of "wasteful" program or because TERMINAL_MAXBARS is set too high. Since TERMINAL_MAXBARS changes only manually for now, you can control its size and, if necessary, inform outside users of your program to lower the bar.

I found it using the search word "day_of_week", actually. Among the 7 links is the one above.

Can't say anything here.

I see. i.e. one is the number of bars uploaded, the other is the number of bars displayed. the only strange thing is why the identification is so different - one is straightforward and simple Bars,
the other one through the middle of nowhere.

i didn't have enough patience to look through them all, especially as i couldn't find anything about dayOfWeek function itself, while the first links day_of_week (how could i guess it should be written like this?) was an irrelevant nonsense :-)

i have another question, if you allow me.

i can't figure out how to draw indicators. all of them have different descriptions, lots of code, no light.

i want to draw shadows from the upper and lower shadows, plus my own method of smoothing.
but at least I want to implement the standard ones myself.
i can't figure out how to do it. i think it's easy, but abstractions make me bored with mql4 :-)))
maybe someone will do it with explanations?

#property indicator_chart_window
#property indicator_buffers 1 
#property indicator_plots   1
#property indicator_type1   DRAW_LINE
#property indicator_color1  Red

input int iPeriod = 13; // период
input int iMode = 1; // тип сглаживания
input int iPrice = 5; // цена
input int iBars = 480; // количество баров для просчета, если это возможно в принципе ограничить

double iBuffer[]; 

void OnInit(){
   SetIndexBuffer(0, iBuffer, INDICATOR_DATA);
}

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[])
{

//---- проверка количества баров на достаточность для расчёта
   if (rates_total < 2*iPeriod) return(0);

// ????? :-)

   return(rates_total);
}

double calcPrice(int type){
switch (type){
case 1: return(high); ??
case 1: return(high - fmax(open,close)); ??????
}

the beginning is clear )))) but what about the rest .....

thanks in advance.

 

Good day!

Could you please advise whether there are brokers in Russia who offer Metatrader as a terminal for working on the FORTS and MICEX?

 
GameOver:

i have another question, if i may.

i have no idea how to draw indicators. all of them have different descriptions, a lot of code is connected, i can't see any light.

to learn i want to make ma from upper and lower shadows, plus my own method of smoothing calculation.
But first i want to implement the standard ones.
how? it's so easy, but abstractions make me bored with mql4 :-)))
can someone explain it?

the beginning is clear )))) but what's next.....

thanks in advance.

If you like to dig in the code, the best way is to open Navigator => Indicators => Examples folder in the editor. Then you can find the codes of working indicators (ParabolicSAR, Custom Moving Average etc), written without using include files. After you have worked through a few of them, many things will become clear. The rest will be explained on the forum. Many people are too lazy to write other people's indicators.
 
Yedelkin:
If you like to dig through the code, the best way to do it is as follows: in the editor, open Navigator => Indicators folder => Examples folder. Then you can find the codes of working indicators (ParabolicSAR, Custom Moving Average, etc.), written without using include files. After you have worked through a few of them, many things will become clear. The rest will be explained on the forum. Many traders are too lazy to write other people's indicators.

But I do). IF the code is intuitive... I look at mountains of code - it's not clear yet ((
i can give you advice like "open an example and fuck around with it till you get bored" ))))) but i didn't ask for advice, i asked for help...

i will try to clarify questions. for example, about two indicator forms.
the first form has 4 parameters. i want to clarify its purpose. why is it present in the first form and not in the second?
what is the essence of "where significant data comes from", what is the physical meaning of this parameter that we make it so global ?
also a question about the array for calculation - the list is set on the tab parameters, and as i understand, it is only for the first form and this list is unchangeable? or is it possible to add your arrays (in the context of the above problem - for example, an array of average shadows)? (how?)

not everything is clear for the second form, i.e. there seem to be more possibilities.
we can useENUM_APPLIED_PRICE in setting the data. on the other hand, there is no selection of the previous indicator data (like in the first form). how?
once again - how to set one's own data?

   double newData[];
   double outBuffer[];

   for(i=limit;i<rates_total && !IsStopped();i++){
      newData[i]=(High[i]+fmax(Open[i],Close[i]))/2;
   }
// и дальше чего? как мне индикатор то заполнить используя iMA ? самому сглаживать вторым циклом? или что?
   outBuffer=????????????


i don't understand ( all examples are based on standard data... i still don't know how to make my own data ((
on the one hand - iMA() handle is prepared in onInit, but data for it have not been defined yet, they are defined in onCalculate...
i got confused (
please explain, who understands.
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы - Документация по MQL5
 
GameOver:

I can give advice like "open an example and fuck with it until you get bored" myself ))))) but I wasn't asking for advice, I was asking for help...

In this case, I just shared my experience. It turns out you like to dig in the code less than I do :) Oh, well.

GameOver:

for example, about two forms of the indicator.
why is it present in the first form, and not in the second? it means it's not necessary?
what is the essence of "where significant data comes from", what is the physical meaning of this parameter that we make it so global ?

Look here (I found it using the keyword begin - use the search engine): MQL5 Reference / Custom Indicators

GameOver:


also a question about the array for calculation - the list is set on the tab parameters, and as i understand, it is only for the first form and this list is unchangeable? or is it possible to add your arrays (in the context of the above problem - for example, an array of average shadows)? (how?)

For a start, see MQL5 Reference / Language Basics / Variables / Input variables

As for the global approach to studying: if no answers to your questions are given here, and digging in the code is not that interesting, you can type "beginners" in the search engine of the website, choose the "Articles" section and look through the "Beginners" articles on indicators. I understand, it seems like a hassle. But after looking through a couple of appropriate articles, you will first be able to draw a simple line, then a line of average values between highs and lows of a bar [(high[i]-low[i]/2)], then you can build an elementary MA, and finally, you will come to realization of your idea.

Переход на новые рельсы: пользовательские индикаторы в MQL5
Переход на новые рельсы: пользовательские индикаторы в MQL5
  • 2009.11.23
  • Андрей
  • www.mql5.com
Я не буду перечислять все новые возможности и особенности нового терминала и языка. Их действительно много, и некоторые новинки вполне достойны освещения в отдельной статье. Вы не увидите здесь кода, написанного по принципам объектно-ориентированного программирования — это слишком серьезная тема для того, чтобы просто быть упомянутой в контексте как дополнительная вкусность для кодописателей. В этой статье остановимся подробней на индикаторах, их строении, отображении, видах, а также особенностях их написания по сравнению с MQL4.
 
Yedelkin:

In this case, I was just sharing my experience. It turns out that you are less fond of digging into code than I am :) But never mind.

Look here (I found it using the keyword begin - use the search engine): MQL5 Reference Guide / Custom Indicators

For a start, see MQL5 Reference / Language Basics / Variables / Input variables
1. Not that I like them any less. MQL5 Reference Guide and MQL5 Variables / Input Variables 1. Not that I like it any less... Although I don't know how much you like it - I prefer trading in the first place. is it really worth the effort?
That's why I'm asking those who are monsters at it to write an example.
That's why I ask those who are monsters in it to write an example.

2. I've looked it up. I don't understand why it's not used in the second form (or rather, why is it used in the first form?),
why would i need to include it in the input parameters of the first form? why is it different from an arbitrary variable?

3. i looked it up. i asked how to implement a calculation on my data, not how to set a list of input parameters. not a word about it ((((
 
GameOver:
But on the forums everyone arrogantly states that OOP is easy.

No one has ever claimed such a thing. It's going to take some work.

GameOver:

2. looked at it. didn't understand why it's not used in second form (or rather why it's used in first form?). it's user defined anyway (it's not defined in tab, right?),
why should it be put in input parameters in the first form? how is it different from an arbitrary variable?

Well, I don't know. It all made sense to me from the example there.

GameOver:
3. looked it up. I asked how to implement the calculation on my data, not how to set a list of input parameters. not a word about it ((((

The question was "how do I set my data?". I pointed out one way.

If you are interested in calculation based on the data of another indicator, you can do it in the following way. First, we create the new indicator with its own method of data calculation, and then we take the handle of this indicator(MQL5 Reference / Technical Indicators / iCustom) and use the handle in the new indicator. Look carefully at the example. If you have any questions about the example

Документация по MQL5: Технические индикаторы
Документация по MQL5: Технические индикаторы
  • www.mql5.com
Технические индикаторы - Документация по MQL5
Reason: