Errors, bugs, questions - page 385

 
stringo:
Are you calling in the indicator?
Yes, in the indicator.
 
Dima_S:
Yes, in an indicator.

In indicators it is prohibited to call some functions that take up computing resources and slow down the calculation - trade functions, Sleep, MessageBox

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

Good afternoon!

Here's a question: on which server can I test different types of execution?

SYMBOL_TRADE_EXECUTION_REQUEST

Trade on request

SYMBOL_TRADE_EXECUTION_INSTANT

Trade at streaming prices

SYMBOL_TRADE_EXECUTION_MARKET

Execution_market order execution

Execution at flow prices only. We need to debug the code by the market and by request.

Yes, the code is in MQL5, of course.

Thank you!

Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров - Документация по MQL5
 
stringo:

In indicators the call of some functions that take up computing resources and slow down the calculation is prohibited - trade functions, Sleep, MessageBox

I see. So, I will have to calculate it manually. Although in MT4 this function
MarketInfo("EURUSD",MODE_MARGINREQUIRED)

and works fine in the indicator.

 
Dima_S:
I see. So, we will have to calculate it manually. Although in MT4 this function

and in the indicator works fine.

SymbolInfoDouble(MarketInfo) is a simple request for existing information. And OrderCalcMargin - a computing function (in the cross or missing symbol, it can request the missing information from the server, with all its consequences)

 

Good afternoon!

1. will the chart scrolling event be added to the OnChartEvent() event list?

2. Why does the CopyBuffer function placed in a custom indicator cause error 4806,

while the same function with the same parameters in the Expert Advisor code works fine?

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

There is also a question. I would like to know the end time of the trading session for a tool on Friday.

I use the function for this purpose:

  datetime bt,et;
  SymbolInfoSessionTrade("EURUSD",FRIDAY,0,bt,et);

But for some reason, this function always returns false. I do not understand what is the session number and where do I get it from?

Документация по MQL5: Получение рыночной информации / SymbolInfoSessionQuote
Документация по MQL5: Получение рыночной информации / SymbolInfoSessionQuote
  • www.mql5.com
Получение рыночной информации / SymbolInfoSessionQuote - Документация по MQL5
 
bobsley:

There is also a question. I would like to know the end time of the trading session for a tool on Friday.

I use the function for this purpose:

But for some reason function returns false all the time. It's not clear what session number is and where to get it from?

As far as I understand, by sessions we mean trading and quoting sessions within a day. But there is only one session configured on the server (can be only for currencies) - 0.

Physically you can determine the start and end time of trade in the instrument properties (on the server MQ it is 00:00 - 24:00).

You can get it programmatically using SymbolInfoSessionTrade(). But one thing is sure, it won't give exact date of start and end of the session, but relative value in seconds from start of day till the moment of start and end of the session (if translated into seconds of course).

bool InfoSession;
datetime from = -1,to = -1;

InfoSession = SymbolInfoSessionTrade(Symbol(),FRIDAY,0,from,to);

  if(InfoSession)
  {
  Print("Session: from ",from," to ",to);
  Print("Session: from ",(int)from," to ",(int)to);
  }
This is the example that produces the following result -
2011.05.14 19:51:02 ******* Session: from 1970.01.01 00:00:00 to 1970.01.02 00:00:00
2011.05.14 19:51:02 ******* Session: from 0 to 86400

Consequently, to determine the end of trading session on Friday, we need to define the start date of countdown (00:00 concrete Friday) and add to this time the result which the function returned as time of session end.

PS

Also we must consider that server usually closes session with an offset of +/- 1 to 2 seconds.

How it is affected by summer/winter time is also a question, but if my eyes don't lie at closing of the weekend the last quotes were received at 23:00:00 and 23:00:01 (depending on the symbol).

 

Developers!

Please pay attention to my request #105082.

There are problems compiling libraries using export modifier!

 

build 448
When trying to open window properties
or properties of any indicator,
or try to install any indicator on the chart,
client terminal closes.
W XP3 32

In my opinion, this is the "best" update of all.

Reason: