Questions from a "dummy" - page 164

 
papaklass:
Leverage.

Leverage is 100 everywhere.


It worked in MT5!

SymbolInfoDouble(_Symbol,SYMBOL_TRADE_CONTRACT_SIZE);

Now the most important thing is to getthe "Trade contract size" in MT4.

Can you tell me how to get this size in MT4?

 

How do OrdersTotal() and similar functions work?

Specifically, would the second option work faster or the same?

Option 1:

while (i < OrdersTotal()){ ...; i++}


Option 2:

imax = OrdersTotal(); // вместо того чтобы при каждой итерации вызывать функцию, будем обращаться к переменной.

while (i < imax){ ...; i++}

Документация по MQL5: Торговые функции / OrdersTotal
Документация по MQL5: Торговые функции / OrdersTotal
  • www.mql5.com
Торговые функции / OrdersTotal - Документация по MQL5
 
Alphazavr:

How do OrdersTotal() and similar functions work?

Specifically, would the second option be faster or the same?

Option 1:

while (i < OrdersTotal()){ ...; i++}


Option 2:

imax = OrdersTotal(); // вместо того чтобы при каждой итерации вызывать функцию, будем обращаться к переменной.

while (i < imax){ ...; i++}


The second option is faster. But not by much, so optimize either for memory consumption or performance.

OrdersTotal() call costs ~18 µsec, variable access ~0.

 
Urain:

The second option is faster. But not much, so optimise either for memory consumption or performance.

The call to OrdersTotal() costs ~18µs, the variable is accessed in ~0µs.

Thank you. Where can I read more about how such functions work (where they access, how many milliseconds they execute, etc.)?
 
Alphazavr:
Thank you. Where can I read more about how such functions work (where are they accessed, how many milliseconds are executed, etc)?

Write a loop and run it a mile times, measure the time, calculate the average.

But just a heads up, simple codes are optimised, so fake calls are cut off.

 

Am I right in thinking that it's not possible to know which escper or script is attached to the graphic?

I would like to be able to.

 
kPVT:

Am I right in thinking that it's not possible to know which escper or script is attached to the graphic?

I would like to be able to.

As far as I know such a possibility exists. At least for the indices, most likely it is possible to determine the experts.
 
Interesting:
As far as I know, there is such a possibility. At least for indices, most likely, it can be defined for Expert Advisors.

There is nothing wrong with the indicators. It is possible to know the number and which indicators are on the chart, to put an indicator or delete an indicator from the chart.

However, for Expert Advisors and scripts it is not provided, only to stop the work of the Expert Advisor calling ExpertRemove() from the Expert Advisor itself.

Документация по MQL5: Операции с графиками / ChartIndicatorAdd
Документация по MQL5: Операции с графиками / ChartIndicatorAdd
  • www.mql5.com
Операции с графиками / ChartIndicatorAdd - Документация по MQL5
 

Hello!

Could you please suggest the code of an indicator that draws the max and min on the current any minute charts of the previous day's max and min?

SPS!
 
alph:

Hello!

Could you please tell me the code of an indicator that draws the max and min on the current any minute charts of the previous day?

THANK YOU!

Not too hard to redo this one .

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

Camarilla_Full
Camarilla_Full
  • votes: 5
  • 2011.09.07
  • Nikolay Kositsin
  • www.mql5.com
Система уровней Camarilla Equation для всех баров.
Reason: