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

 
Alexandr Sokolov:

I put 100 because I thought what I needed would start at 59, but it's the same at 6.

No. Remove the dimensionality altogether. Let it be MPI[]; and check if it is the right type. Then loop from 0; < ArraySize(MPI); Plus, why take the incomprehensible 59th bar first? Start with zero or the first one. All in all there are a lot of questions. You have to experiment and check the input and output. Debugger to the rescue.

 
Alexey Viktorov:

No. Remove the dimensionality altogether. Let it be MPI[]; and type check to see if it's wrong. Then loop from 0; < ArraySize(MPI); Plus, why take the incomprehensible 59th bar first? Start with zero or the first one. All in all there are a lot of questions. You have to experiment and check the input and output. Debugger to the rescue.

Experimenting

 
Alexandr Sokolov:

Experimenting

Here's a man who has created a huge number of training examples to suit all tastes. There are multitime indicators, multisymbol indicators, and all kinds of other multitimes...

You may just use the search sometimes - after all, everything is done for you, the forum members. Look it up:

Scriptor
Scriptor
  • www.mql5.com
С возросшим интересом к рынку Форекс, люди часто спрашивают, что можно почитать о законах функционирования мировой валютной биржи. В связи с этим, выкладываю свой список литературы для начинающих. Дополнение приветствуется :) Форекс для начинающих - А. КуликовВ основу книги положен многолетний... Бесплатно скачать MetaTrader 5 Бесплатно...
 
Alexandr Sokolov:

Experimenting

Search with "MTF" in the name

For example, this:

https://www.mql5.com/ru/code/24398

 
NastyaMaley:

GlobalVariable by default can only be double

If I want a close value without a fractional part, would it be correct to write it like this:

int close = (int)GlobalVariableGet("close");
 
Taras Slobodyanik:
Thank you :)
 

Taras, you once advised me to position the price marker at the right edge of the chart through the first visible bar.

D1



Everything is working fine except the first hour on Monday - price shifts to the left and the smaller the timeframe, the stronger it is - H6


And it eventually touches the first bar

H1



Coordinates are calculated like this:

int      first_bar=(int)ChartGetInteger(0,CHART_FIRST_VISIBLE_BAR,0);
int      width_bar=(int)ChartGetInteger(0,CHART_WIDTH_IN_BARS,0);
double   label_price=iClose(_Symbol,_Period,0);

   if(width_bar>first_bar)
      {
      label_time=iTime(_Symbol,_Period,1)+(width_bar-first_bar)*PeriodSeconds();
      Print("width_bar>first_bar");
      }
   else
      {
      label_time=iTime(_Symbol,_Period,first_bar-width_bar+20);
      Print("label_time_else");
      }


ThosePeriodSeconds() values are not a universal solution, we need some correction factor, and for each TF they are different.

How to make it simpler without unnecessary crutches?

 
psyman:

Everything works fine except the first hour on Monday - price shifts left and the smaller the TF, the stronger it is - H6

And ends up hitting the first bar

int      first_bar=(int)ChartGetInteger(0,CHART_FIRST_VISIBLE_BAR,0);
int      width_bar=(int)ChartGetInteger(0,CHART_WIDTH_IN_BARS,0);
double   label_price=iClose(_Symbol,_Period,0);

   if(width_bar>first_bar)
      {
      label_time=iTime(_Symbol,_Period,1)+(width_bar-first_bar)*PeriodSeconds();
      Print("width_bar>first_bar");
      }
   else
      {
      label_time=iTime(_Symbol,_Period,first_bar-width_bar+20);
      Print("label_time_else");
      }

why 1 and not 0 ?

Of course there's a time lag because of the weekend

 
Alexey Viktorov:

No. Remove dimensionality altogether. Make it MPI[]; and check the type. Then loop from 0; < ArraySize(MPI); Plus, why start with an incomprehensible 59th bar? Start with zero or the first one. All in all there are a lot of questions. You have to experiment and check the input and output. Debugger to the rescue.

What isDebugger?


If I copy this word into MQL search engine, it will not find anything, and everything in google is in English and I will not understand what I am looking for

 
I just started working with the stock market, I understand that in the MT5 market what is above the spread is a Sell limit and what is below is a Buy limit. How can I see Buy Stop and Sell Stop?