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

 
The solution was to write the first ticket in the job to a variable and subtract it when specifying the index
 

Hello! I don't have enough knowledge of my own. Can you tell me please. How to find the bar index on which the Awesome Oscillator(AO) indicator last crossed the zero level.

 
Andrey Sokolov:
The solution was to write the first ticket in the job to a variable and subtract it when specifying the index

It's not like the tickets are in a row in one EA.

 
Andrey Bobukh:

Hello! I don't have enough knowledge of my own. Can you tell me please. How to find the bar index on which the Awesome Oscillator(AO) indicator last crossed the zero level.

In the function, in the loop from the first bar (not zero) go deep into the history and look for the first crossing. Once found, you return the loop index from the function - the index of the loop will be the index of the bar where the crossover was found.

 

Can you tell me how to calculate the maximum lot to open in MT4?

I calculate it this way:

      double margin_per_lot=MarketInfo(symbol,MODE_MARGINREQUIRED);
      double free_margin=AccountInfoDouble(ACCOUNT_MARGIN_FREE);
      Print(__FUNCTION__+": margin for lot: ",margin_per_lot,", free margin: ",free_margin);
      m_volume=NormalizeDouble((free_margin*m_amount/100)/margin_per_lot,2);


I get a value I can't open. I have to decrease lot size.

The m_amount here is 100.

 
Alexey Viktorov:

Shift by 1 bar, but it will be filled with the current bar reading.

How to shift to history is clear. How do I shift to the future by a bar? It doesn't work that way.

if(BufUP[-1]==EMPTY_VALUE) { BufUP[-1]=low[1];}
 
Ghabo:

How to shift to history is clear. How do I shift to the future by a bar? It doesn't want to.


SetIndexShift to help.
SetIndexShift - Пользовательские индикаторы - Справочник MQL4
SetIndexShift - Пользовательские индикаторы - Справочник MQL4
  • docs.mql4.com
При положительном значении изображение линии смещается вправо, при отрицательном - влево. Значение, рассчитанное на текущем баре, рисуется с указанным смещением относительно текущего бара.
 
novichok2018:

Hello!

Can someone explain why when the Dow-Jones jumps, as it did today, so do DAX30 and SUI30 and UK100, even though the indices are calculated for completely different companies from completely different countries. Somehow all this makes one vaguely suspicious...

And yet, to understand the basics - why is this happening?

 
novichok2018:

And yet, to understand the basics - why does this happen?

The Axioms of the Stock Speculator - Günther Max

Auxiliary axiom number 5. Beware the trap of historical parallels.

Auxiliary axiom #7. Beware of the fallacy of the existence of correlation and causation.

alas, coincidence and nothing more, although it may be a sign of insider information, in general don't guess, you won't guess anyway, and even if you find a link, it's not a fact that it will be the same next time

SZS: there is another riddle...oil goes up in price so gasoline goes up in price, oil goes down in price so gasoline goes up in price...so what do they make gasoline of?

 
people!!! urgently need a bid and ask chart (or an indicator displaying bid and ask movement) who did not understand, need a bid and ask chart instead of a minute seconds etc.